From cba0d89fafee3daef31469cbe1cdd24e68c7b56a Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Mon, 22 Dec 2014 17:01:25 +0100 Subject: Fix to ignore the contents of \verbatim and friends while looking for sections --- src/docparser.cpp | 74 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 62 insertions(+), 12 deletions(-) diff --git a/src/docparser.cpp b/src/docparser.cpp index cd7a118..24ce165 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -6936,23 +6936,62 @@ static QCString extractCopyDocId(const char *data, uint &j, uint len) return id; } +// macro to check if the input starts with a specific command. +// note that data[i] should point to the start of the command (\ or @ character) +// and the sizeof(str) returns the size of str including the '\0' terminator; +// a fact we abuse to skip over the start of the command character. +#define CHECK_FOR_COMMAND(str,action) \ + do if ((i+sizeof(str)0) + { + int orgPos = i; + i=skipToEndMarker(data,k,len,endMarker); + buf.addStr(data+orgPos,i-orgPos); + } + else + { + buf.addChar(c); + i++; + } } } else // not a command, just copy -- cgit v0.12