Raw content impression

Then i was waiting for this new updated element i was thinking about: it would be nice if it will disable any dynamic content inside of it. Trying to wrap inside of it something like this:

<pre><code><script type="text/javascript" src="https://cdnjs.cloudflare.com/something.min.js"></script></code></pre>

will initiate script loading… (and inside cornerstone it will becomes invivsible). To resolve a problem i need to paste script inside of it like this:

<pre><code class="language-html">&lt;script type="text/javascript" src="https://cdnjs.cloudflare.com/something.min.js"&gt;&lt;/script&gt;</code></pre>

It would be nice if scripts will not work inside raw content (as it works on this forum). So if script wrapped inside of < pre > - it will be visible at cornerstone as text and will not loads itself. Right now if script is wrapped in < pre > < code > even if it is inside of new raw content element it’s trying to load itself.

Sorry for my language.

And there is no Customize options for this element like it’s a v1 element. I cannot add any margin or padding to it. So if there is 2 or more of this elements comes in a row i have to use Gap element to have some padding or margin between them… It’s not good at all.

Hi @Georgich,

Thanks for sharing your feedback with us. It sounds like you might just want to use a Content Area element. This new Raw Content element is specialized in that it will output directly where you place it with zero modification (hence the name). Because there is no wrapping div, there is no place to add customize controls. The Raw Content element is intended for code snippets (likely including javascript) so we wouldn’t want to disable that functionality. Converting to HTML entities is a the best solution to prevent code from executing.

Yep, you are totally right. Probably i can use any elements such as text, headline, content area or else to put the code inside of it, but it would be nice if there be an element to put the code inside and it will be just a text, so the < script > tags will not work, like at this forum in < pre > < code >. Here i can simply add a < script > tag without any problems.

<pre><code><script></script></code></pre>

This may help. Use a Content Area element with this inside:

[x_code]<script type="text/javascript" src="https://cdnjs.cloudflare.com/something.min.js"></script>[/x_code]

Looks like it doesn’t work in the live preview - I’ll look into that. But on the front end I think that’s what you’re looking for. Update: Tried to get the preview working for that shortcode but I don’t think it’s something I can solve for this release.

1 Like