Closed sameerpallav closed 4 years ago
Hi, thanks for the report. You need to add a conversion for inserting a page break and allow there the id
attribute. The basic implementation looks like this:
editor.conversion.for( 'downcast' ).add( dispatcher => {
dispatcher.on( 'insert:pageBreak', ( evt, data, conversionApi ) => {
const viewWriter = conversionApi.writer;
viewWriter.setAttribute( 'id', '1', conversionApi.mapper.toViewElement(data.item ) )
} );
} );
So in this example, every time you insert a page break, it will have id="1"
. You can now modify the code to insert here any value that you need.
Please let me know if this helps.
📝 Provide a description of the improvement
I insert page break into Ckedtior via
<div id="${o.id}" style="page-break-after: always"><span style="display: none;"> </span></div>
The ID gets stripped away. I even used a DIV convertor as per ckedtior 5 docs to allow all ids in DIV. But that doesn't seem to work either. Any solution on how I can add ID to a page breaks blocks?
This was my div attr convetor
How the feature works now and what you'd like to change?
📃 Other details
If you'd like to see this improvement implemented, add a 👍 reaction to this post.