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
jeanlucmongrain opened this issue Aug 30, 2015 · 10 comments
Closed

Invalid p-tag wrapping for nested shortcodes #1387

jeanlucmongrain opened this issue Aug 30, 2015 · 10 comments

Comments

@jeanlucmongrain
Copy link
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>.

@jeanlucmongrain jeanlucmongrain 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 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 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 commented Nov 29, 2015

Also see #1387

@binary132
Copy link

@bep: This is #1387

@bep
Copy link
Member

bep commented Jan 8, 2016

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

@bep
Copy link
Member

bep commented Jan 9, 2016

#1642

@binary132
Copy link

👍

@bep
Copy link
Member

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 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 as completed Nov 11, 2017
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants