Skip to content

Commit e8f196a

Browse files
committed
Increase robustness of page outline panel
1 parent 863d2c3 commit e8f196a

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4396,7 +4396,7 @@ QCString convertToId(const QCString &s)
43964396
while ((c=*p++))
43974397
{
43984398
char encChar[4];
4399-
if ((c>='0' && c<='9') || (c>='a' && c<='z') || (c>='A' && c<='Z') || c=='-' || c==':' /*|| c=='.'*/)
4399+
if ((c>='0' && c<='9') || (c>='a' && c<='z') || (c>='A' && c<='Z') || c=='-')
44004400
{ // any permissive character except _
44014401
if (first && c>='0' && c<='9') growBuf.addChar('a'); // don't start with a digit
44024402
growBuf.addChar(c);

templates/html/navtree.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ function initNavTree(toroot,relpath,allMembersFile) {
740740
id = $(tr).attr('id');
741741
const text = is_anon_enum ? 'anonymous enum' : $(this).find('a:first,b,div.groupHeader').text();
742742
let isMemberGroupHeader = $(tr).hasClass('groupHeader');
743-
if ($(tr).is(":visible") && last_id!=id) {
743+
if ($(tr).is(":visible") && last_id!=id && id!==undefined) {
744744
if (isMemberGroupHeader && inMemberGroup) {
745745
ulStack.pop();
746746
inMemberGroup=false;
@@ -769,7 +769,7 @@ function initNavTree(toroot,relpath,allMembersFile) {
769769
const text = $(data).contents().not($(data).children().first()).text();
770770
const name = text.replace(/\(\)(\s*\[\d+\/\d+\])?$/, '') // func() [2/8] -> func
771771
id = $(data).find('span.permalink a').attr('href')
772-
if (name!=undefined) {
772+
if (id!==undefined && name!==undefined) {
773773
const li2 = $('<li>').attr('id','nav-'+id.substring(1));
774774
const div2 = $('<div>').addClass('item');
775775
const span2 = $('<span>').addClass('arrow').css({paddingLeft:parseInt(ulStack.length*16)+'px'});
@@ -864,8 +864,7 @@ function initNavTree(toroot,relpath,allMembersFile) {
864864
}
865865
}
866866
const contentScrollOffset = $('div.contents').offset().top;
867-
const scrollTargetId = scrollTarget.attr('id');
868-
if (scrollTarget && lastScrollTargetId!=scrollTargetId) { // new item to scroll to
867+
if (scrollTarget && lastScrollTargetId!=scrollTarget.attr('id')) { // new item to scroll to
869868
const scrollDown = contentScrollOffset<lastScrollSourceOffset;
870869
const range = 22*numItems;
871870
const my = range/2-height/2;
@@ -879,7 +878,7 @@ function initNavTree(toroot,relpath,allMembersFile) {
879878
pagenavcontents.scrollTo({ left:0, top:targetOffset },{ duration: 500, interrupt: true });
880879
lastScrollTargetOffset = targetOffset;
881880
}
882-
lastScrollTargetId = scrollTargetId;
881+
lastScrollTargetId = scrollTarget.attr('id');
883882
}
884883
lastScrollSourceOffset = contentScrollOffset;
885884
}

0 commit comments

Comments
 (0)