Skip to content

Commit d70c6a9

Browse files
committed
Incorrect warning and output with \image followed by HTML command
When having: ``` @image html PCore-Block-Diagram.png width=100px <b>bold</b> ``` we get a warning like: ``` dox_main.md:16: warning: found </b> tag without matching <b> ``` and in the output we see as running text: `bbold` When having instead of a HTML command a doxygen command or a symbol (`&...;`) we don't get a warning. The HTML command should be seen as end of the underlying command and not be handled at this moment (not the code is also used on other places hence the conditional).
1 parent 8c18970 commit d70c6a9

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

src/docparser.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,7 @@ void DocParser::defaultHandleTitleAndSize(const int cmd, DocNodeVariant *parent,
963963

964964
// parse title
965965
tokenizer.setStateTitle();
966+
tokenizer.setStateTitleSize(true);
966967
int tok;
967968
while ((tok=tokenizer.lex()))
968969
{
@@ -1026,6 +1027,7 @@ void DocParser::defaultHandleTitleAndSize(const int cmd, DocNodeVariant *parent,
10261027
tokenizer.unputString(context.token->name);
10271028
}
10281029
}
1030+
tokenizer.setStateTitleSize(false);
10291031
tokenizer.setStatePara();
10301032

10311033
handlePendingStyleCommands(parent,children);

src/doctokenizer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ class DocTokenizer
187187
void setStateQuotedString();
188188
void setStateShowDate();
189189

190+
void setStateTitleSize(const bool);
191+
190192
private:
191193
struct Private;
192194
std::unique_ptr<Private> p;

src/doctokenizer.l

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ struct doctokenizerYY_state
8080
int sharpCount=0;
8181
bool markdownSupport=true;
8282
bool insideHtmlLink=false;
83+
bool titleSize=false;
8384

8485
// context for section finding phase
8586
const Definition *definition = 0;
@@ -988,7 +989,7 @@ SHOWDATE ([0-9]{4}"-"[0-9]{1,2}"-"[0-9]{1,2})?({WS}*[0-9]{1,2}":"[0-9]{1,2}(":"[
988989
}
989990
<St_TitleN>{HTMLTAG} {
990991
yyextra->token.name = yytext;
991-
handleHtmlTag(yyscanner,yytext);
992+
if (!yyextra->titleSize) handleHtmlTag(yyscanner,yytext);
992993
return TK_HTMLTAG;
993994
}
994995
<St_TitleN>\n { /* new line => end of title */
@@ -1836,6 +1837,13 @@ void DocTokenizer::setStateTitleAttrValue()
18361837
BEGIN(St_TitleV);
18371838
}
18381839
1840+
void DocTokenizer::setStateTitleSize(const bool s)
1841+
{
1842+
yyscan_t yyscanner = p->yyscanner;
1843+
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
1844+
yyextra->titleSize = s;
1845+
}
1846+
18391847
void DocTokenizer::setStateCode()
18401848
{
18411849
yyscan_t yyscanner = p->yyscanner;

0 commit comments

Comments
 (0)