gnome-shell/js/misc
Sebastian Keller 3d8b866a9d util: Properly handle markup in highlighter
The code to highlight matches did not properly escape the passed in text
as for markup before adding its highlighting markup. This lead to some
search result descriptions not showing up, because their descriptions
contained characters, such as "<", that would have to be escaped when
used in markup or otherwise lead to invalid markup.

To work around this some search providers wrongly started escaping the
description on their end before sending them to gnome-shell. This lead
to another issue. Now if the highlighter was trying to highlight the
term "a", and the escaped description contained "&apos;", the "a" in
that would be considered a match and surrounded by "<b></b>". This
however would also generate invalid markup, again leading to an error
and the description not being shown.

Fix this by always escaping the passed in string before applying the
highlights in such a way that there are no matches within entities.

This also means that search providers that escaped their description
strings will now show up with the markup syntax. This will have to be
fixed separately in the affected search providers.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4791
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2033>
2021-12-22 16:47:18 +00:00
..
config.js.in build: Add soup2 option 2021-09-01 12:26:15 +02:00
extensionUtils.js extensionUtils: Add gettext convenience helpers 2021-08-14 18:45:25 +00:00
fileUtils.js cleanup: Replace non-standard ByteArray module 2021-09-01 14:49:30 +00:00
gnomeSession.js endSessionDialog: Only show logout inhibiting apps 2021-02-24 15:31:03 +00:00
history.js history: Trim input and ignore if empty 2021-02-13 08:58:20 +00:00
ibusManager.js ibusManager: Fix the panel after porting to Promises 2020-05-03 23:26:39 +08:00
inputMethod.js inputMethod: Do not reset invisible preedit on focus_out 2021-11-01 17:02:50 +00:00
introspect.js util: Wait for initial name owners in DBusSenderCheck before checking 2021-12-04 16:57:25 +00:00
jsParse.js cleanup: Remove empty leading/trailing lines in blocks 2020-11-16 18:04:23 +00:00
keyboardManager.js keyboard: Fix display keyboard layout crash with some input methods 2021-03-29 09:33:45 +00:00
loginManager.js screenShield: Asyncify _syncInhibitor() 2021-08-16 02:44:36 +02:00
meson.build build: Add soup2 option 2021-09-01 12:26:15 +02:00
modemManager.js cleanup: Define GObject accessors in camelCase 2021-02-03 20:19:29 +01:00
objectManager.js js: Promisify async operations 2020-03-31 05:43:40 +00:00
params.js cleanup: Only omit braces for single-line blocks 2019-11-11 19:25:14 +00:00
parentalControlsManager.js cleanup: remove controversial naming 2020-08-04 13:24:50 +02:00
permissionStore.js cleanup: Mark globals used from other modules as exported 2019-07-24 00:28:45 +02:00
smartcardManager.js cleanup: Remove empty leading/trailing lines in blocks 2020-11-16 18:04:23 +00:00
systemActions.js cleanup: Define GObject accessors in camelCase 2021-02-03 20:19:29 +01:00
util.js util: Properly handle markup in highlighter 2021-12-22 16:47:18 +00:00
weather.js Update links to use HEAD instead of master 2021-07-18 21:45:46 +00:00