6

I am using Pandoc's extention of markdown to produce HTML.

The following markdown:

#test{#specificId}
##test2
###test3

Produces the following html

<h1 id="specificId">test</h1>
<h2 id="test2">test2</h2>
<h3 id="test3">test3</h3>

Ideally, It would produce this:

<h1 id="specificId">test</h1>
<h2>test2</h2>
<h3>test3</h3>

I couldn't find an option in the documentation that would make the output only add an ID if it was explicitly added to the markdown although I don't really know what to search for.

Thanks in advance for any help.

Jonathan Hodgson
  • 363
  • 1
  • 12

1 Answers1

8

I found the answer.

The "feature" is called auto_identifiers. It can be disabled in the command by changing -f markdown to -f markdown-auto_identifiers

Hope this helps someone else.

Jonathan Hodgson
  • 363
  • 1
  • 12
  • Thanks, Johnathan. Any chance you could elaborate on where exactly you are making this change? – bpar Oct 09 '20 at 19:05
  • 1
    @BryanMichael while calling it: `pandoc -f markdown-auto_identifiers -t html -o foo.html foo.md`, where `-f` is a shorthand for `--from`. – memowe Jul 03 '21 at 18:09