Skip to content

Commit

Permalink
registry: Fix anchor navigation in some docsets (fixes zealdocs#641)
Browse files Browse the repository at this point in the history
This fixes decoding of fragments that start with '//dash_ref'.
  • Loading branch information
trollixx authored and spike008t committed Jan 12, 2017
1 parent 3dcb561 commit 536893f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/libs/registry/docset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,12 @@ QUrl Docset::createPageUrl(const QString &path, const QString &fragment) const

QUrl url = QUrl::fromLocalFile(QDir(documentPath()).absoluteFilePath(realPath));
if (!realFragment.isEmpty()) {
if (realFragment.startsWith("//apple_ref"))
if (realFragment.startsWith(QLatin1String("//apple_ref"))
|| realFragment.startsWith(QLatin1String("//dash_ref"))) {
url.setFragment(realFragment, QUrl::DecodedMode);
else
} else {
url.setFragment(realFragment);
}
}

return url;
Expand Down

0 comments on commit 536893f

Please sign in to comment.