From 8c0342ffd57527cc649737c258ceb9485c45d36c Mon Sep 17 00:00:00 2001 From: Charlotte Koch Date: Fri, 13 Sep 2024 17:19:10 -0700 Subject: New approach for dealing with unmatched double quotes. The old solution had a subtle, unwanted side-effect which didn't account for closed double quotes butted against a nonword character (e.g. em-dash or ellipsis). This approach is much better. It delegates the handling of curly double quotes to Asciidoctor as much as possible *except for* the singular times where we need to make an exception. --- script/unicodify.sed | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/script/unicodify.sed b/script/unicodify.sed index 358586a..ae33151 100644 --- a/script/unicodify.sed +++ b/script/unicodify.sed @@ -1,9 +1,16 @@ # Remove spaces on either end of an em-dash. s,[[:space:]]--[[:space:]],\&\#8212;,g -# Explicitly handle double-quotes before single-quotes. -s,"`,\&\#8220;,g -s,`",\&\#8221;,g +# WilloraPDF extension: explicit "unmatched" double-quote shortcuts. +# +# This is to work around a shortcoming in Asciidoctor when a double-quote is +# right up against a non-word character -- em-dashes, ellipses, etc. TL;DR +# it's better to let Asciidoctor handle ("`) and (`") automatically by +# default EXCEPT FOR the times we need to wrangle it ourselves. +s,\&_OPENDOUBLEQUOTE;,\&\#8220;,g +s,\&_CLOSEDOUBLEQUOTE;,\&\#8221;,g + +# Curly single quotes. s,'`,\&\#8216;,g s,`',\&\#8217;,g -- cgit v1.2.3