Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 960d611

Browse filesBrowse files
committed
Fix: url fragment is not processed correctly
Issue appears in these cases: 1. fragment contains spesial characters (quotes for example) 2. fragment starts with number
1 parent 79116da commit 960d611
Copy full SHA for 960d611

File tree

Expand file treeCollapse file tree

1 file changed

+2
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-6
lines changed

‎support/webpage/web_page.cpp

Copy file name to clipboardExpand all lines: support/webpage/web_page.cpp
+2-6Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,9 @@ void litebrowser::web_page::show_hash(const litehtml::string& hash)
118118
m_html_host->scroll_to(0, 0);
119119
} else
120120
{
121-
std::string selector = "#" + hash;
121+
auto escaped_hash = litehtml::get_escaped_string(hash);
122+
std::string selector = ":is([id=\"" + escaped_hash + "\"],[name=\"" + escaped_hash + "\"])";
122123
litehtml::element::ptr el = m_html->root()->select_one(selector);
123-
if (!el)
124-
{
125-
selector = "[name=" + hash + "]";
126-
el = m_html->root()->select_one(selector);
127-
}
128124
if (el)
129125
{
130126
litehtml::position pos = el->get_placement();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.