views:

142

answers:

3

Greetings,

I am using BlueCloth as a Markdown library for Ruby and I can't find any syntax for getting a text underlined. Any ideas?

Peter

A: 

doesn't simple <u>some text</u> work for you?

zed_0xff
I forgot to say that I use the :escape_html option so an user cannot destroy my layout or inject some javascripts. I render that way: `BlueCloth.new("<u>foo</u>", :escape_html => true).to_html`.That will escape the <u> tag.
Peter
then you cannot have a underlined text. only to manually unescape produced `<u>` and `</u>` back to `<u>` and `</u>`
zed_0xff
Wow, one really can have <b> and <i> but not <u>? Why that? :(
Peter
+1  A: 

Markdown doesn't have a defined syntax to underline text.

I guess this is because underlined text is hard to read, and that it's usually used for hyperlinks.

nfm
A: 

Another reason is that <u> tags are deprecated in XHTML and HTML5, so it would need to produce something like <span style="text-decoration:underline">this</span>. (IMHO, if <u> is deprecated, so should be <b> and <i>.) Note that Markdown produces <strong> and <em> instead of <b> and <u>, respectively, which explains the purpose of the text therein instead of its formatting. Formatting should be handled by stylesheets.

Jordan