Skip to content

Commit b45c39b

Browse files
authored
Merge pull request doxygen#12149 from kalehmann/fix/files_starting_with_digit
fix: HTML docs for files starting with a digit
2 parents b01163e + 1844afe commit b45c39b

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/ftvhelp.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,8 @@ static QCString convertFileId2Var(const QCString &fileId)
575575
QCString varId = fileId;
576576
int i=varId.findRev('/');
577577
if (i>=0) varId = varId.mid(i+1);
578+
if (isdigit(varId[0])) varId.prepend("_");
579+
578580
return substitute(varId,"-","_");
579581
}
580582

src/searchindex_js.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ void SearchTerm::makeTitle()
6262
QCString SearchTerm::termEncoded() const
6363
{
6464
TextStream t;
65+
if (word.length() && (isdigit(word.at(0)) || !isIdJS(word.at(0))))
66+
{
67+
t << '_'; // ensure result starts with character valid for identifier
68+
}
69+
6570
for (size_t i=0;i<word.length();i++)
6671
{
6772
if (isIdJS(word.at(i)))

templates/html/navtree.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ function initNavTree(toroot,relpath,allMembersFile) {
123123
const i = varName.lastIndexOf('/');
124124
const n = i>=0 ? varName.substring(i+1) : varName;
125125
const e = n.replace(/-/g,'_');
126-
return window[e];
126+
const r = (e[0] >= '0' && e[0] <= '9') ? '_' + e : e;
127+
128+
return window[r];
127129
}
128130

129131
const stripPath = (uri) => uri.substring(uri.lastIndexOf('/')+1);

0 commit comments

Comments
 (0)