summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2023-11-02 19:36:25 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2023-11-02 19:36:25 -0700
commit5132f1ef330d3eb2a0bf87037035beaeaf19d3f3 (patch)
tree3ee9c94df338ff152c2fe137dcf87b78f2fcced1 /src
parent051fa7d5741bc731b78b2dc1696ddbaaa54139ff (diff)
T.P.RoffChar: escape `-` as `\-`.
The groff_man (7)` man page indicates that `-` characters will be treated as typographic hyphens and are not appropriate for cases where the output should be copy-pasteable as an ASCII hyphen-minus character. (E.g. in command line options.) However, until a recent update groff man did not actually do this; it treated `-` and `\-` the same. With the new update (1.23.0) the two are distinguished (see https://lwn.net/Articles/947941/ for background), so now it is important that pandoc escape `-`. This reverts ee60ba5252360d2efbf9cf30197236a21a15a924. That change was motivated by a problem with backslash-escaping `-` in a filename for .PSPIC. That's simply a separate issue; we shouldn't do the normal escapes in such a context. It has been addressed in the previous commit.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/RoffChar.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Text/Pandoc/RoffChar.hs b/src/Text/Pandoc/RoffChar.hs
index f95532841..f908d6133 100644
--- a/src/Text/Pandoc/RoffChar.hs
+++ b/src/Text/Pandoc/RoffChar.hs
@@ -34,6 +34,7 @@ standardEscapes =
, ('`', "\\[ga]")
, ('^', "\\[ha]")
, ('~', "\\[ti]")
+ , ('-', "\\-")
, ('\\', "\\[rs]")
, ('@', "\\[at]") -- because we use @ as a table and math delimiter
, ('\x2026', "\\&...") -- because u2026 doesn't render on tty