How to stop the label tag behavior on switch new line after the successful run of method?
Hi Team, We have added some static html using the method below.
let source = "<label contenteditable=\"true\"><span style =\"color: green;\" contenteditable=\"false\" id =\"populationStart\" populationid =\"" + populationId + "\" data-haspopulation = \"custom-population\">"+ startPop +" class=\"prevent-select\"</span> <span style=\"color: green;\" contenteditable=\"false\" id =\"populationEnd\" populationid =\"" + populationId + "\" data-haspopulation = \"custom-population\" class=\"prevent-select\">"+ endPop + "</span> </label>";
this.editorEvent.model.change(writer => {
const htmlDP = this.editorEvent.data.processor;
const viewFragment = htmlDP.toView(source);
const modelFragment = this.editorEvent.data.toModel(viewFragment);
this.editorEvent.model.insertContent(modelFragment, this.editorEvent.model.document.selection);
});
It works fine but when we switch to the new line the label tag again comes in the p tag like this.
<p><label contenteditable="true">new line</label></p>
Please assist how to control this behavior.
Thanks
@CKEditorBot
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).