@ckeditor/ckeditor5-html-support 48.1.1 → 48.2.0-alpha.1
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.
- package/dist/generalhtmlsupportconfig.d.ts +1 -1
- package/dist/index.js +11 -7
- package/dist/index.js.map +1 -1
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -714,17 +714,14 @@ function modifyGhsAttribute(writer, item, ghsAttributeName, subject, callback) {
|
|
|
714
714
|
view: 'form',
|
|
715
715
|
modelSchema: {
|
|
716
716
|
inheritAllFrom: '$container',
|
|
717
|
-
isBlock:
|
|
717
|
+
isBlock: false
|
|
718
718
|
}
|
|
719
719
|
},
|
|
720
720
|
{
|
|
721
721
|
model: 'htmlHgroup',
|
|
722
722
|
view: 'hgroup',
|
|
723
723
|
modelSchema: {
|
|
724
|
-
|
|
725
|
-
'$root',
|
|
726
|
-
'$container'
|
|
727
|
-
],
|
|
724
|
+
allowWhere: '$container',
|
|
728
725
|
allowChildren: [
|
|
729
726
|
'paragraph',
|
|
730
727
|
'htmlP',
|
|
@@ -4022,9 +4019,16 @@ const STYLE_ATTRIBUTES_TO_PROPAGATE = [
|
|
|
4022
4019
|
const editor = this.editor;
|
|
4023
4020
|
const loadedCommentsContent = new Map();
|
|
4024
4021
|
editor.data.processor.skipComments = false;
|
|
4025
|
-
//
|
|
4022
|
+
// Declare the `$comment` attribute on `$root`. Custom roots that opt into the `$root`
|
|
4023
|
+
// attribute chain via `allowAttributesOf: '$root'` get comment support automatically.
|
|
4024
|
+
editor.model.schema.extend('$root', {
|
|
4025
|
+
allowAttributes: '$comment'
|
|
4026
|
+
});
|
|
4027
|
+
// Allow storing comment's content as a root attribute with the name `$comment:<unique id>`.
|
|
4028
|
+
// Gate the per-comment attribute on the root already allowing the generic `$comment` attribute
|
|
4029
|
+
// so the rule works for any root name.
|
|
4026
4030
|
editor.model.schema.addAttributeCheck((context, attributeName)=>{
|
|
4027
|
-
if (
|
|
4031
|
+
if (attributeName.startsWith('$comment:') && editor.model.schema.checkAttribute(context, '$comment')) {
|
|
4028
4032
|
return true;
|
|
4029
4033
|
}
|
|
4030
4034
|
});
|