Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 982357c8 authored by VIAUD Nathan's avatar VIAUD Nathan
Browse files

fix: remove font-family when content pasted;

parent ad30f081
No related branches found
No related tags found
1 merge request!142Resolve "Remove all formatting from pasted content in the wysiwyg editor"
Pipeline #1041877 passed
...@@ -52,7 +52,7 @@ const textToolbar = 'bold italic link bullist numlist'; ...@@ -52,7 +52,7 @@ const textToolbar = 'bold italic link bullist numlist';
const template = ` const template = `
<details style="border: 1px solid lightgray; border-radius: 4px; padding: .5em .5em 0 .5em"> <details style="border: 1px solid lightgray; border-radius: 4px; padding: .5em .5em 0 .5em">
<summary style="font-weight: bold; border-bottom: 1px solid lightgray; padding 1em;">Titre</summary> <summary style="font-weight: bold; border-bottom: 1px solid lightgray; padding 1em;">Titre</summary>
<div>content</div> <div>content</div>
</details> </details>
<p></p> <p></p>
`; `;
...@@ -129,6 +129,9 @@ const standardOptions = { ...@@ -129,6 +129,9 @@ const standardOptions = {
link_default_target: '_blank', link_default_target: '_blank',
link_target_list: false, link_target_list: false,
paste_data_images: true, paste_data_images: true,
paste_preprocess: (editor, args) => {
args.content = args.content.replace(/font-family:[^;"]+;?/gi, '');
}
}; };
const textOptions = { const textOptions = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment