diff --git a/src/html.rs b/src/html.rs index 7b83f3a8..1f5d9210 100644 --- a/src/html.rs +++ b/src/html.rs @@ -1155,13 +1155,14 @@ where NodeValue::Alert(ref alert) => { if entering { self.cr()?; - self.output.write_all(b"
")?; + self.output + .write_all(b"
")?; match alert.title { Some(ref title) => self.escape(title.as_bytes())?, None => { diff --git a/src/parser/alert.rs b/src/parser/alert.rs index 32b82314..3c2068fa 100644 --- a/src/parser/alert.rs +++ b/src/parser/alert.rs @@ -52,11 +52,11 @@ impl AlertType { /// Returns the CSS class to use for an alert type pub(crate) fn css_class(&self) -> String { match *self { - AlertType::Note => String::from("alert-note"), - AlertType::Tip => String::from("alert-tip"), - AlertType::Important => String::from("alert-important"), - AlertType::Warning => String::from("alert-warning"), - AlertType::Caution => String::from("alert-caution"), + AlertType::Note => String::from("markdown-alert-note"), + AlertType::Tip => String::from("markdown-alert-tip"), + AlertType::Important => String::from("markdown-alert-important"), + AlertType::Warning => String::from("markdown-alert-warning"), + AlertType::Caution => String::from("markdown-alert-caution"), } } } diff --git a/src/parser/mod.rs b/src/parser/mod.rs index 7d4e7cf1..07369bad 100644 --- a/src/parser/mod.rs +++ b/src/parser/mod.rs @@ -434,7 +434,7 @@ pub struct ExtensionOptions<'c> { /// let mut options = Options::default(); /// options.extension.alerts = true; /// assert_eq!(markdown_to_html("> [!note]\n> Something of note", &options), - /// "
Note
\nSomething of note
\nNote
\nSomething of note
\nNote
\n", + "Note
\n", "Pay attention
\n", "Note
\n", + "Note
\n", "Pay attention
\n", "Note
+Note
Highlights information that users should take into account, even when skimming.
Note
+Note
Highlights information that users should take into account, even when skimming.
Note
+Note
Highlights information that users should take into account, even when skimming.
Note
+Note
Highlights information that users should take into account, even when skimming.
Paragraph two.
Tip
+Tip
Optional information to help a user be more successful.
Important
+Important
Crucial information necessary for users to succeed.
Warning
+Warning
Critical content demanding immediate user attention due to potential risks.
Caution
+Caution
Negative potential consequences of an action.
Pay attention
+Pay attention
Highlights information that users should take into account, even when skimming.