Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #111

Merged
merged 7 commits into from Jul 15, 2020
Merged

Fixes #111

Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Use GLib.markup_escape_text() before parsing uri and title
typing in the address bar causes several of warnings:
(sugar-activity3:7184): Gtk-WARNING **: 16:25:08.511: Failed to set text from markup due to error parsing mar
kup: Error on line 2: Entity did not end with a semicolon; most likely you used an ampersand character withou
t intending to start an entity — escape ampersand as &

Sometimes there can be characters in uri and title such that markup parser can fail to parse the markup.
markup_escape_text escapes text so that the markup parser will parse it.
Less than, greater than, ampersand, etc. will be replaced with the corresponding entities.

Reported by- Shaan Subbaiah <shaansubbaiah.cs18@bmsce.ac.in> in http://lists.sugarlabs.org/archive/sugar-devel/2020-June/058458.html
  • Loading branch information
Saumya-Mishra9129 committed Jun 20, 2020
commit eada14236240cdac162dd0a3be63249e78721d41
@@ -170,7 +170,8 @@ def _search_update(self):

search_text = self.props.text
for place in places.get_store().search(search_text):
title = '<span weight="bold" >%s</span>' % (place.title)
title = '<span weight="bold" >%s</span>' % (GLib.markup_escape_text(place.title))
place.uri = GLib.markup_escape_text(place.uri)
list_store.append([title + '\n' + place.uri, place.uri])

self._search_view.set_model(list_store)