{{- $inner -}} converts <script> to <pre><code>"<script></script>"</code></pre>

I have a shortcode named call-out that renders the content in a box with some styling, I use {{- $inner -}} in this shortcode.

I have another shortcode named command that has some javascript in a <script> tag.

When I nest command shortcode into call-out the script portion of it gets rendered as text like:

<pre>
  <code>
    "<script>....</script>"
  </code>
</pre>

Any idea how to maintain the functionality?

I suspect you are indenting by four or more spaces somewhere, which makes whatever you’re indenting an indented code block.

But without access to your project repository that is just an educated guess.

Wow that was it. Thank you!

I can’t figure out if it’s a bug or a feature but I can work with no indentation

That’s the way Markdown works; our renderer (Goldmark) adheres to the specification.

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.