-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
expand inside notice incorrectly interpreted as a code block #476
Comments
The different behavior comes from the additional usage of |
@McShelby thanks for the suggestion - unfortunately that didn't work. If I re-write the shortcode to look like this: <details>
<summary>{{ .Get 0 }}</summary>
{{.Inner}}
</details> then it works as expected. But, even wrapping it in an extra <div class="expand">
<details>
<summary>{{ .Get 0 }}</summary>
{{.Inner}}
</details>
</div> causes the final <pre><code class="hljs xml"><span class="hljs-tag"></<span class="hljs-name">details</span>></span>
</code><span class="copy-to-clipboard" title="Copy to clipboard"></span></pre> when used inside the notice shortcode. I'll try and investigate some more... but this seems pretty odd to me. |
Okay, I lost my bet - I owe you a coffee. Now a tested recommendation. Leave the shortcodes as is. Instead of your example, write: {{< notice note >}}
{{%expand "The expand label"%}}The expand content{{% /expand%}}
{{< /notice >}} This worked for me up to the point of correct HTML. Nevertheless this still cuts your notice box into halfs until you a) manually apply #455 to your code or |
Placing an "expand" shortcode inside a "notice" shortcode, such as:
produces the following:
I understand that there is a limitation of the notice shortcode, where styling is only applied to the first
<p>
, but the same behaviour exists with #455 that solves that particular limitation.What I can't understand is how the inner expand is being interpreted as code (
<pre><code class="hljs xml">
tags added).For reference, when not inside a notice, the following (expected) behaviour is observed:
I would be happy to work on a fix, but currently don't understand the problem. Any ideas what I'm missing?
The text was updated successfully, but these errors were encountered: