Skip to content

Commit

Permalink
Fix escaping {{ TrackLink }} in WYSIWYG editor UI
Browse files Browse the repository at this point in the history
  • Loading branch information
knadh committed Nov 8, 2020
1 parent 1e8b533 commit 7a9d11d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions frontend/src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7a9d11d

Please sign in to comment.