Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

\- are not escaped in output #9

Closed
vapier opened this issue Jan 9, 2020 · 3 comments
Closed

\- are not escaped in output #9

vapier opened this issue Jan 9, 2020 · 3 comments
Assignees
Milestone

Comments

@vapier
Copy link

vapier commented Jan 9, 2020

unescaped - run the risk of being automatically converted to other characters in outputs depending on what follows it. -- is commonly converted to an – (U+2013 endash). this is undesirable for code documentation like command line options as they no longer can be copied & pasted. that's why man pages will often write \-\-foo for the --foo command line option.

depending on the renderer, markdown has this feature as well -- it creates endashes whenever it sees --. this def happens on github pages for example.

the current man-to-md script will strip away the \ from something like \-\-foo yielding --foo which turns into –foo which is not good :).

i think just leaving \- as \- should be fine for most markdown renderers ?

@mle86
Copy link
Owner

mle86 commented Jan 10, 2020

Doesn't seem to be a problem with the README.md renderer:
see https://github.com/mle86/man-to-md/blob/v0.15.4/README.md#options

But I can easily add a command line option to escape all dashes in the output.

@mle86 mle86 self-assigned this Jan 10, 2020
@mle86 mle86 added this to the v0.16.0 milestone Jan 10, 2020
@vapier
Copy link
Author

vapier commented Jan 11, 2020

not sure where this is documented. GitHub pages seem to more actively convert content which is where i've been seeing the "--" converted to endashes. smart quotes are a common thing too, although less commonly a problem (e.g. "foo" to “foo”).

@mle86 mle86 closed this as completed in 87ff578 Jan 11, 2020
@vapier
Copy link
Author

vapier commented Jan 11, 2020

thanks, it works well for me now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants