Skip to content

Commit 9c572e7

Browse files
committed
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 <h5>a h5 section</h5> ``` instead of ``` \anchor autotoc_md2\ilinebr <h5>a h5 section</h5> ```
1 parent 48096bb commit 9c572e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/markdown.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2073,7 +2073,7 @@ void Markdown::writeOneLineHeaderOrRuler(const char *data,int size)
20732073
{
20742074
if (!id.isEmpty())
20752075
{
2076-
m_out.addStr("\\anchor "+id+"\n");
2076+
m_out.addStr("\\anchor "+id+"\\ilinebr ");
20772077
}
20782078
hTag.sprintf("h%d",level);
20792079
m_out.addStr("<"+hTag+">");

0 commit comments

Comments
 (0)