Fix escaping {{ TrackLink }} in WYSIWYG editor UI

This commit is contained in:
Kailash Nadh 2020-11-08 19:47:10 +05:30
parent 1e8b533d45
commit 7a9d11d426
1 changed files with 5 additions and 0 deletions

View File

@ -84,6 +84,11 @@ const quillFontSizes = Quill.import('attributors/style/size');
quillFontSizes.whitelist = ['11px', '13px', '22px', '32px'];
Quill.register(quillFontSizes, true);
// Sanitize {{ TrackLink "xxx" }} quotes to backticks.
const regLink = new RegExp(/{{(\s+)?TrackLink(\s+)?"(.+?)"(\s+)?}}/);
const Link = Quill.import('formats/link');
Link.sanitize = (l) => l.replace(regLink, '{{ TrackLink `$3`}}');
// Custom class to override the default indent behaviour to get inline CSS
// style instead of classes.
class IndentAttributor extends Quill.import('parchment').Attributor.Style {