question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[markdown] underscores in URLs produce italicizing

See original GitHub issue

http://goo.com/_foo bar baz [foo](bar)

gets rendered with the _ starting an italicized section, whereas it should just be part of the URL, as rendered below:

http://goo.com/_foo bar baz foo

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
marijnhcommented, Oct 15, 2016

I see. But then is there any reason to expect this underscore not to start an emphasis span? The CommonMark spec suggests treating punctuation (/ in this case) the same as whitespace.

1reaction
mtaran-googlecommented, Oct 14, 2016

I wasn’t talking about any special highlighting of the URL.

We are currently using this config for markdown mode:

  {
    name: 'markdown',
    underscoresBreakWords: false,
    fencedCodeBlocks: true,
    strikethrough: true
  },

The problem, as described above, is that when you paste my example into https://codemirror.net/mode/markdown/ the _ starts an italicized section, which here is undesirable. The desired fix would be some adjustment of the tokenization etc. in the markdown mode so that underscores in contexts like this (e.g. preceded by / and maybe other characters) don’t trigger the start of italicizing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Underscores in URLs break markdown link parsing · Issue #529
The underscore italicizing is the expected behavior for markdown. Github decided that it becomes annoying when there is more than one underscore in...
Read more >
How to format text containing underscore to italic style?
I have changed (almost rewritten) the Markdown regular expressions for bold and italics: client-side change, server-side change.
Read more >
Basic Syntax - Markdown Guide
To italicize text, add one asterisk or underscore before and after a word or phrase. To italicize the middle of a word for...
Read more >
MarkdownSharp is converting Url's that contain underscore ...
** UPDATE: I have just tested entering a url on StackOverflow which I believe uses a version of MarkdownSharp (and AutoHyperlink is enabled...
Read more >
Understanding Markdown | Rick Steves Travel Forum
Italics and Bold: use asterisks and underscores to indicate spans of emphasis. Use one asterisk (or underscore) for italics and two asterisks (or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found