Skip to content
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

Nunjucks Shortcode output is escaped when using Nunjucks + Markdown #180

Closed
zachleat opened this issue Jul 23, 2018 · 5 comments
Closed
Assignees
Labels
education: template language Learning about a template language.

Comments

@zachleat
Copy link
Member

Reported by @hankchizljaw here: https://github.com/hankchizljaw/webcomponents.club

@zachleat zachleat added the bug label Jul 23, 2018
@Andy-set-studio
Copy link

zachleat added a commit that referenced this issue Jul 24, 2018
@zachleat zachleat added education: template language Learning about a template language. and removed bug labels Jul 31, 2018
@zachleat
Copy link
Member Author

As we discovered, this is because your shortcode has extra whitespace!

See: https://github.com/hankchizljaw/webcomponents.club/blob/master/shortcodes/video-poster-shortcode.js

As noted on https://commonmark.org/help/ indent 4 spaces triggers a code block in markdown.

So changing

let response = `
        <a href="${shareUrl}" aria-label="Watch this video on Youtube">
            …
        </a>
    `;

to

let response = `
<a href="${shareUrl}" aria-label="Watch this video on Youtube">
    …
</a>`;

will fix it!

@zachleat zachleat self-assigned this Jul 31, 2018
@Andy-set-studio
Copy link

Thanks @zachleat, hopefully this will help someone out in the long-term who finds themselves in a similar pickle 🙂

@zachleat
Copy link
Member Author

@hankchizljaw yes! It wasn't immediately obvious to me what was happening so I'm sure someone else will run into it too 👍🏻

@eeeps
Copy link

eeeps commented Jul 31, 2018

it me 🥒🏃‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
education: template language Learning about a template language.
Projects
None yet
Development

No branches or pull requests

3 participants