Skip to content

Commit 4722ccb

Browse files
Allow admonition blockquotes with blank lines
This fixes an issue where if an admonition blockquote had multiple paragraphs, it would incorrectly interpret it as multiple blockquotes, and break the formatting. The problem is that the regex was expecting at least one space after the `>`. I vaguely recall doing this intentionally, but I don't remember now why I did it this way, and I can't find any problems with this approach.
1 parent 80639e6 commit 4722ccb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mdbook-spec/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ static RULE_RE: Lazy<Regex> = Lazy::new(|| Regex::new(r"(?m)^r\[([^]]+)]$").unwr
1919
/// The Regex for the syntax for blockquotes that have a specific CSS class,
2020
/// like `> [!WARNING]`.
2121
static ADMONITION_RE: Lazy<Regex> = Lazy::new(|| {
22-
Regex::new(r"(?m)^ *> \[!(?<admon>[^]]+)\]\n(?<blockquote>(?: *> .*\n)+)").unwrap()
22+
Regex::new(r"(?m)^ *> \[!(?<admon>[^]]+)\]\n(?<blockquote>(?: *>.*\n)+)").unwrap()
2323
});
2424

2525
pub fn handle_preprocessing(pre: &dyn Preprocessor) -> Result<(), Error> {

0 commit comments

Comments
 (0)