From b1c78ad5a0f15ae67a70d9d7a36e907ac89734cd Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 22 Oct 2020 12:39:29 +0200 Subject: Miscounting lines with markdown table When we have a program like: ``` # Test1 | \aa3 | | ---- | | \aa5 | \aa6 ``` we get the warnings like: ``` .../cc.md:3: warning: Found unknown command '\aa3' .../cc.md:4: warning: Found unknown command '\aa5' .../cc.md:6: warning: Found unknown command '\aa6' ``` instead of: ``` .../cc.md:4: warning: Found unknown command '\aa3' .../cc.md:5: warning: Found unknown command '\aa5' .../cc.md:6: warning: Found unknown command '\aa6' ``` The external counting was correct, not the internal counting. This has been corrected. --- src/markdown.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/markdown.cpp b/src/markdown.cpp index 7f6dc9b..1c41b15 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -1933,16 +1933,16 @@ int Markdown::writeTableBlock(const char *data,int size) { if (row % 2) { - m_out.addStr(""); + m_out.addStr("\n"); } else { - m_out.addStr(""); + m_out.addStr("\n"); } } else { - m_out.addStr(" "); + m_out.addStr("\n "); } for (int c = 0; c < columns; c++) { @@ -2000,7 +2000,7 @@ int Markdown::writeTableBlock(const char *data,int size) } cellTag = "td"; cellClass = "class=\"markdownTableBody"; - m_out.addStr(" \n"); + m_out.addStr(" "); } m_out.addStr("\n"); -- cgit v0.12