extension(typographer): don't treat the leading apostrophe in 'terrifying' as a contraction - #554
Conversation
…' as a contraction Closes yuin#347. The 'twas/'em/'net contraction rule matched any apostrophe at a word boundary followed by t/e/n/l, so 'terrifying' rendered as ’terrifying’ instead of ‘terrifying’. Skip the contraction shortcut when the rest of the line still has a single quote that looks like the closing half of a quoted phrase (followed by space, punct, or EOL). 'net in 'We're talking about the internet --- 'net for short.' still resolves as a contraction since the remaining apostrophes there are mid-word. Signed-off-by: Charlie Tonneslan <cst0520@gmail.com>
|
Thanks for picking this up — I ran into #347 on a bilingual site and tested this patch against v1.8.6 (stock vs.
1. Hard-wrapped source is not covered. We know this as 'non-alcoholic fatty liver
disease'.2. A genuine elision followed by a quoted phrase on the same line now opens a quote. The lookahead cannot distinguish "the closing half of my quote" from "an unrelated quote later in the line", so the canonical Both fall out of the same thing — the rule keys on one byte plus a fuzzy line scan, rather than on the elisions it is named after. Matching the actual set ( If it helps, the three rows above marked ⚠ plus the wrapped case would make reasonable additions to |
Closes #347.
The
'twas/'em/'netcontraction rule fired on any apostrophe at a word boundary followed byt/e/n/l, so'terrifying'rendered as’terrifying’instead of‘terrifying’.Skip the contraction shortcut when the rest of the line still has a single quote that looks like the closing half of a quoted phrase (followed by space, punct, or EOL).
'netin We're talking about the internet --- 'net for short. still resolves as a contraction because the remaining apostrophes there are mid-word.Test 20 added to
typographer.txt, existing cases still pass.