From 9c572e72b1070c5d8b58f7d4b6f72fdaede6e8ed Mon Sep 17 00:00:00 2001 From: albert-github Date: Tue, 22 Dec 2020 18:28:39 +0100 Subject: Miscounting of lines in case of inserting an anchor for a "H." tag When having a simple file like: ``` # The page # a section ##### a h5 section \error7 ``` we get as warning: ``` .../aa.md:8: warning: Found unknown command '\error7' ``` instead of ``` .../aa.md:7: warning: Found unknown command '\error7' ``` This is due to the fact that the ``` ##### a h5 section ``` is translated into: ``` \anchor autotoc_md2
a h5 section
``` instead of ``` \anchor autotoc_md2\ilinebr
a h5 section
``` --- src/markdown.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/markdown.cpp b/src/markdown.cpp index 0cf8b87..4a40a35 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -2073,7 +2073,7 @@ void Markdown::writeOneLineHeaderOrRuler(const char *data,int size) { if (!id.isEmpty()) { - m_out.addStr("\\anchor "+id+"\n"); + m_out.addStr("\\anchor "+id+"\\ilinebr "); } hTag.sprintf("h%d",level); m_out.addStr("<"+hTag+">"); -- cgit v0.12