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

safeHTML marked HTML data elements (.Site.Data, JSON etc.) are escaped #3876

Closed
Brixy opened this Issue Sep 11, 2017 · 11 comments

Comments

Projects
None yet
5 participants
@Brixy

Brixy commented Sep 11, 2017

Thanks for v0.27. Related content is great and fast.

Just want to mention that (some?) shortcodes suddenly escape html. The instagram expample from the website results in:

<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-version="7" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:658px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"><div style="padding:8px;"> <div style=" background:#F8F8F8; line-height:0; margin-top:40px; padding:33.251231527093594% 0; text-align:center; width:100%;"> <div style="

…

Also my own shortcodes are escaped.

Thank you.

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Sep 11, 2017

Member

Hmm... Probably a Go 1.9 thing. But gohugo.io is built with Hugo 0.27 and I don't see any issue there:

https://gohugo.io/content-management/shortcodes/#instagram

Member

bep commented Sep 11, 2017

Hmm... Probably a Go 1.9 thing. But gohugo.io is built with Hugo 0.27 and I don't see any issue there:

https://gohugo.io/content-management/shortcodes/#instagram

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Sep 11, 2017

Member

What OS are you running?

@digitalcraftsman can you reproduce this?

Member

bep commented Sep 11, 2017

What OS are you running?

@digitalcraftsman can you reproduce this?

@Brixy

This comment has been minimized.

Show comment
Hide comment
@Brixy

Brixy Sep 11, 2017

macOS 10.12.6

Thanks for your help, @bep. I guess, your middle name is “fast”, too!

Brixy commented Sep 11, 2017

macOS 10.12.6

Thanks for your help, @bep. I guess, your middle name is “fast”, too!

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Sep 11, 2017

Member

Thanks for your help, @bep. I guess, your middle name is “fast”, too!

No, that is my last name. My middle name is Erik :-)

Member

bep commented Sep 11, 2017

Thanks for your help, @bep. I guess, your middle name is “fast”, too!

No, that is my last name. My middle name is Erik :-)

@digitalcraftsman

This comment has been minimized.

Show comment
Hide comment
@digitalcraftsman

digitalcraftsman Sep 11, 2017

Member

I compiled the latest version and checked the docs locally. But I wasn't able to reproduce this issue either.

Member

digitalcraftsman commented Sep 11, 2017

I compiled the latest version and checked the docs locally. But I wasn't able to reproduce this issue either.

@Brixy

This comment has been minimized.

Show comment
Hide comment
@Brixy

Brixy Sep 11, 2017

Thank you, guys.

Now, I know what causes the problem, but I do not know why.

My “config.toml” says:

[outputs]
page = ["HTML", "Calendar"]

It is the Calendar entry that causes the error. Without it, everything works fine—but, of course, the calendar function is necessary for the project. With that said, I just love Hugo for its custom output formats!

Error occurs with “single.ics” or with “single.calendar.ics”

Brixy commented Sep 11, 2017

Thank you, guys.

Now, I know what causes the problem, but I do not know why.

My “config.toml” says:

[outputs]
page = ["HTML", "Calendar"]

It is the Calendar entry that causes the error. Without it, everything works fine—but, of course, the calendar function is necessary for the project. With that said, I just love Hugo for its custom output formats!

Error occurs with “single.ics” or with “single.calendar.ics”

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Sep 11, 2017

Member

@Brixy OK, then I think I know enough to try to reproduce it. I suspect it is a Go 1.9 issue, which is the only related change from Hugo 0.26.

Member

bep commented Sep 11, 2017

@Brixy OK, then I think I know enough to try to reproduce it. I suspect it is a Go 1.9 issue, which is the only related change from Hugo 0.26.

@bep bep removed the NeedsUserFeedback label Sep 11, 2017

@bep bep self-assigned this Sep 11, 2017

@pamubay

This comment has been minimized.

Show comment
Hide comment
@pamubay

pamubay Sep 12, 2017

I also face this issue.

it happened when running hugo server

in 0.26 if we change the shortcode (like Instagram) Hugo rebuild always generate successfully without escaping the html.

in 0.27 when hugo server running then we change the shortcode, the rebuild will produce escaped HTML code.

pamubay commented Sep 12, 2017

I also face this issue.

it happened when running hugo server

in 0.26 if we change the shortcode (like Instagram) Hugo rebuild always generate successfully without escaping the html.

in 0.27 when hugo server running then we change the shortcode, the rebuild will produce escaped HTML code.

@bep bep added the Bug label Sep 12, 2017

@bep bep added this to the v0.27.1 milestone Sep 12, 2017

bep added a commit to bep/hugo that referenced this issue Sep 12, 2017

@bep bep changed the title from Shortcode html is escaped (v0.27) to safeHTML marked HTML data elements (.Site.Data, JSON etc.) are escaped Sep 12, 2017

bep added a commit to bep/hugo that referenced this issue Sep 12, 2017

@bep

This comment has been minimized.

Show comment
Hide comment
@bep
Member

bep commented Sep 12, 2017

bep added a commit to bep/hugo that referenced this issue Sep 13, 2017

@bep bep closed this in #3880 Sep 13, 2017

bep added a commit that referenced this issue Sep 13, 2017

@Brixy

This comment has been minimized.

Show comment
Hide comment
@Brixy

Brixy Sep 13, 2017

Thank you very much for all your efforts in general and for bringing out v0.27.1 so quickly, @bep.

(Apologies if answering to a closed thread is unprofessional[?].)

Brixy commented Sep 13, 2017

Thank you very much for all your efforts in general and for bringing out v0.27.1 so quickly, @bep.

(Apologies if answering to a closed thread is unprofessional[?].)

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Sep 13, 2017

Member

@Brixy the reason I moved so fast on this was that I suspected that it had to be fixed in Go, and I knew that 1.9.1 is just around the corner -- so to get a fix in there would require some really fast action. Luckily there was a workaround on the Hugo side of the fence.

Member

bep commented Sep 13, 2017

@Brixy the reason I moved so fast on this was that I suspected that it had to be fixed in Go, and I knew that 1.9.1 is just around the corner -- so to get a fix in there would require some really fast action. Luckily there was a workaround on the Hugo side of the fence.

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