Wednesday, September 13, 2023
1 change · master
New functionality added to Odoo
Knowledge users can now add videos directly into articles, making it easier to create guides, tutorials, and shared resources without sending readers elsewhere. The implementation keeps video embeds compatible with existing editor safety rules by storing them in an approved format and rendering them as videos when displayed.
Original PR description
For Knowledge, we would like to allow people to embed videos in their articles because videos can be a great way to share information, and Knowledge could be an excellent tool to gather and organize…
For Knowledge, we would like to allow people to embed videos in their articles because videos can be a great way to share information, and Knowledge could be an excellent tool to gather and organize them. With Knowledge and the support of videos, people could write a guide and embed a tutorial video in it. People will be able to watch the video without leaving Knowledge, which is convenient. In the Odoo community, there already exists a command to embed a video, but it has been deactivated for security reasons. When an iframe tag is malformed, the web browser may try to fix it and may accidentally interpret text as an HTML node, which can be dangerous. Knowledge is able to recognize tags in the editor and turn those tags into owl components. To enable video embedding, we will rely on this mechanism: We will use an allowed tag to encode the information about the video, and we will replace that tag with an iframe. By using this approach, we will be able to embed videos without storing illegal tags that will be automatically discarded by the sanitizer. In the future, we may consider removing this work-around if exceptions are added to the sanitizer to not discard iframe of videos. task-3297215