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

Summernote paste is back... harder stronger faster smarter #1572

Merged
merged 9 commits into from
Jan 29, 2024

Conversation

pabois
Copy link
Member

@pabois pabois commented Jan 26, 2024

close #1541

en préparation de #1442

@arnaudlevy
Copy link
Member

Ha ha ha mais on avait pas conclu que c'était inutile parce que sanitized après ?

@pabois
Copy link
Member Author

pabois commented Jan 26, 2024

en fait ca permet d'avoir dans ton éditeur au moment du paste quelque chose qui ressemble à ce que tu auras après avoir sauvé et rechargé.
De plus ça permet de faire plus fin que le sanitizer (par exemple dans la blocs de crédits où on a juste droit à des liens ça veille a tout virer sauf les .
En gros j'établis pour chaque config une whitelist des tags tolérés correspondant aux boutons qu'on a mis dans la config concernée, et je coupe le reste.

Copy link
Member

@arnaudlevy arnaudlevy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C'est certainement très bien, mais c'est incompréhensible et ça devrait être dans un plugin externe je crois

// remove allMicrosoft Office tag
html = html.replace(/<!\[if !supportLists[\s\S]*?endif\]>/g, '');
// remove all html comments
html = html.replace(/<!--[\s\S]*?-->/g, '');

Check failure

Code scanning / CodeQL

Incomplete multi-character sanitization High

This string may still contain
<!--
, which may cause an HTML element injection vulnerability.
@pabois pabois merged commit 91ea011 into main Jan 29, 2024
4 of 6 checks passed
@pabois pabois deleted the summernote_paste branch January 29, 2024 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Supprimer le bold des crédits
3 participants