Skip to content

Commit af9cf3b

Browse files
committed
issue doxygen#12339 Broken @todo styling in HTML output
After review - using `stripPrefix` - placing the used string in a constant
1 parent 82b210f commit af9cf3b

4 files changed

Lines changed: 9 additions & 6 deletions

File tree

src/commentscan.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4452,7 +4452,7 @@ static void addXRefItemToEntry(Entry *current, const DString &docs,
44524452
std::unique_lock<std::mutex> lock(g_sectionMutex);
44534453

44544454
DString listName=baseName;
4455-
if (Config_getEnum(MARKDOWN_ID_STYLE) == MARKDOWN_ID_STYLE_t::GITHUB) listName = "Doxygen_List_" + listName;
4455+
if (Config_getEnum(MARKDOWN_ID_STYLE) == MARKDOWN_ID_STYLE_t::GITHUB) listName = doxygenList + listName;
44564456
RefList *refList = RefListManager::instance().add(listName,listTitle,itemTitle);
44574457
RefItem *item = nullptr;
44584458
for (auto it = current->sli.rbegin(); it != current->sli.rend(); ++it)

src/htmldocvisitor.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "parserintf.h"
3939
#include "plantuml.h"
4040
#include "portable.h"
41+
#include "reflist.h"
4142
#include "util.h"
4243
#include "vhdldocgen.h"
4344

@@ -2074,7 +2075,7 @@ void HtmlDocVisitor::operator()(const DocXRefItem &x)
20742075
forceEndParagraph(x);
20752076
bool anonymousEnum = x.file()=="@";
20762077
DString key = x.key();
2077-
if (key.startsWith("Doxygen_List_")) key=key.mid(13);
2078+
key.stripPrefix(doxygenList);
20782079
if (!anonymousEnum)
20792080
{
20802081
DString fn = x.file();

src/reflist.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ RefItem *RefList::find(int itemId)
5050

5151
bool RefList::isEnabled() const
5252
{
53-
if ((m_listName=="todo" || m_listName=="Doxygen_List_todo") && !Config_getBool(GENERATE_TODOLIST)) return false;
54-
else if ((m_listName=="test" || m_listName=="Doxygen_List_test") && !Config_getBool(GENERATE_TESTLIST)) return false;
55-
else if ((m_listName=="bug" || m_listName=="Doxygen_List_bug") && !Config_getBool(GENERATE_BUGLIST)) return false;
56-
else if ((m_listName=="deprecated" || m_listName=="Doxygen_List_deprecated") && !Config_getBool(GENERATE_DEPRECATEDLIST)) return false;
53+
if ((m_listName=="todo" || m_listName==doxygenList+"todo") && !Config_getBool(GENERATE_TODOLIST)) return false;
54+
else if ((m_listName=="test" || m_listName==doxygenList+"test") && !Config_getBool(GENERATE_TESTLIST)) return false;
55+
else if ((m_listName=="bug" || m_listName==doxygenList+"bug") && !Config_getBool(GENERATE_BUGLIST)) return false;
56+
else if ((m_listName=="deprecated" || m_listName==doxygenList+"deprecated") && !Config_getBool(GENERATE_DEPRECATEDLIST)) return false;
5757
return true;
5858
}
5959

src/reflist.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
class Definition;
2727
class RefList;
2828

29+
static inline const DString doxygenList = "Doxygen_List_";
30+
2931
/** This struct represents an item in the list of references. */
3032
class RefItem
3133
{

0 commit comments

Comments
 (0)