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 · 3 comments

Comments

Projects
None yet
2 participants
@Lynxiayel
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

This comment has been minimized.

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

This comment has been minimized.

Contributor

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

This comment has been minimized.

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 from shortcode before the summary tag not recognized when render the full page to Shortcode fails when it starts right after front matter and there is a manual summary delimiter Nov 24, 2018

@bep bep closed this in #5465 Nov 24, 2018

bep added a commit that referenced this issue Nov 24, 2018

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