Multimarkdown TOC and links not working

Multimarkdown 6 provides for Table of Contents and a simple way to key links to selected headings. I am familiar with this from other iOS markdown apps.

I can’t make jump links work in Drafts, nor a TOC.

This is a facility I rely on in longer notes, especially in speaking/teaching/discussion situations.

Is there another way to provide internal links, or will future releases bring improved MultiMarkdown functionality? Or other suggestions?

For a heading the anchor name is an encoding of the heading’s text.

You could write a script to parse the document and confect a list at the top.

(That is what I did in an internal Python Markdown tool; I preprocess into Markdown. Sorry I can’t share it.)

The Multimarkdown {{TOC}} Table of Contents generation is supported if you are using MultiMarkdown as your Markdown generator.

There is a slight gotcha, however, due to the fact that the double curly braces conflict with Drafts’ template engines use of those markers for URL encoding. To get the table of contents inserted in your preview, you must escape it to prevent URL encoding handling it before MultiMarkdown gets a hold of it - so use \{{TOC}} (note leading backslash excape character.

So, this Markdown in Drafts:

\{{TOC}}

# Header 1

# Header 2

Will generate this preview:

1%202019-02-17%2010-06-10

3 Likes

Have tried this with and without the leading backslash character and MultiMarkdown selected. Not working.

It’s easy enough to construct a TOC from links, so it’s not a big deal.

I find Markdown/MultMarkdown doesn’t pick up the # and ## headings etc so it is necessary (at the moment) to insert a line with . Would be a timesaver if it all worked “like it says on the tin” but hey!

Could you provide example text that demonstrates this not working? Does the example above not work for you? If not, it’s likely a matter of the appropriate MultiMarkdown settings being enabled.

I swiped the exact trial copy above. I got the rendered headings, but not the TOC links.

57

Using Drafts Mac 12.1.3, also iOS Drafts 13 and Swiss Preview. MultiMarkdown selected on both – I checked.

3rd para in post above:

Should say "it is necessary at the moment to insert a line with html e.g. <a name=“filename”>

Check you Markdown settings. Specifically the Markdown compatibility mode is one possibility that could cause what you are seeing as it effectively turns off Markdown extensions like TOC.

Disabled:

Enabled:

It was the ‘Markdown compatibility mode’ sub-setting that did it. Many thanks!

For the benefit of others:
– I ensured MultiMarkdown was selected
– and I turned OFF Markdown compatibility mode.

{{TOC}} works now!