feat(elements): comment and fixed width elements
This commit is contained in:
parent
bd1fc756bd
commit
275fbfad34
4 changed files with 85 additions and 136 deletions
|
|
@ -156,6 +156,18 @@ pub trait HtmlHandler<E: From<Error>> {
|
|||
fn fn_def<W: Write>(&mut self, mut w: W, fn_def: &FnDef<'_>) -> Result<(), E> {
|
||||
Ok(())
|
||||
}
|
||||
fn comment<W: Write>(&mut self, mut w: W, value: &str) -> Result<(), E> {
|
||||
write!(&mut w, "<!--\n")?;
|
||||
self.text(&mut w, value)?;
|
||||
write!(&mut w, "\n-->")?;
|
||||
Ok(())
|
||||
}
|
||||
fn fixed_width<W: Write>(&mut self, mut w: W, value: &str) -> Result<(), E> {
|
||||
write!(&mut w, "<pre>")?;
|
||||
self.text(&mut w, value)?;
|
||||
write!(&mut w, "</pre>")?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
pub struct DefaultHtmlHandler;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue