-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
HTML entities are not removed from ZIM article titles #398
Comments
@rgaudin commented on Aug 4, 2020, 12:07 PM UTC:
I've looked at kiwixlib quickly and we don't appear to do much there neither. The suggested list items are not encoded neither so it seems to be solely related to the taskbar JS: jk( "#kiwixsearchbox" ).autocomplete({
source: "{{root}}/suggest?content={{#urlencoded}}{{{content}}}{{/urlencoded}}",
dataType: "json",
cache: false,
select: function(event, ui) {
jk( "#kiwixsearchbox" ).val(ui.item.value);
jk( "#kiwixsearchform" ).submit();
},
}); @mgautierfr can maybe explain with we use |
FYI this affects all scrapers and prevents any suggestion with a quote. You can search for |
The It doesn't encode the results of the request displayed to the user. |
This issue has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions. |
HTML escaping in suggestions is performed by mustache using this template: Escaping is applied to
I think the correct solution is to ensure that the API's response is valid JSON rather than safe HTML. HTML escaping of the data extracted from the response must be performed - if needed - in the frontend. |
While still thinking that this is the right approach, the easiest solution with the current mustache-based implementation (which primarily targets HTML) is to HTML escape the label too and unescape - if needed - the response data in the frontend. |
@kelson42 commented on Aug 4, 2020, 10:14 AM UTC:
See for example "Jean Aicard - L'Illustre Maurin ( EPUB et PDF gratuits )" in bouquineux.zim which gives
Jean Aicard - L'Illustre Maurin ( EPUB et PDF gratuits )
in kiwix-serve suggestions (one time chosen).This issue was moved by kelson42 from openzim/warc2zim#38.
The text was updated successfully, but these errors were encountered: