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

Invalid p-tag wrapping for nested shortcodes #1387

Closed
bclermont opened this issue Aug 30, 2015 · 9 comments
Closed

Invalid p-tag wrapping for nested shortcodes #1387

bclermont opened this issue Aug 30, 2015 · 9 comments
Labels

Comments

@bclermont
Copy link
Contributor

@bclermont bclermont commented Aug 30, 2015

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 Invalid P wrapping Invalid p-tag wrapping Aug 30, 2015
bep added a commit to bep/hugo-issue-1387 that referenced this issue Sep 1, 2015
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 gohugoio/hugo#1387
@bep
Copy link
Member

@bep 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
Copy link
Member

@bep 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 Invalid p-tag wrapping Invalid p-tag wrapping for nested shortcodes Sep 1, 2015
guy-mograbi-at-gigaspaces added a commit to cloudify-cosmo/docs.getcloudify.org that referenced this issue Sep 13, 2015
ALSO - fix snippets.
It seems hugo has a bug:
gohugoio/hugo#1148
gohugoio/hugo#1387

which is causing YAMLs not to render properly when there's a blank line. removed blank lines.
@bep
Copy link
Member

@bep bep commented Nov 29, 2015

Also see #1387

@binary132
Copy link

@binary132 binary132 commented Jan 8, 2016

@bep: This is #1387

@bep
Copy link
Member

@bep bep commented Jan 8, 2016

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

@bep
Copy link
Member

@bep bep commented Jan 9, 2016

@binary132
Copy link

@binary132 binary132 commented Jan 17, 2016

👍

@bep
Copy link
Member

@bep bep commented Feb 28, 2017

This issue has been automatically marked as stale because it has not been commented on for at least four months.

The resources of the Hugo team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, and you feel that it is still valuable, please open a proposal at https://discuss.gohugo.io/.

This issue will automatically be closed in four months if no further activity occurs. Thank you for all your contributions.

@bep bep added the Stale label Feb 28, 2017
@bep
Copy link
Member

@bep bep commented Mar 1, 2017

Note/Update: This issue is marked as stale, and I may have said something earlier about "opening a thread on the discussion forum". Please don't.

If this is a bug and you can still reproduce this error on the latest release or the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.

@bep bep removed the Bug label Mar 27, 2017
@bep bep closed this Nov 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants