sunaku / md2man

📚 Converts markdown into UNIX manual pages
https://sunaku.github.io/md2man/man
Other
374 stars 23 forks source link

Lines beginning with single quotes vanish in rendered roff output (insufficient escaping of special characters) #14

Closed nfagerlund closed 11 years ago

nfagerlund commented 11 years ago

I assume a line starting with a quote or apostrophe is supposed be a comment in roff? If so, md2man should automatically escape any and all instances of these to keep an innocent paragraph wrap from deleting text at random.

This:

USAGE NOTES
-----------
'puppet agent' does its best to find a compromise between interactive
use and daemon use. Run with no arguments and no configuration, it will
go into the background, attempt to get a signed certificate, and retrieve
and apply its configuration every 30 minutes.

Some flags are meant specifically for interactive use -- in particular,
'test', 'tags' or 'fingerprint' are useful. 'test' enables verbose
logging, causes the daemon to stay in the foreground, exits if the
server's configuration is invalid (this happens if, for instance, you've
left a syntax error on the server), and exits after running the
configuration once (rather than hanging around as a long-running
process).

Becomes this:

USAGE NOTES

use and daemon use. Run with no arguments and no configuration, it will go into the background, attempt to get a signed certificate, and retrieve and apply its configuration every 30 minutes.

Some flags are meant specifically for interactive use -- in particular, logging, causes the daemon to stay in the foreground, exits if the server's configuration is invalid (this happens if, for instance, you've left a syntax error on the server), and exits after running the configuration once (rather than hanging around as a long-running process).

sunaku commented 11 years ago

Thanks for reporting this bug! :sweat_smile: Please try the fix in commit f9d396c3e73306d7820dfd232086a69670e8f403:

' The single quote has two controlling tasks. At the beginning of a line and in the conditional requests it is the non-breaking control character. That means that it introduces a request like the dot, but with the additional property that this request doesn't cause a linebreak. By using the c2 request, the non-break control character can be set to a different character.

sunaku commented 11 years ago

In fact, try the issue-14 branch which contains even more fixes. :cake:

nfagerlund commented 11 years ago

That does seem to have fixed it! And thank you for investigating backslashes etc. as well; that was probably going to become my next problem. :)

sunaku commented 11 years ago

Great! Fixes merged into patch branch for inclusion in the next gem release. :gift: