同じタイトルのページに対するサイドバーの挙動を修正 #163
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
発生している問題
開いているページと同じタイトルの別ページが(同じヘッダ内に)存在するとき、サイドバーでその別ページがアクティブになる問題があります。
例えば、
reference/chrono/duration/floor
を開いたとき、サイドバーではreference/chrono/time_point/floor
がアクティブになります。両方タイトルが
std::chrono::floor
であり、両方<chrono>
に含まれるため、この問題が発生します。「機能テストマクロ」、「更新された定義済みマクロ」については #127 で修正しましたが、それ以外に92件もの同様の問題を持つページ組が存在することがわかりました。
修正のための変更
サイドバーの要素は
IndexID
をキーとする連想配列で管理されていました。IndexID
はページのタイトル(名前空間::(クラス::)?タイトル
)で決まるため、同じタイトルのページを区別することができませんでした。そこで、
IndexID
ではなく、ページごとに独立なIndex
をキーとするように変更することで問題を修正しました。この修正により #127 の変更は不要になったため削除しました。
付録
問題が発生するページ組の一覧