Search

i am wondering how to add a class to elements in markdown.

let's say i have

 1. item one
 2. item two

this will output

<ol>
   <li>item one</li>
   <li>item two</li>
</ol>

but what if i want to get something like this

<ol class="class-listing">
   <li class="class-item">item one</li>
   <li>item two</li>
</ol>

how should i do? there is nothing on the web or on the markdown website

thank you

not possible using Markdown afaik, but it does accept html so you could just add that list to the editor.

You will have to adopt the ninja technique. There are articles about this on this site, and also a utility for xslt to do this too ;)

I think Symphony comes with a Markdown Extra text formatter now, which does allow for custom attributes. But I don't know if you can assign classes to an ol/ul and li like that.

thank you all :)

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details