@@ -1327,7 +1327,7 @@ void HtmlDocVisitor::operator()(const DocPara &p)
13271327 bool isLast = false ;
13281328 contexts_t t = getParagraphContext (p,isFirst,isLast);
13291329 // printf("startPara first=%d last=%d\n",isFirst,isLast);
1330- if (isFirst && isLast) needsTagBefore=FALSE ;
1330+ if (!std::holds_alternative<DocAutoListItem>(*p. parent ()) && isFirst && isLast) needsTagBefore=FALSE ;
13311331
13321332 // printf(" needsTagBefore=%d\n",needsTagBefore);
13331333 // write the paragraph tag (if needed)
@@ -1372,7 +1372,7 @@ void HtmlDocVisitor::operator()(const DocPara &p)
13721372 }
13731373
13741374 // printf("endPara first=%d last=%d\n",isFirst,isLast);
1375- if (isFirst && isLast) needsTagAfter=FALSE ;
1375+ if (!std::holds_alternative<DocAutoListItem>(*p. parent ()) && isFirst && isLast) needsTagAfter=FALSE ;
13761376
13771377 // printf(" needsTagAfter=%d\n",needsTagAfter);
13781378 if (needsTagAfter) m_t << " </p>\n " ;
@@ -2368,7 +2368,7 @@ void HtmlDocVisitor::forceEndParagraph(const Node &n)
23682368 bool isLast = false ;
23692369 getParagraphContext (*para,isFirst,isLast);
23702370 // printf("forceEnd first=%d last=%d styleOutsideParagraph=%d\n",isFirst,isLast,styleOutsideParagraph);
2371- if (isFirst && isLast) return ;
2371+ if (!std::holds_alternative<DocAutoListItem>(*para-> parent ()) && isFirst && isLast) return ;
23722372 if (styleOutsideParagraph) return ;
23732373
23742374 // printf("adding </p>\n");
@@ -2417,7 +2417,7 @@ void HtmlDocVisitor::forceStartParagraph(const Node &n)
24172417 bool isFirst = false ;
24182418 bool isLast = false ;
24192419 getParagraphContext (*para,isFirst,isLast);
2420- if (isFirst && isLast) needsTag = false ;
2420+ if (!std::holds_alternative<DocAutoListItem>(*para-> parent ()) && isFirst && isLast) needsTag = false ;
24212421 // printf("forceStart first=%d last=%d needsTag=%d\n",isFirst,isLast,needsTag);
24222422
24232423 if (needsTag) m_t << " <p>" ;
0 commit comments