11ty / eleventy

A simpler site generator. Transforms a directory of templates (of varying types) into HTML.
https://www.11ty.dev/
MIT License
17.22k stars 493 forks source link

.njk or .html includes in .md would have empty lines processed as <p> inside html areas #3528

Open terpimost opened 1 week ago

terpimost commented 1 week ago

Operating system

linux

Eleventy

3

Describe the bug

I have .md file inside of which I have an include:

{% include 'promo.html' %}

my promo.html content would be something like:

<div>
<h4>My promo</h4>
<script>
function(){
//empty line here makes elevent paste <p>

//some other thing
}
</script>
</div>

I thought markdown shouldn't process html sections, am I wrong? I do use custom markdown It instance and have:

    const options = {
        html: true,
        typographer: true,
        linkify: true,
    };

and my eleventy config sets template language like this:

return {
        markdownTemplateEngine: "njk",
        htmlTemplateEngine: "njk",
    }

Reproduction steps

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See an error

Expected behavior

No response

Reproduction URL

No response

Screenshots

No response

terpimost commented 1 week ago

It feels like doesn't matter the extension of my include it is processed as .md file.