Question

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

Was it helpful?

Solution

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.

OTHER TIPS

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>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top