Code Block with HTML seems to parse it wrong
Closed this issue ยท 5 comments
iamandrewluca commented
Affected part of DeckDeckGo
- Studio (online editor)
Reproduction (click for YouTube video)
Expected Behavior
- After publish code block should contain the same code content
- On edit code blocks should not miss code content
Actual Behavior
- After publish some code blocks miss content
- On edit some code blocks miss content
Environment
- Browser: Chrome Version 91.0.4472.77 (Official Build) (64-bit)
- Operating System: Ubuntu 20.04.2 LTS
iamandrewluca commented
I tried with a new presentation.
- Create new presentation
- Add new slide Title + Code Block
- Change code block hightlighting to HTML
- Add this code block
<template>
<div>test</div>
</template>
- Publish.
- Open published presentation
- Slide looks fine
- Go back to editor
- Close presentation
- Open it again
- Code block contains only
<template></template>
peterpeterparker commented
The issue is the following: the <template/>
was correctly copied to the slotted element but, is interpreted by the browser. Therefore its content becomes added underneath a #document-fragment
which cannot be read when we save the slide to the db.
This will be solved in #1209 by escaping characters.
iamandrewluca commented
@peterpeterparker thanks a lot! looking forward to create more presentations in DeckDeckGo :)
peterpeterparker commented
Awesome and my pleasure, thanks for the help!
I spotted another small thing which I am trying to solve in same PR. Will ping you when merged and deployed.
peterpeterparker commented
Solved and live ๐
Thanks a lot for the detailed issue Andrew! If you notice any related or other issues, let me know.