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

Underscores in words #96

Closed
SystemParadox opened this issue Mar 20, 2014 · 7 comments
Closed

Underscores in words #96

SystemParadox opened this issue Mar 20, 2014 · 7 comments
Assignees

Comments

@SystemParadox
Copy link

As described in Github flavoured markdown, it makes no sense to italicise parts of a word.

Underscores in words usually refer to something like a variable or field name so it is particularly bad when these are parsed out and converted to italics.

Please can showdown be changed to use the github rules for this.

Thanks.

@shhQuiet
Copy link

Came here to find any issues related to underscores/asterisks/etc embedded in URLs, for example:

![my cat](http://myserver.com/my_kitty.jpg)

This ultimately results in malformed HTML, so I think it's essentially the same issue as mentioned by @SystemParadox

@tivie tivie self-assigned this Jan 18, 2015
@pdeschen pdeschen added the bug label Jan 23, 2015
@zachad
Copy link

zachad commented Mar 27, 2015

Edit: Just put a backslash in front of the underscore and it will prevent this situation.

@pdeschen
Copy link
Contributor

@zachad thanks for posting the work around!

@tivie tivie removed the bug label Apr 22, 2015
@tivie
Copy link
Member

tivie commented Jun 17, 2015

@pdeschen It's not a bug, it's by design

As described in Github flavoured markdown, it makes no sense to italicise parts of a word.

Showdown is vanilla markdown. As stated in the original specifications:

Emphasis can be used in the middle of a word:

un*frigging*believable

But if you surround an * or _ with spaces, it’ll be treated as a literal asterisk or underscore.

The correct way to prevent the behavior (or to create a literal asterisk or underscore) is to escape it with backslash, as stated in the specs:

To produce a literal asterisk or underscore at a position where it would otherwise be used as an emphasis delimiter, you can backslash escape it:

\*this text is surrounded by literal asterisks\*

@tivie tivie closed this as completed Jun 17, 2015
@tivie
Copy link
Member

tivie commented Jun 17, 2015

Also I could not reproduce the issue @shhQuiet refers to!

Please provide an example where showdown incorrectly parses links and images with underscore so we can have a better understanding of the issue.

tivie added a commit that referenced this issue Jun 17, 2015
@SystemParadox
Copy link
Author

Showdown is vanilla markdown

But vanilla markdown is unmaintained and broken in this behaviour. Could an option be added to support github flavoured markdown?

Thanks.

@tivie
Copy link
Member

tivie commented Jun 18, 2015

@SystemParadox @pdeschen #164

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

5 participants