diff --git a/fuzz/fuzz_targets/all_options.rs b/fuzz/fuzz_targets/all_options.rs index 3b740087..f6b608fa 100644 --- a/fuzz/fuzz_targets/all_options.rs +++ b/fuzz/fuzz_targets/all_options.rs @@ -187,6 +187,7 @@ struct FuzzRenderOptions { r#unsafe: bool, escape: bool, list_style: options::ListStyleType, + alert_style: options::AlertStyleType, sourcepos: bool, escaped_char_spans: bool, ignore_empty_links: bool, @@ -209,6 +210,7 @@ impl FuzzRenderOptions { r#unsafe: self.r#unsafe, escape: self.escape, list_style: self.list_style, + alert_style: self.alert_style, sourcepos: self.sourcepos, escaped_char_spans: self.escaped_char_spans, ignore_empty_links: self.ignore_empty_links, diff --git a/fuzz/fuzz_targets/quadratic.rs b/fuzz/fuzz_targets/quadratic.rs index 09178734..bf22ba8a 100644 --- a/fuzz/fuzz_targets/quadratic.rs +++ b/fuzz/fuzz_targets/quadratic.rs @@ -260,6 +260,7 @@ struct FuzzRenderOptions { r#unsafe: bool, escape: bool, list_style: options::ListStyleType, + alert_style: options::AlertStyleType, sourcepos: bool, escaped_char_spans: bool, } @@ -274,6 +275,7 @@ impl FuzzRenderOptions { r#unsafe: self.r#unsafe, escape: self.escape, list_style: self.list_style, + alert_style: self.alert_style, sourcepos: self.sourcepos, escaped_char_spans: self.escaped_char_spans, ..Default::default() diff --git a/src/html.rs b/src/html.rs index 3953efb7..9f22f5fb 100644 --- a/src/html.rs +++ b/src/html.rs @@ -23,7 +23,7 @@ use crate::nodes::{ NodeFootnoteReference, NodeHeading, NodeHtmlBlock, NodeLink, NodeList, NodeMath, NodeTaskItem, NodeValue, NodeWikiLink, TableAlignment, }; -use crate::parser::options::{Options, Plugins}; +use crate::parser::options::{AlertStyleType, Options, Plugins}; use crate::{node_matches, scanners}; #[doc(hidden)] @@ -1284,13 +1284,25 @@ fn render_alert( ) -> Result { if entering { context.cr()?; - context.write_str("
"
"
")?; + context.write_str(match context.options.render.alert_style { + AlertStyleType::Specific => "
", + AlertStyleType::Semantic => "", + })?; context.lf()?; } diff --git a/src/main.rs b/src/main.rs index 6c5b2a64..d0870481 100644 --- a/src/main.rs +++ b/src/main.rs @@ -155,6 +155,10 @@ struct Cli { #[arg(long, value_enum, default_value_t = ListStyle::Dash)] list_style: ListStyle, + /// Specify alert style (
vs