@festo-ui/angular 11.0.0-dev.938 → 11.0.0-dev.943
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6817,7 +6817,17 @@ class FngTextEditorComponent extends FngValueAccessorBaseDirective {
|
|
|
6817
6817
|
value = sanitizeConfig.sanitizingFn(this.domSanitizer, value);
|
|
6818
6818
|
}
|
|
6819
6819
|
if (sanitizeConfig && !sanitizeConfig.skipDefaultSanitizing) {
|
|
6820
|
+
// Quill v2 uses data-list attributes to distinguish list types (bullet vs ordered),
|
|
6821
|
+
// but Angular's DomSanitizer strips all data-* attributes.
|
|
6822
|
+
// Encode data-list as a class before sanitizing and restore it afterwards,
|
|
6823
|
+
// so bullet lists are not incorrectly converted to ordered lists.
|
|
6824
|
+
value = value
|
|
6825
|
+
.replace(/ data-list="bullet"/g, ' class="fng-list-type-bullet"')
|
|
6826
|
+
.replace(/ data-list="ordered"/g, ' class="fng-list-type-ordered"');
|
|
6820
6827
|
value = this.domSanitizer.sanitize(SecurityContext.HTML, value) || '';
|
|
6828
|
+
value = value
|
|
6829
|
+
.replace(/ class="fng-list-type-bullet"/g, ' data-list="bullet"')
|
|
6830
|
+
.replace(/ class="fng-list-type-ordered"/g, ' data-list="ordered"');
|
|
6821
6831
|
}
|
|
6822
6832
|
if (sanitizeConfig && !sanitizeConfig.skipWhitespaceHandling) {
|
|
6823
6833
|
value = this.handleWhitespace(value);
|
|
@@ -6854,14 +6864,11 @@ class FngTextEditorComponent extends FngValueAccessorBaseDirective {
|
|
|
6854
6864
|
this.quillEditor.getModule('history').clear();
|
|
6855
6865
|
this.handle();
|
|
6856
6866
|
this.quillEditor.on('text-change', () => {
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
//
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
this.quillEditor.setContents(content, 'silent');
|
|
6863
|
-
}
|
|
6864
|
-
this.value = sanitized;
|
|
6867
|
+
// Only read and emit the current editor value. Sanitization happens on the
|
|
6868
|
+
// INPUT path (valueSetter / writeValue) when external content is written into
|
|
6869
|
+
// the editor. Calling setContents here would interrupt live editing and cause
|
|
6870
|
+
// the cursor to jump on every keystroke.
|
|
6871
|
+
this.value = this.valueGetter(this.editorElem);
|
|
6865
6872
|
});
|
|
6866
6873
|
}
|
|
6867
6874
|
ngOnChanges(changes) {
|