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/util.cpp | |
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/util.cpp')
-rw-r--r-- | src/util.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/util.cpp b/src/util.cpp index 8b3f618..13ae200 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -6612,10 +6612,11 @@ QCString stripLeadingAndTrailingEmptyLines(const QCString &s,int &docLine) // search for leading empty lines int i=0,li=-1,l=s.length(); char c; - while ((c=*p++)) + while ((c=*p)) { - if (c==' ' || c=='\t' || c=='\r') i++; - else if (c=='\n') i++,li=i,docLine++; + if (c==' ' || c=='\t' || c=='\r') i++,p++; + else if (c=='\\' && qstrncmp(p,"\\ilinebr",8)==0) i+=8,li=i,docLine++,p+=8; + else if (c=='\n') i++,li=i,docLine++,p++; else break; } @@ -6624,9 +6625,10 @@ QCString stripLeadingAndTrailingEmptyLines(const QCString &s,int &docLine) p=s.data()+b; while (b>=0) { - c=*p; p--; - if (c==' ' || c=='\t' || c=='\r') b--; - else if (c=='\n') bi=b,b--; + c=*p; + if (c==' ' || c=='\t' || c=='\r') b--,p--; + else if (c=='r' && b>=7 && qstrncmp(p-7,"\\ilinebr",8)==0) bi=b-7,b-=8,p-=8; + else if (c=='\n') bi=b,b--,p--; else break; } @@ -6637,6 +6639,7 @@ QCString stripLeadingAndTrailingEmptyLines(const QCString &s,int &docLine) if (bi==-1) bi=l; if (li==-1) li=0; if (bi<=li) return 0; // only empty lines + //printf("docLine='%s' len=%d li=%d bi=%d\n",s.data(),s.length(),li,bi); return s.mid(li,bi-li); } |