From 5697a9e8dbb298aede810c1ce6daded80bf40952 Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 11 Jan 2019 11:08:36 +0100 Subject: No translation of markdown in

According to the documentation:
Doxygen does not have this requirement, and will also process Markdown formatting inside such HTML blocks. The
only exception is 
 blocks, which are passed untouched (handy for ASCII art).

Though in case the `
` is the last statement in a non block type comment the markdown is processed. C has block type /* ... */ and /// is translated to this, Fortran, Python are line type comments. Adding a `\n` at the when no `\n` is present at the end solves the problem. --- src/markdown.cpp | 4 ++- testing/081/081__markdown__pre_8f90.xml | 51 +++++++++++++++++++++++++++++++++ testing/081_markdown_pre.f90 | 18 ++++++++++++ 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100755 testing/081/081__markdown__pre_8f90.xml create mode 100755 testing/081_markdown_pre.f90 diff --git a/src/markdown.cpp b/src/markdown.cpp index 5253333..181b01a 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -2535,7 +2535,9 @@ QCString processMarkdown(const QCString &fileName,const int lineNr,Entry *e,cons out.clear(); int refIndent; // for replace tabs by spaces - QCString s = detab(input,refIndent); + QCString s = input; + if (s.find('\n',s.length()-1) == -1) s += "\n"; + s = detab(s,refIndent); //printf("======== DeTab =========\n---- output -----\n%s\n---------\n",s.data()); // then process quotation blocks (as these may contain other blocks) s = processQuotations(s,refIndent); diff --git a/testing/081/081__markdown__pre_8f90.xml b/testing/081/081__markdown__pre_8f90.xml new file mode 100755 index 0000000..7c713cf --- /dev/null +++ b/testing/081/081__markdown__pre_8f90.xml @@ -0,0 +1,51 @@ + + + + 081_markdown_pre.f90 + + + subroutine + subroutine subr1 + () + subr1 + + subr1 + + + + + ___________________________ + + + + + + + + + subroutine + subroutine subr2 + () + subr2 + + subr2 + + + + + ___________________________ + + + + + + + + + + + + + + + diff --git a/testing/081_markdown_pre.f90 b/testing/081_markdown_pre.f90 new file mode 100755 index 0000000..590bbbf --- /dev/null +++ b/testing/081_markdown_pre.f90 @@ -0,0 +1,18 @@ +! // objective: test
 in Fortran, no translation of markdown
+! // check: 081__markdown__pre_8f90.xml
+!> \file
+
+!> subr1
+!>
+!>                     ___________________________
+!>
+subroutine subr1() +end subroutine + +!> subr2 +!>
+!>                     ___________________________
+!>
+!> +subroutine subr2() +end subroutine -- cgit v0.12 From dc438879c6bb1475add244b381cb6671316c850c Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sun, 13 Jan 2019 11:03:12 +0100 Subject: Merge: moved example from 081 to 084, improved check if last char is newline --- src/markdown.cpp | 2 +- testing/081/081__markdown__pre_8f90.xml | 51 --------------------------------- testing/081_brief_lists.h | 0 testing/081_markdown_pre.f90 | 18 ------------ testing/084/084__markdown__pre_8f90.xml | 51 +++++++++++++++++++++++++++++++++ testing/084_markdown_pre.f90 | 18 ++++++++++++ 6 files changed, 70 insertions(+), 70 deletions(-) delete mode 100755 testing/081/081__markdown__pre_8f90.xml mode change 100755 => 100644 testing/081_brief_lists.h delete mode 100755 testing/081_markdown_pre.f90 create mode 100755 testing/084/084__markdown__pre_8f90.xml create mode 100644 testing/084_markdown_pre.f90 diff --git a/src/markdown.cpp b/src/markdown.cpp index 181b01a..74492ea 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -2536,7 +2536,7 @@ QCString processMarkdown(const QCString &fileName,const int lineNr,Entry *e,cons int refIndent; // for replace tabs by spaces QCString s = input; - if (s.find('\n',s.length()-1) == -1) s += "\n"; + if (s.at(s.length()-1)!='\n') s += "\n"; // see PR #6766 s = detab(s,refIndent); //printf("======== DeTab =========\n---- output -----\n%s\n---------\n",s.data()); // then process quotation blocks (as these may contain other blocks) diff --git a/testing/081/081__markdown__pre_8f90.xml b/testing/081/081__markdown__pre_8f90.xml deleted file mode 100755 index 7c713cf..0000000 --- a/testing/081/081__markdown__pre_8f90.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - 081_markdown_pre.f90 - - - subroutine - subroutine subr1 - () - subr1 - - subr1 - - - - - ___________________________ - - - - - - - - - subroutine - subroutine subr2 - () - subr2 - - subr2 - - - - - ___________________________ - - - - - - - - - - - - - - - diff --git a/testing/081_brief_lists.h b/testing/081_brief_lists.h old mode 100755 new mode 100644 diff --git a/testing/081_markdown_pre.f90 b/testing/081_markdown_pre.f90 deleted file mode 100755 index 590bbbf..0000000 --- a/testing/081_markdown_pre.f90 +++ /dev/null @@ -1,18 +0,0 @@ -! // objective: test
 in Fortran, no translation of markdown
-! // check: 081__markdown__pre_8f90.xml
-!> \file
-
-!> subr1
-!>
-!>                     ___________________________
-!>
-subroutine subr1() -end subroutine - -!> subr2 -!>
-!>                     ___________________________
-!>
-!> -subroutine subr2() -end subroutine diff --git a/testing/084/084__markdown__pre_8f90.xml b/testing/084/084__markdown__pre_8f90.xml new file mode 100755 index 0000000..8a59bd9 --- /dev/null +++ b/testing/084/084__markdown__pre_8f90.xml @@ -0,0 +1,51 @@ + + + + 084_markdown_pre.f90 + + + subroutine + subroutine subr1 + () + subr1 + + subr1 + + + + + ___________________________ + + + + + + + + + subroutine + subroutine subr2 + () + subr2 + + subr2 + + + + + ___________________________ + + + + + + + + + + + + + + + diff --git a/testing/084_markdown_pre.f90 b/testing/084_markdown_pre.f90 new file mode 100644 index 0000000..1760b67 --- /dev/null +++ b/testing/084_markdown_pre.f90 @@ -0,0 +1,18 @@ +! // objective: test
 in Fortran, no translation of markdown
+! // check: 084__markdown__pre_8f90.xml
+!> \file
+
+!> subr1
+!>
+!>                     ___________________________
+!>
+subroutine subr1() +end subroutine + +!> subr2 +!>
+!>                     ___________________________
+!>
+!> +subroutine subr2() +end subroutine -- cgit v0.12