Skip to content

Commit e3a54a2

Browse files
committed
issue doxygen#11172 Aliases with embed:rst:leading-asterisk no longer work in Doxygen 1.12
- fixes regression due to commit 283a679
1 parent 396fedf commit e3a54a2

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

src/outputlist.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,15 +360,29 @@ void OutputCodeRecorder::replay(OutputCodeList &ol,int startLine,int endLine,boo
360360
ol.setStripIndentAmount(stripIndentAmount);
361361
m_showLineNumbers = showLineNumbers;
362362

363+
bool insideSpecialComment = false;
363364
// in case the start of the special comment marker is outside of the fragment, start it here
364365
if (startIndex<endIndex && m_calls[startIndex].insideSpecialComment)
365366
{
366367
ol.startSpecialComment();
368+
insideSpecialComment = true;
367369
}
368370

369371
// render the requested fragment of the pre-recorded output
370372
for (size_t i=startIndex; i<endIndex; i++)
371373
{
372-
if (m_calls[i].condition()) m_calls[i].function(&ol);
374+
if (m_calls[i].condition())
375+
{
376+
insideSpecialComment = m_calls[i].insideSpecialComment;
377+
m_calls[i].function(&ol);
378+
}
379+
}
380+
381+
// if we end the fragment inside a special comment, make sure we end it,
382+
// and also the code line
383+
if (insideSpecialComment)
384+
{
385+
ol.endSpecialComment();
386+
ol.endCodeLine();
373387
}
374388
}

src/outputlist.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ class OutputCodeRecorder : public OutputCodeIntf
143143
{
144144
using ConditionFunc = std::function<bool()>;
145145
using OutputFunc = std::function<void(OutputCodeList*)>;
146-
CallInfo(ConditionFunc &&c,OutputFunc &&f,bool insideComment)
147-
: condition(std::move(c)), function(std::move(f)), insideSpecialComment(insideComment) {}
146+
CallInfo(ConditionFunc &&c,OutputFunc &&f,bool ic)
147+
: condition(std::move(c)), function(std::move(f)), insideSpecialComment(ic) {}
148148
ConditionFunc condition;
149149
OutputFunc function;
150150
bool insideSpecialComment = false;

src/xmlgen.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,16 +348,19 @@ void XMLCodeGenerator::writeLineNumber(const QCString &extRef,const QCString &co
348348

349349
void XMLCodeGenerator::finish()
350350
{
351+
XML_DB(("(finish insideCodeLine=%d)\n",m_insideCodeLine));
351352
if (m_insideCodeLine) endCodeLine();
352353
}
353354

354355
void XMLCodeGenerator::startCodeFragment(const QCString &)
355356
{
357+
XML_DB(("(startCodeFragment)\n"));
356358
*m_t << " <programlisting>\n";
357359
}
358360

359361
void XMLCodeGenerator::endCodeFragment(const QCString &)
360362
{
363+
XML_DB(("(endCodeFragment)\n"));
361364
*m_t << " </programlisting>\n";
362365
}
363366

@@ -471,8 +474,8 @@ void writeXMLCodeBlock(TextStream &t,FileDef *fd)
471474
nullptr, // memberDef
472475
TRUE // showLineNumbers
473476
);
477+
//xmlList.get<XMLCodeGenerator>(OutputType::XML)->finish();
474478
xmlList.endCodeFragment("DoxyCode");
475-
xmlList.get<XMLCodeGenerator>(OutputType::XML)->finish();
476479
}
477480

478481
static void writeMemberReference(TextStream &t,const Definition *def,const MemberDef *rmd,const QCString &tagName)

0 commit comments

Comments
 (0)