Issue #3334Opened March 11, 2021by KernelDeimos0 reactions

BUG: Attempts to load scripts to canvas maybe breaks javascript??

Question

Version: 0.16.44

Are you able to reproduce the bug from the demo?

[ ] Yes [x] No

What is the expected behavior? Legit anything else

Describe the bug detailed I was attempting to load scripts into the canvas. My first attempt was scripts: [] and then I ran into the synchronization issue mentioned in this PR's thread: https://github.com/artf/grapesjs/pull/67

I saw an example from @artf showing another way to do it with a property called components. Doing this broke the javascript parser. I'm not kidding; I posted a screenshot to prove it.

Also interesting to note: the text saying "TAG LOAD" in my console is coming from the script I was trying to load. So it... worked? Despite the page crashing due to the syntax being "invalid".

What is the current behavior? Seems to break Javascript parser?? O.o <img width="795" alt="Screen Shot 2021-03-11 at 2 31 27 AM" src="https://user-images.githubusercontent.com/7225168/110752290-126c2980-8213-11eb-87f4-a32ff83efc0b.png"> <img width="359" alt="Screen Shot 2021-03-11 at 2 40 31 AM" src="https://user-images.githubusercontent.com/7225168/110752363-2f086180-8213-11eb-9361-ed26ebae1fe1.png"> <img width="991" alt="Screen Shot 2021-03-11 at 2 42 18 AM" src="https://user-images.githubusercontent.com/7225168/110752605-7d1d6500-8213-11eb-9f5a-b63816c411f9.png">

Answers (1)

KernelDeimosMarch 12, 20210 reactions

I haven't used inline <script> tags in a while and forgot about this caveat of the HTML parser. Closing this.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.