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

Shortcode fails when it starts right after front matter and there is a manual summary delimiter #5464

Closed
Lynxiayel opened this issue Nov 23, 2018 · 4 comments · Fixed by #5465
Assignees
Milestone

Comments

@Lynxiayel
Copy link
Contributor

Lynxiayel commented Nov 23, 2018

hugo version: 0.52
description: when using some shortcode before the <!--more--> tag, the shortcode is not recognized when render the full page.

I understand that when generating the summary, the shortcode may get ignored for a more simplistic and well organized "text-only" summary, but it should be recognized and interpreted when render the full page.
This behavior may be related to issue #1503

@bep
Copy link
Member

bep commented Nov 23, 2018

As I doubt the statement in the title is true in general, I think you need to provide a failing test case (there are plenty of passing test cases for this particular issue in Hugo's code base).

@Lynxiayel
Copy link
Contributor Author

Lynxiayel commented Nov 24, 2018

we can test a simple post like below, using the example shortcode gist from hugodoc.

+++
date="2018-11-24"
title="test"
author = "Lynxiayel"
+++
{{<gist spf13 7896402>}}
<!--more-->
{{<gist spf13 7896402>}}

Expected render result would be two gist sections, but we get the following, where clearly the one before the summary tag is not interpreted.
hugo_test

You can test with other built-in shortcode on the doc page, and get similar results.

One other thing worth noting is, if we test the tweet shortcode in the above example, it crashes the whole rendering process.

Hope this information helps, regards.

@bep
Copy link
Member

bep commented Nov 24, 2018

Yes, this is a bug, but you can work around it by inserting "something" (blank space, whatever) before your first shortcode.

bep added a commit to bep/hugo that referenced this issue Nov 24, 2018
@bep bep added this to the v0.52 milestone Nov 24, 2018
@bep bep self-assigned this Nov 24, 2018
@bep bep changed the title shortcode before the summary tag not recognized when render the full page Shortcode fails when it starts right after front matter and there is a manual summary delimiter Nov 24, 2018
@bep bep closed this as completed in #5465 Nov 24, 2018
@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 Feb 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants