diff --git a/asciidoc.conf b/asciidoc.conf index cb9fb5b..134d7fc 100644 --- a/asciidoc.conf +++ b/asciidoc.conf @@ -52,6 +52,7 @@ lsquo=‘ rsquo=’ ldquo=“ rdquo=” +compat-mode= [titles] subs=specialcharacters,quotes,replacements,macros,attributes,replacements2 @@ -124,6 +125,22 @@ monospacedwords= (\w)--(\w)=\1—\2 \\--(?!-)=-- +ifndef::compat-mode[] +# --- Spaced and unspaced em dashes (entity reference —). +# Space on both sides is translated to thin space characters. +(^--- )=—  +(\n--- )|( --- )|( ---\n)= —  +(\w)---(\w)=\1—\2 +\\---(?!-)=--- + +# -- Spaced and unspaced en dashes (entity reference –). +# Space on both sides is translated to thin space characters. +(^-- )=–  +(\n-- )|( -- )|( --\n)= –  +(\w)--(\w)=\1–\2 +\\--(?!-)=-- +endif::compat-mode[] + # Replace vertical typewriter apostrophe with punctuation apostrophe. (\w)'(\w)=\1’\2 (\w)\\'(\w)=\1'\2 diff --git a/latex.conf b/latex.conf index f8b7b17..a4cf13b 100644 --- a/latex.conf +++ b/latex.conf @@ -70,7 +70,10 @@ _=\_{} # Line break. (?m)^(.*)\s\+$=\1 !..backslash..!newline!..braceleft..!!..braceright..! -# -- Spaced em dashes (entity reference —) +# --- Spaced em dashes (entity reference —) +(^|[^-\\])---($|[^-])=\1---\2 + +# -- Spaced en dashes (entity reference –) (^|[^-\\])--($|[^-])=\1--\2