markdown pandoc creating a span with an id

1k Views Asked by At

if I wanted to set an id on a span element or a list element in pandoc markdown (or multimarkdown) is there anyway to do it other than

<span id="stuff"> my text </span> or to write out the list by hand?

Thanks

2

There are 2 best solutions below

1
On BEST ANSWER

Span elements - no, pandoc doesn't support arbitary spans (there has been some discussion on the mailing list regarding options to implement custom spans, but the general consensus was no as I recall).

List items - again no, but you could potentially script a filter to do this - The pandoc documention has an example on adding an id* to links here, although you do need to code for every target language you are going to use

*in this case it uses the id to treat stuff as ruby, but there is nothing to stop you just sticking the id into the output as you need.

0
On

Pandoc does support arbitrary spans with identifiers.

F.ex. the following produces the desired output in HTML (along with custom css):

<span id="test1">Use it with your favorite text editor</span> 

- With robust features for previewing, 
- <span id="test2">you can work in plain text while ...</span>