File tree Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -5380,6 +5380,47 @@ int DocPara::parse()
53805380 }
53815381 else // found an end tag
53825382 {
5383+ const DocNodeVariant *n=parent ();
5384+ int indent = 0 ;
5385+ bool rerun = false ;
5386+ while (n)
5387+ {
5388+ if (std::get_if<DocAutoListItem>(n))
5389+ {
5390+ continue ;
5391+ }
5392+ else if (std::get_if<DocAutoList>(n))
5393+ {
5394+ const DocAutoList *al = std::get_if<DocAutoList>(n);
5395+ indent = al->indent ();
5396+ }
5397+ else if (std::get_if<DocPara>(n))
5398+ {
5399+ QCString tagNameLower = QCString (parser ()->context .token ->name ).lower ();
5400+ auto topStyleChange = [](const DocStyleChangeStack &stack) -> const DocStyleChange &
5401+ {
5402+ return std::get<DocStyleChange>(*stack.top ());
5403+ };
5404+
5405+ if (parser ()->context .styleStack .empty () || // no style change
5406+ topStyleChange (parser ()->context .styleStack ).tagName ()!=tagNameLower || // wrong style change
5407+ topStyleChange (parser ()->context .styleStack ).position ()!=parser ()->context .nodeStack .size () // wrong position
5408+ )
5409+ {
5410+ QCString indentStr;
5411+ indentStr.fill (' ' ,indent);
5412+ parser ()->tokenizer .unputString (" \\ ilinebr.\\ ilinebr" +indentStr+" </" +parser ()->context .token ->name +" >" );
5413+ rerun = true ;
5414+ break ;
5415+ }
5416+ }
5417+ else
5418+ {
5419+ break ;
5420+ }
5421+ n=::parent (n);
5422+ }
5423+ if (rerun) break ;
53835424 retval = handleHtmlEndTag (parser ()->context .token ->name );
53845425 }
53855426 if (retval!=RetVal_OK)
Original file line number Diff line number Diff line change @@ -271,7 +271,7 @@ OPTSTARS ("/""/"{BLANK}*)?"*"*{BLANK}*
271271LISTITEM {BLANK}*[-](" #" )?{WS}
272272MLISTITEM {BLANK}*[+*]{WS}
273273OLISTITEM {BLANK}*[1 -9 ][0 -9 ]*" ." {BLANK}
274- ENDLIST {BLANK}*" ." {BLANK}*\n
274+ ENDLIST {BLANK}*" ." {BLANK}*(\n| " \\ ilinebr " )
275275ATTRNAME [a-z_A-Z\x80-\xFF][:a-z_A-Z0-9 \x80-\xFF\-]*
276276ATTRIB {ATTRNAME}{WS}*(" =" {WS}*((" \" " [^\" ]*" \" " )|(" '" [^\' ]*"' " )|[^ \t\r\n '" ><]+))?
277277URLCHAR [a-z_A-Z0-9 \!\~\,\:\;\' \$ \? \@\&\%\#\.\-\+\/\= \x80 -\xFF ]
You can’t perform that action at this time.
0 commit comments