fixed bug in handling of HTML tags, test added
This commit is contained in:
parent
fa8fc4baf3
commit
2a8b20785e
3 changed files with 24 additions and 5 deletions
|
|
@ -64,4 +64,11 @@ void backslashB()
|
||||||
void backslashC()
|
void backslashC()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The next line contains expression:
|
||||||
|
* <pre>
|
||||||
|
* ['retVal < 10', 'g_counter == 23 && g_mode & 3']
|
||||||
|
*</pre>
|
||||||
|
*/
|
||||||
|
void cycle()
|
||||||
|
{}
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,16 @@ public class doxygen_misc_constructs_runme {
|
||||||
" <i>with</i> old comment parser.\n" +
|
" <i>with</i> old comment parser.\n" +
|
||||||
" @see MyClass#fun(char,float)\n" +
|
" @see MyClass#fun(char,float)\n" +
|
||||||
"");
|
"");
|
||||||
|
|
||||||
|
wantedComments.put("doxygen_misc_constructs.doxygen_misc_constructs.cycle()",
|
||||||
|
" The next line contains expression:\n" +
|
||||||
|
" <pre>\n" +
|
||||||
|
" ['retVal < 10', 'g_counter == 23 && g_mode & 3']\n" +
|
||||||
|
" </pre>\n" +
|
||||||
|
"\n" +
|
||||||
|
"");
|
||||||
|
|
||||||
|
|
||||||
// and ask the parser to check comments for us
|
// and ask the parser to check comments for us
|
||||||
System.exit(parser.check(wantedComments));
|
System.exit(parser.check(wantedComments));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1120,7 +1120,7 @@ void DoxygenParser::processHtmlTags(size_t &pos, const std::string &line)
|
||||||
pos = endHtmlPos;
|
pos = endHtmlPos;
|
||||||
|
|
||||||
// prepend '<' to distinguish HTML tags from doxygen commands
|
// prepend '<' to distinguish HTML tags from doxygen commands
|
||||||
if (addDoxyCommand(m_tokenList, '<' + cmd)) {
|
if (!cmd.empty() && addDoxyCommand(m_tokenList, '<' + cmd)) {
|
||||||
// it is a valid HTML command
|
// it is a valid HTML command
|
||||||
if (line[pos] != '>') { // it should be HTML tag with args,
|
if (line[pos] != '>') { // it should be HTML tag with args,
|
||||||
// for example <A ...>, <IMG ...>, ...
|
// for example <A ...>, <IMG ...>, ...
|
||||||
|
|
@ -1148,7 +1148,10 @@ void DoxygenParser::processHtmlTags(size_t &pos, const std::string &line)
|
||||||
m_tokenList.push_back(Token(PLAINSTRING, ""));
|
m_tokenList.push_back(Token(PLAINSTRING, ""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pos++; // skip '>'
|
|
||||||
|
if (pos != string::npos) {
|
||||||
|
pos++; // skip '>'
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// the command is not HTML supported by Doxygen, < and > will be
|
// the command is not HTML supported by Doxygen, < and > will be
|
||||||
// replaced by HTML entities < and > respectively,
|
// replaced by HTML entities < and > respectively,
|
||||||
|
|
@ -1164,7 +1167,7 @@ void DoxygenParser::processHtmlEntities(size_t &pos, const std::string &line)
|
||||||
|
|
||||||
if (endOfWordPos != string::npos) {
|
if (endOfWordPos != string::npos) {
|
||||||
|
|
||||||
if (line[endOfWordPos] == ';')
|
if (line[endOfWordPos] == ';' && (endOfWordPos - pos) > 1)
|
||||||
{
|
{
|
||||||
// if entity is not recognized by Doxygen (not in the list of
|
// if entity is not recognized by Doxygen (not in the list of
|
||||||
// commands) nothing is added (here and in Doxygen).
|
// commands) nothing is added (here and in Doxygen).
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue