diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-07-28 07:27:45 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-07-28 07:27:45 (GMT) |
commit | 10c1495dc8984ec3b800c290f1c7448e75478da1 (patch) | |
tree | ba60fe80191f74382efee14653f82ccb283c3ab8 /src/commentscan.l | |
parent | 6491b1b25148a87f46422889cf2db1387faa71c8 (diff) | |
download | Doxygen-10c1495dc8984ec3b800c290f1c7448e75478da1.zip Doxygen-10c1495dc8984ec3b800c290f1c7448e75478da1.tar.gz Doxygen-10c1495dc8984ec3b800c290f1c7448e75478da1.tar.bz2 |
Better handling of \\ilinebr
- Routines to strip leading and trailing whitespace now also take
\\ilinebr into account
- Added a number of cases in doctokenizer.l where \\ilinebr wasn't
handled yet.
Diffstat (limited to 'src/commentscan.l')
-rw-r--r-- | src/commentscan.l | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/commentscan.l b/src/commentscan.l index 4de7562..3d0ca69 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -2972,7 +2972,23 @@ static void stripTrailingWhiteSpace(QCString &s) uint len = s.length(); int i = (int)len-1; char c; - while (i>=0 && ((c = s.at(i))==' ' || c=='\t' || c=='\r')) i--; + while (i>=0) + { + c = s.at(i); + if (c==' ' || c=='\t' || c=='\r') // normal whitespace + { + i--; + } + else if (c=='r' && i>=7 && qstrncmp("\\ilinebr",s.data()+i-7,8)==0) // special line break marker + { + i-=8; + } + else // non-whitespace + { + break; + } + } + //printf("stripTrailingWhitespace(%s) i=%d len=%d\n",s.data(),i,len); if (i!=(int)len-1) { s.resize(i+2); // string up to and including char at pos i and \0 terminator |