Skip to content

Commit fb58c5d

Browse files
authored
Merge pull request #1869 from ehuss/fix-smart-punctuation-grammar
Fix smart punctuation inside grammar terminals
2 parents 6645bd7 + 2478602 commit fb58c5d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mdbook-spec/src/grammar/render_markdown.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ impl Characters {
223223

224224
/// Escapes characters that markdown would otherwise interpret.
225225
fn markdown_escape(s: &str) -> Cow<'_, str> {
226-
static ESC_RE: LazyLock<Regex> = LazyLock::new(|| Regex::new(r#"[\\`_*\[\](){}'"]"#).unwrap());
226+
static ESC_RE: LazyLock<Regex> =
227+
LazyLock::new(|| Regex::new(r#"[\\`_*\[\](){}'".-]"#).unwrap());
227228
ESC_RE.replace_all(s, r"\$0")
228229
}

0 commit comments

Comments
 (0)