summaryrefslogtreecommitdiff
path: root/script/unicodify.sed
blob: a95fec0305c8c440c0a98982cf431382f91b1f03 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Remove spaces on either end of an em-dash or ellipsis.
s,[[:space:]]--[[:space:]],\&\#8212;,g
s,[[:space:]]\.\.\.[[:space:]],\&\#8230;,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

# Explicitly handle curly double quotes before curly single quotes.
s,"`,\&\#8220;,g
s,`",\&\#8221;,g
s,'`,\&\#8216;,g
s,`',\&\#8217;,g

# Diacritics.
s,\ç,\&\#231;,g
s,\è,\&\#232;,g
s,\é,\&\#233;,g
s,\ï,\&\#239;,g

# Remove Asciidoc comments now, for the sake of getting more accurate
# wordcounts.
s,//.*,,g