URLs with underscores

John Gruber gruber at fedora.net
Wed Jul 6 15:07:01 EDT 2005


Alastair Rankine <arsptr at optusnet.com.au> wrote on 07/06/05 at 8:41 pm:


> John, I like your ideas but I have one of my own for you to ponder. What

> if we were to disable mid-word emphasis (ie pass underscores through

> unchanged) if any _other_ punctuation was encountered in the word?

>

> http://foo_bar_baz.com => http://foo_bar_baz.com

> foo_bar_baz.cpp => foo_bar_baz.cpp

> foo_bar_baz() => foo_bar_baz()

> path/foo_bar_baz => path/foo_bar_baz

> un_fucking_believable => un<em>fucking</em>believable

> _freeway_ => <em>freeway</em>

> _three_way => <em>three</em>way


That's not a bad idea at all.

But I suspect it might not be enough -- that there might be people
who refer to file names that don't have dot-extensions, or who refer
to subroutines without the parens (`foo_bar_baz` instead of
`foo_bar_baz()`), so I'm not sure this has any advantages over the
previous two ideas.


Another question is whether we should have different rules for `_`
and `*`. Meaning, if we change the rules to say that either or both
of the `_` emphasis markers must occur at a word break, should we
change the rules for `*` to match?

On the one hand, it certainly would simplify the rules /
documentation to just say that the rules for `_` and `*` are exactly
the same, period.

On the other hand, the only people who are complaining about this in
the current implementation are doing so because of `_`, not `*`. I
think this is because `_` occurs commonly in variable and function
names, but `*` does not.

-J.G.


More information about the Markdown-Discuss mailing list