From 7228bca81e8d054413f85f8758fc13866ab4b85b Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 17 Mar 2016 19:55:09 +0100 Subject: Bug 763720 - Exclusion of a new line at the end of source code file causing nesting of HTML code for function documentation In case a code fragment does not end with a newline add it explicitly, otherwise following descriptive element might get into the same box. --- src/definition.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/definition.cpp b/src/definition.cpp index 795d4f3..86a616c 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -878,6 +878,7 @@ bool readCodeFragment(const char *fileName, } } result = transcodeCharacterStringToUTF8(result); + if (result.right(1) != "\n") result += "\n"; //fprintf(stderr,"readCodeFragement(%d-%d)=%s\n",startLine,endLine,result.data()); return found; } -- cgit v0.12 From c2c9ed6bd2a94ad25f31a22f70489406c52e5e6f Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 18 Mar 2016 19:31:03 +0100 Subject: Bug 763720 - Exclusion of a new line at the end of source code file causing nesting of HTML code for function documentation Update based on comment by D.v.Heesch --- src/definition.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/definition.cpp b/src/definition.cpp index 86a616c..3800088 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -878,7 +878,7 @@ bool readCodeFragment(const char *fileName, } } result = transcodeCharacterStringToUTF8(result); - if (result.right(1) != "\n") result += "\n"; + if (!result.isEmpty() && result.at(result.length()-1)!='\n') result += "\n"; //fprintf(stderr,"readCodeFragement(%d-%d)=%s\n",startLine,endLine,result.data()); return found; } -- cgit v0.12