You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by tkurtbond January 13, 2025
Why does pandoc convert hyphen-minus to minus signs in text when outputing to ms?
For instance, why does running
# Trying out Hyphen-Minus in pandoc -w ms
This is a hyphen-minus, -, which pandoc -w ms turns into a Unicode minus sign.
Use the command ``ls -a`` to see all the dotfiles in a directory.
through
pandoc -r markdown -w ms --output=hyphen-minus.ms hyphen-minus.md
become
.SH 1
Trying out Hyphen\-Minus in pandoc \-w ms
.pdfhref O 1 "Trying out Hyphen-Minus in pandoc -w ms"
.pdfhref M "trying-out-hyphen-minus-in-pandoc--w-ms"
.LP
This is a hyphen\-minus, \-, which pandoc \-w ms turns into a Unicode
minus sign.
.PP
Use the command \f[CR]ls \-a\f[R] to see all the dotfiles in a
directory.
with all those blasted \-s, which are the troff form for entering a minus sign?
Automagically changing hypen-minus to minus signs is never a good thing to do. It changes the example ls -a command to something that won't work because instead of a hyphen-minus it has a stupid minus sign, which is not the character that introduces an option in a command line program, so the command doesn't work right.
The discussion of thesmart extension in the documents doesn't say anything aobut translating hypen-minus to minus, but I tried -r markdown-smart, which didn't seem to do anything.
$ pandoc --version
pandoc 3.6.2
Features: +server +lua
Scripting engine: Lua 5.4
User data directory: /home/tkb/.pandoc
(Didn't I have this discussion on the old pandoc-discuss mailing list once?)
The text was updated successfully, but these errors were encountered:
jgm
changed the title
Why does hyphen-minus get converted to minus in text when outputing to ms?- should be escaped as \- in man, but not in ms output
Jan 14, 2025
In 5132f1e we added `-` to
the list of characters needing backslash escaping, to accommodate
a change in groff man's behavior, described here:
https://lwn.net/Articles/947941/
This change also led `-` to be escaped in ms output, but that
is wrong; `\-` in ms is a unicode minus sign.
To fix this, we add a Boolean parameter to `escapeString` in
Text.Pandoc.Writers.Roff that determines whether `-` is to
be escaped. (NB: This is not an exported function in the API.)
The list `standardEscapes` in Text.Pandoc.RoffChar no longer
contains `-`.
Closes#10536.
Discussed in #10533
Originally posted by tkurtbond January 13, 2025
Why does pandoc convert hyphen-minus to minus signs in text when outputing to ms?
For instance, why does running
through
become
with all those blasted
\-
s, which are the troff form for entering a minus sign?Automagically changing hypen-minus to minus signs is never a good thing to do. It changes the example
ls -a
command to something that won't work because instead of a hyphen-minus it has a stupid minus sign, which is not the character that introduces an option in a command line program, so the command doesn't work right.The discussion of the
smart
extension in the documents doesn't say anything aobut translating hypen-minus to minus, but I tried-r markdown-smart
, which didn't seem to do anything.(Didn't I have this discussion on the old pandoc-discuss mailing list once?)
The text was updated successfully, but these errors were encountered: