Possible Duplicate:
How do I set an HTML class attribute in Markdown?
In my original link done in plain HTML I have a class attribute like so:
<a href="http://example.com" class="noborder">my link</a>
How do I translate it to Markdown? I don't know how to put the class in.
[mylink](http://example.com)
No. But... No, Markdown's syntax can't. You can set ID values with Markdown Extra through.
Brian is right. The standard Markdown dialect does not let you add classes, attributes, or ids to elements. That said, there are other dialects such as Maruku that do you give this sort of flexibility by introducing a meta-data syntax. Here's a couple example of what it looks like:
## A header with an id ## {: #the-head} // => <h2 id="the-head">A header with an id</h2> [a special url](/my-special-place.html){: .special} // => <a href="/my-special-place.html" class="special">a special url</a> A paragraph with a random attribute {: random=attribute} // => <p random="attribute">A paragraph with a random attribute</p>
For more information check out the Maruku meta-data proposal.
You can't put a class into Markdown syntax. In most Markdown implementations you can embed HTML, so using your original HTML might work.
John Gruber (creator of Markdown) even does it this way:
http://daringfireball.net/projects/markdown/syntax.text
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With