Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

Fix and enhance en/em dash translation #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions asciidoc.conf
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ lsquo=‘
rsquo=’
ldquo=“
rdquo=”
compat-mode=

[titles]
subs=specialcharacters,quotes,replacements,macros,attributes,replacements2
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion latex.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down