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

"raw HTML omitted" again #865

Closed
postb99 opened this issue Jun 1, 2024 · 2 comments
Closed

"raw HTML omitted" again #865

postb99 opened this issue Jun 1, 2024 · 2 comments
Labels
wontchange This will not be worked on

Comments

@postb99
Copy link

postb99 commented Jun 1, 2024

Hello,

Juste updated the theme, there are not so many commits on main branch so I was surprised my included pages did not work and I saw "raw HTML omitted" in html output. Well, my last follow of theme changes goes back to May 1st, a month ago, LOL.

Fortunately this was solved again by enabling this again in hugo.toml:

[markup]
  [markup.goldmark]
    [markup.goldmark.renderer]
      unsafe = true

My website's _index.md page includes other pages with relative path:

{{% include "./includes/last_thought.md" true %}}

{{% include "./includes/last_poems.md" true %}}

In /includes/_index.md I have put only this because this folder contains all the hidden pages of the site so thet I have one place for often changing content:

+++
title = "Inclusions"
hidden = true
+++

In the two aforementioned included .md pages there is a very simple header:

+++
title = "Derniers ajouts"
+++

Then some text with some other include or links to other pages. No html.

What do you think of this behavior? I also noticed that I still used Hugo 0.124 so upgraded to latest 0.126.2.

image

@McShelby
Copy link
Owner

McShelby commented Jun 3, 2024

Hi Barbara, thanks for reporting.

This time "raw HTML omitted" comes from your usage of the include shortcode, which wasn't the cause in your older issue.

Sadly include currently behaves this way and to make it work for you right now is to use `unsafe=true'

As they say in the Hugo forum:

It is not unsafe if you are in control of your content.

@McShelby
Copy link
Owner

I will close this issue for now. As much as I really want to make the shortcodes work in all environments, there currently seems not a be a "one solution fits all". Previous attempts resulted in a mess (#555 and #547).

As said above, this is no new behavior.

@russfeld switched from safeHTML to markdownify for the same reason in his fork: https://github.com/ksu-cs-textbooks/hugo-theme-relearn/blame/2cadd589dabcf1feb585388b03ae02f4d5af4ef0/layouts/partials/shortcodes/include.html#L35

But doing this in the official release would break usage with % delimiters for all current users.

At a later point - probably in a major release (as it will require users to change their content) - I may make another attempt. A thing to keep in mind when revisiting this (and #547) is RenderShortcode

@McShelby McShelby added the wontchange This will not be worked on label Jul 24, 2024
@McShelby McShelby closed this as not planned Won't fix, can't repro, duplicate, stale Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontchange This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants