fnordfish / hugo-shortcode-nesting-test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Demonstrates an issue with Hugo shortcodes loosing their "html context" when getting nested.

Steps to reproduce

  1. Clone this repo
  2. Run hugo server
  3. View the source of http://localhost:1313/posts/test/

Files of interest:

Expected behavior

Generated HTML should be:

<!-- Start -->
<div class="page">
    <div class="inner">Test</div>
    <hr>
    <div class="inner">Test</div>
    <hr>
    No **markdown** expected here
    <hr>
    <div class="inner">Test</div>
    <div class="outer">
    
        <div class="inner">Test</div>
        <hr>
        <div class="inner">Test</div>
        <hr>
        No **markdown** expected here
        <hr>
        <div class="inner">No **markdown** expected here</p>
</div>
    
</div>
</div>
<!-- END -->

Actual behavior

Generated HTML is:

<!-- Start -->
<div class="page">
    <div class="inner">Test</div>
    <hr>
    <div class="inner">Test</div>
    <hr>
    No **markdown** expected here
    <hr>
    <div class="inner">Test</div>
    <div class="outer">
    
        <div class="inner"><p>Test</p>
</div>
        <hr>
        <div class="inner">Test</div>
        <hr>
        No **markdown** expected here
        <hr>
        <div class="inner"><p>No <strong>markdown</strong> expected here</p>
</div>
    
</div>
</div>
<!-- END -->

About


Languages

Language:HTML 95.4%Language:CSS 4.6%