[Web] Fix errors in ol/ul generation
This commit is contained in:
parent
3889c79422
commit
5308e81a87
@ -4,7 +4,11 @@ use super::Printable;
|
||||
|
||||
impl Printable for InlineCode {
|
||||
fn to_html(&self) -> String {
|
||||
format!("<code>{}</code>", self.value)
|
||||
let s = self.value
|
||||
.replace("<", "<")
|
||||
.replace(">", ">");
|
||||
|
||||
format!("<code>{}</code>", s)
|
||||
}
|
||||
|
||||
fn get_text(&self) -> String {
|
||||
|
@ -14,7 +14,11 @@ impl Printable for List {
|
||||
|
||||
let str: String = result.into_iter().collect();
|
||||
|
||||
if self.ordered {
|
||||
format!("<ol class=\"list-decimal list-inside\">{}</ol>", str)
|
||||
} else {
|
||||
format!("<ul class=\"list-disc list-inside\">{}</ul>", str)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_text(&self) -> String {
|
||||
|
@ -55,70 +55,3 @@ impl Printable for Node {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
List {
|
||||
children: [
|
||||
ListItem {
|
||||
children: [
|
||||
Paragraph {
|
||||
children: [
|
||||
InlineCode {
|
||||
value: "\\\"", position: Some(88:3-88:7 (1728-1732)) }
|
||||
],
|
||||
position: Some(88:3-88:7 (1728-1732)) }
|
||||
],
|
||||
position: Some(88:1-89:1 (1726-1733)), spread: false, checked: None }
|
||||
, ListItem {
|
||||
children: [
|
||||
Paragraph {
|
||||
children: [
|
||||
InlineCode {
|
||||
value: "\\\\", position: Some(90:3-90:7 (1736-1740)) }
|
||||
],
|
||||
position: Some(90:3-90:7 (1736-1740)) }
|
||||
],
|
||||
position: Some(90:1-90:7 (1734-1740)), spread: false, checked: None }
|
||||
, ListItem {
|
||||
children: [
|
||||
Paragraph {
|
||||
children: [
|
||||
InlineCode {
|
||||
value: "\\n", position: Some(91:3-91:7 (1743-1747)) }
|
||||
],
|
||||
position: Some(91:3-91:7 (1743-1747)) }
|
||||
],
|
||||
position: Some(91:1-91:7 (1741-1747)), spread: false, checked: None }
|
||||
, ListItem {
|
||||
children: [
|
||||
Paragraph {
|
||||
children: [
|
||||
InlineCode {
|
||||
value: "\\r", position: Some(92:3-92:7 (1750-1754)) }
|
||||
],
|
||||
position: Some(92:3-92:7 (1750-1754)) }
|
||||
],
|
||||
position: Some(92:1-92:7 (1748-1754)), spread: false, checked: None }
|
||||
, ListItem {
|
||||
children: [
|
||||
Paragraph {
|
||||
children: [
|
||||
InlineCode {
|
||||
value: "\\t", position: Some(93:3-93:7 (1757-1761)) }
|
||||
],
|
||||
position: Some(93:3-93:7 (1757-1761)) }
|
||||
],
|
||||
position: Some(93:1-93:7 (1755-1761)), spread: false, checked: None }
|
||||
, ListItem {
|
||||
children: [
|
||||
Paragraph {
|
||||
children: [
|
||||
InlineCode {
|
||||
value: "\\b", position: Some(94:3-94:7 (1764-1768)) }
|
||||
],
|
||||
position: Some(94:3-94:7 (1764-1768)) }
|
||||
],
|
||||
position: Some(94:1-95:1 (1762-1769)), spread: false, checked: None }
|
||||
],
|
||||
position: Some(88:1-95:1 (1726-1769)), ordered: false, start: None, spread: true }
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user