Custom tag is not rendering while we edit the page
Hi team, I have created a custom tag by register in the schema of editor. Tag is generating fine while we create the page but when we open same page in edit mode than tag is not generating in html.
// Register the blockquote element in the schema
editor.model.schema.register("ah:expr", {
allowWhere: "$block",
allowContentOf: ["$block"],
allowAttributes: ['id', 'class', 'assettype'],
renderUnsafeAttributes: ['assettype'],
isBlock: true,
});
// Define upcast converter
editor.conversion.for("upcast").elementToElement({
model: "ah:expr",
view: {
name: "populationAccordion",
classes: "custom-populationSection exprSelector",
},
});
// Define data downcast converter
editor.conversion.for("dataDowncast").elementToElement({
model: "ah:expr",
view: {
name: "populationAccordion",
classes: "custom-populationSection exprSelector",
},
});
// Define editing downcast converter
editor.conversion.for("editingDowncast").elementToElement({
model: "ah:expr",
view: (modelElement, { writer: viewWriter }) => {
const blockquote = viewWriter.createContainerElement("ah:expr", {
class: "custom-populationSection exprSelector",
renderUnsafeAttributes: 'assettype',
isBlock: true,
contentEditable: false
});
return toWidget(blockquote, viewWriter, { label: "ah:expr" });
},
});
in edit
For rendering the tag in create we add some configuration as well to allow the tag in configuration array. this.config = { htmlSupport: { allow: [ { name: ["ah:expr",'/.*/'], attributes: true, classes: true, styles: true, }, ], }, }
if we remove this configuration then the ah:expr tag is not rendering in the HTML .
Can any one help to resolve the query why tag is not renders in edit.
@CKEditor5DevopsBot , @CKEditorBot
Thanks!
Hi Team, please assist if possible. @CKEditorBot
Thanks
There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.
We've closed your issue due to inactivity. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).