LaTeX in Markdown files stops rendering the headings in edit mode

In DT 3.9.1, the WYSIWYG rendering of headings in Markdown files stops working when LaTeX formulas are added to the document. This only happens in edit mode, in view mode everything is fine. And: it only occurs for headings that follow after the first insertion of a LaTeX code:

In edit mode:


In view mode:

Thank you for the bug report, the next release will fix this.

1 Like

Thanks :blush: :pray::heart:

I’ve potentially encountered three other “bugs” regarding WikiLinks and LaTeX/MathJax equations and WikiLinks and the Markdown {{TOC}} table of contents:

WikiLinks and LaTeX: broken WikiLinks

Having the Names and Alias option activated, LaTeX line equations ($$ ... $$) in combination with WikiLinks in the same document have no problem, when the first sign/character of the LaTeX equation is not a normal letter or number (A, a, B, b, …, 0, 1, 2, …). However, in case the first letter is a normal letter or number, all subsequent WikiLinks stop working:

My workaround so far is to enclose normal letters and numbers at the beginning of an equation. And: The “bug” only occurs for line-equations ($$ ... $$), but not for inline-equation ($... $).

I also noticed, that, if another LaTeX equation with the first character being a normal letter or number is added, all subsequent WikiLinks work again except those, that are enclosed by the two “corrupting” LaTeX equations.

WikiLinks and LaTeX: WikiLinks inside equations

Another problem occurs, when the content of a LaTeX equation is also a WikiLink (name or alias):

I.e., the WikiLink (name or alias) gets weirdly rendered and the according DT item-link is displayed instead.

WikiLinks and TOC

The Markdown {{TOC}} command for auto-generating a tabel-of-contents has problems, when WikiLinks (names or aliases) are part of heading:

When a WikiLink name or alias is part of a heading, the links in the TOC become partly broken: In the TOC-section links, the names and aliases become a link to the actual wikilinked note (here: “beta” and lorem" instead of to the section within the actual document.

1 Like

Could you please upload zipped sample documents? Thank you!

Sure. This ZIP file contains the three MD files shown in the screenshots above plus two files called “Lorem” and “beta”. If you place these files into a DT database and activate the WikiLinks Names and Alias feature, it hopefully reproduces what I’ve described above. Please let me know if you need any further info or file.

DT WikiLinks, LaTeX and TOC problems.zip (197,6 KB)

Thanks! We’ll take a look at these. :slight_smile:

1 Like

Side note to @PixelTracker: thanks for the tip about limiting TOC to heading levels in your last example doc.
i.e. {{TOC:2-5}}.
I didn’t know you could do that and it will be useful to me.

1 Like

I’m not seeing it working here. I’ve never seen this syntax either.

Ahh… it is limiting the header level, e.g., {{TOC:2}} only shows h2 sections.

1 Like

Is this TOC refinement documented somewhere? I feel there might be other related cool little markdown tricks nearby.

Edit:
Found it:
https://fletcher.github.io/MultiMarkdown-6/MMD_Users_Guide.html#tableofcontents

1 Like

News to me as well :slight_smile:

1 Like

Thank you for the documents! The next release will fix the first two issues, the third one is unfortunately an issue of MultiMarkdown. Its ToC handling doesn’t like headers containing links.

1 Like

Thanks a lot :pray::blush:

In addition: does it make sense to have a link inside an hx element that is not the complete header?

For me? No. But hard to tell whether anyone already uses & depends on this.

1 Like

The TOC consists of links to the headings. Now you have links inside headings which would result in links in a link in the TOC. Which would be invalid HTML. So, no surprise here – your construction can’t sensibly work in a TOC.

1 Like