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
[GFM] wrong ID generation for headers containing -- #459
Comments
If we change the way link generation works for the GFM parser, it might break existing documents. However, since it is GFM we are talking about and the implementation in kramdown is not quite complete, I would consider such a change a bug fix and not a feature change. A pull request for this is welcome. |
With GFM, we want to be as close as possible to GitHub Flavored Markdown. In particular, GitHub does not replace -- with en-dash, --- with em-dash et cetera, and doing this not only breaks HTML rendering (resulting in, say, –option instead of --option), but also makes header IDs incompatible with those generated by GitHub. So, let's turn automatic typographic symbol conversion by default, and add an option to enable it back. For more details on the issue and examples, see gettalong#459 Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
With GFM, we want to be as close as possible to GitHub Flavored Markdown. In particular, GitHub does not replace -- with en-dash, --- with em-dash et cetera, and doing this not only breaks HTML rendering (resulting in, say, –option instead of --option), but also makes header IDs incompatible with those generated by GitHub. So, let's turn automatic typographic symbol conversion by default, and add an option to enable it back. For more details on the issue and examples, see gettalong#459 Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
OK, I have a PR with a patch that apparently works. I'm just not sure about it as my Ruby knowledge is totally non-existent, to say at least. |
With GFM, we want to be as close as possible to GitHub Flavored Markdown. In particular, GitHub does not replace -- with en-dash, --- with em-dash et cetera, and doing this not only breaks HTML rendering (resulting in, say, –option instead of --option). This replacement also makes header IDs incompatible with those generated by GitHub, making it way harder to create a document with intralinks that work both on GitHub and kramdown-generated HTML. So, let's introduce another GFM quirk to turn off automatic typographic symbol conversion. NOTE it needs to be explicitly enabled. For more details on the issue and examples, see gettalong#459 Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
With GFM, we want to be as close as possible to GitHub Flavored Markdown. In particular, GitHub does not replace -- with en-dash, --- with em-dash et cetera, and doing this not only breaks HTML rendering (resulting in, say, –option instead of --option). The above replacement also makes header IDs incompatible with those generated by GitHub, making it way harder to create a document with intralinks that work both on GitHub and kramdown-generated HTML. So, let's introduce another GFM quirk to turn off automatic typographic symbol conversion. NOTE it is off by default, i.e. needs to be explicitly enabled. For more details on the issue and examples, see gettalong#459 Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Pull request #462 is applied. |
With GFM, we want to be as close as possible to GitHub Flavored Markdown. In particular, GitHub does not replace -- with en-dash, --- with em-dash et cetera, and doing this not only breaks HTML rendering (resulting in, say, –option instead of --option). The above replacement also makes header IDs incompatible with those generated by GitHub, making it way harder to create a document with intralinks that work both on GitHub and kramdown-generated HTML. So, let's introduce another GFM quirk to turn off automatic typographic symbol conversion. NOTE it is off by default, i.e. needs to be explicitly enabled. For more details on the issue and examples, see #459 Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Kramdown 1.16 includes GFM quirk `no_auto_typographic for disabling typographic conversions, which is usable to fix issues like gettalong/kramdown#459 Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Consider the following fragment of an
.md
file on github:The above gets rendered by GitHub to the following:
...
see --foobar option below.
...
Option --foobar
Now, if we use kramdown GFM to convert this .md, we'll have the following two problems:
option-foobar
rather than github'soption---foobar
. The reason is the above double-dash -> ndash conversion.While the first issue is only bad in some specific cases, the second one is really bad as it breaks some intralinks in the resulting document. Perhaps it makes sense to disable double-dash and triple-dash conversion for GFM (say, another option to gfm_quirks)?
The text was updated successfully, but these errors were encountered: