diff --git a/src/format/assets/style.css b/src/format/assets/style.css index 5e462a8..0f71a73 100644 --- a/src/format/assets/style.css +++ b/src/format/assets/style.css @@ -1,11 +1,12 @@ body { background-color: #DDD; + overflow-x: hidden; } .content { font-family: "Noto Sans", SansSerif, sans-serif; width: 100vh; - max-width: 100%; + max-width: calc(100% - 4rem); padding: 2rem; margin: auto; background-color: #FFF; @@ -25,6 +26,22 @@ code pre { border-radius: 0.25em; } +code { + font-family: "Fira Code", monospace; + padding: 0 0.1em; + background-color: #DDD; + border-radius: 0.1em; +} + +.tableWrapper { + overflow-x: auto; + width: 100%; +} + +.tableWrapper > table { + margin: auto; +} + table { border-collapse: collapse; } @@ -41,7 +58,7 @@ table tr:nth-child(1) { table td, table th { border-left: 1px solid black; - padding: 0.2em + padding: 0.2em 0.5em } table tr td:first-child, table tr th:first-child { @@ -52,6 +69,8 @@ blockquote { margin-left: 0 } +p p, p a, p b, + .quote { border-left: 0.3em solid gray; border-radius: 0.2em; diff --git a/src/format/html.rs b/src/format/html.rs index eccd98a..f14e020 100644 --- a/src/format/html.rs +++ b/src/format/html.rs @@ -108,7 +108,7 @@ impl ToHtml for Paragraph { .elements .iter() .fold("".to_string(), |a, b| combine_with_lb!(a, b)); - minify(format!("

{}

", inner).as_str()) + format!("

{}

", inner) } } @@ -153,7 +153,10 @@ impl ToHtml for Table { .rows .iter() .fold("".to_string(), |a, b| format!("{}{}", a, b.to_html())); - format!("{}{}
", head, body) + format!( + "
{}{}
", + head, body + ) } } @@ -217,15 +220,18 @@ impl ToHtml for Text { impl ToHtml for Image { fn to_html(&self) -> String { if let Some(description) = self.url.description.clone() { - format!( - "
\ - \ - {1}\ - \ - \ -
", - self.url.url.clone(), - description + minify( + format!( + "
\ + \ + {1}\ + \ + \ +
", + self.url.url.clone(), + description + ) + .as_str(), ) } else { format!("", self.url.url.clone(),) diff --git a/src/parser.rs b/src/parser.rs index f6e2672..7c735da 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -595,7 +595,7 @@ impl Parser { /// parses a markdown table fn parse_table(&mut self) -> Result { - let header = self.parse_row()?; + let header = self.parse_row()?; // TODO: Fix this row not being included let start_index = self.index; self.seek_whitespace(); if self.check_special(&MINUS) {