Fix escaping {{ TrackLink }} in WYSIWYG editor UI
This commit is contained in:
parent
1e8b533d45
commit
7a9d11d426
|
@ -84,6 +84,11 @@ const quillFontSizes = Quill.import('attributors/style/size');
|
||||||
quillFontSizes.whitelist = ['11px', '13px', '22px', '32px'];
|
quillFontSizes.whitelist = ['11px', '13px', '22px', '32px'];
|
||||||
Quill.register(quillFontSizes, true);
|
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
|
// Custom class to override the default indent behaviour to get inline CSS
|
||||||
// style instead of classes.
|
// style instead of classes.
|
||||||
class IndentAttributor extends Quill.import('parchment').Attributor.Style {
|
class IndentAttributor extends Quill.import('parchment').Attributor.Style {
|
||||||
|
|
Loading…
Reference in New Issue