Invalid p-tag wrapping for nested shortcodes #1387

Open
bclermont opened this Issue Aug 30, 2015 · 7 comments

Projects

None yet

3 participants

@bclermont
Contributor

To fix issue #1148 I updated to master branch, and now I have a somewhat similar issue.

When I use 2 levels of shortcode, whatever come after {{ .Inner }} is wrapped with a <p>. I created a project to reproduce the problem: https://raw.githubusercontent.com/bclermont/hugo-issue-1387/

In this example all shortcode are simple <div> like that:

https://github.com/bclermont/hugo-issue-1387/blob/master/layouts/shortcodes/column.html

and the following markdown:

https://raw.githubusercontent.com/bclermont/hugo-issue-1387/master/content/test.md

render as:

<html>
<body>
<p>Before Container</p>

<div class="container">
    <p>begin container.</p>

<p>before row</p>

<div class="row">
    <p>row content</p>

<p>before column</p>

<div class="column">
    <p>Content column 1</p>

</div>

<p>between columsn</p>

<div class="column">
    <p>Content column 2</p>

</div>

<p>after column</p>

<p></div></p>

<p>After row</p>

</div>

<p>after container</p>
</html>

Note the <p></div></p>.

@bclermont bclermont changed the title from Invalid P wrapping to Invalid p-tag wrapping Aug 30, 2015
@bep bep added a commit to bep/hugo-issue-1387 that referenced this issue Sep 1, 2015
@bep bep Add no-markdown variant
Add test2.md page to show that shortcode syntax without Markdown rendering renders this case fine.

Having shortcodes where the entire content is wrapped with `div` doesn't make sense to send through Blackfriday.

See spf13/hugo#1387
f4f734f
@bep
Collaborator
bep commented Sep 1, 2015

I added a PR for the test case showing a workaround -- or I would call it a solution for this case. I will, eventually, figure out where that p is coming from, but having inner content with only a div screams for the {{< shortcode syntax.

@bep
Collaborator
bep commented Sep 1, 2015

OK, I think I see the problem.

@bep bep added the bug label Sep 1, 2015
@bep bep changed the title from Invalid p-tag wrapping to Invalid p-tag wrapping for nested shortcodes Sep 1, 2015
@guy-mograbi-at-gigaspaces guy-mograbi-at-gigaspaces added a commit to cloudify-cosmo/docs.getcloudify.org that referenced this issue Sep 13, 2015
@guy-mograbi-at-gigaspaces guy-mograbi-at-gigaspaces fix: gscloak usage was incorrect
ALSO - fix snippets.
It seems hugo has a bug:
spf13/hugo#1148
spf13/hugo#1387

which is causing YAMLs not to render properly when there's a blank line. removed blank lines.
0ec5b93
@bep
Collaborator
bep commented Nov 29, 2015

Also see #1387

@binary132

@bep: This is #1387

@bep
Collaborator
bep commented Jan 8, 2016

I know ... now. But there is another one ... similar.

@bep
Collaborator
bep commented Jan 9, 2016
@binary132

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment