Monday, May 15, 2023
1 change
Resolved issues and error corrections
Fixed an issue where adding an external embedded view to a Knowledge article could crash the app. The editor now places the embed correctly at the end of the article, improving reliability for users working with embedded content.
Original PR description
This commit fixes a bug where inserting an external view inside a Knowledge article could lead to a crash of the application. This bug is caused by the rendering of data templates that includes `\n` chars in their rendering, meaning that the HTML body of the rendered data articles contained undesired characters that should not be present inside an HTML field. These undesired characters were then taken into account when using the function `setCursorEnd` with normalize set to true. The editor tried to insert the view/link inside the textNode containing `\n`, which leads to an unwanted behavior inside the editor that tries to add the view/link to the text node. Now before inserting the view we set the cursor to the end of the article so that the container selected by the editor is indeed the full body of the article. task-3288551