Doing so makes the title display look ugly and generated a bug report. Instead of escaping
HTML entities, this patch just removes them.
BUG: 416781
FIXED-IN: 5.18.0
apol |
VDG | |
Discover Software Store |
Doing so makes the title display look ugly and generated a bug report. Instead of escaping
HTML entities, this patch just removes them.
BUG: 416781
FIXED-IN: 5.18.0
Searching still works
Search terms with HTML-unsafe characters in them no longer look ugly in the title:
No Linters Available |
No Unit Test Coverage |
Buildable 22022 | |
Build 22040: arc lint + arc unit |
Because if you enter my <u>potato</u> it gets styled, which shouldn't happen.
I suggest just doing the following:
diff --git a/discover/qml/ApplicationsListPage.qml b/discover/qml/ApplicationsListPage.qml index 4445a195..e094b667 100644 --- a/discover/qml/ApplicationsListPage.qml +++ b/discover/qml/ApplicationsListPage.qml @@ -52,11 +52,8 @@ DiscoverPage { function escapeHtml(unsafe) { return unsafe - .replace(/&/g, "&") .replace(/</g, "<") - .replace(/>/g, ">") - .replace(/"/g, """) - .replace(/'/g, "'"); + .replace(/>/g, ">"); } background: Rectangle {
So with this change, if you search "<b>potato</b>", you'll get as a title "potato". I wouldn't say that's entirely correct.
Why is that not entirely correct? The bold tags are just styling; the user clearly intended to search for the word "potato".
Because the user actually wrote "<b>potato</b>", it's only styling because you're thinking of html :)
But again, what user would actually write, by hand, "<b>potato</b>" in the search field? When users type into a search field, they don't add HTML styling. That only happens if they're copying and pasting from another source. In this case, if that do that and the tags come along for the ride, I'm claiming that the tags are unintentional and should be stripped to reflect the user's true intent--which is to search for the word "potato".
I feel like I'm missing something here.