@bep, I almost think there should be a warning in the console when building sites with 0.60.x about this (if one or more instances of unsafe HTML are detected and removed by the renderer, emit one warning), I feel like a ton of users will hit this issue and have trouble resolving it.
Not only because of having trouble to resolve it: In my case, I read the release notes but thought it would be a non-issue for me as I thought I wouldn’t use HTML anywhere.
Turns out, I have some older articles converted over from the old Wordpress website which used HTML here and there, mostly for links and formatting instead of Markdown syntax. They displayed wrongly on the live website for a couple of days until I noticed. With a warning, I would have noticed directly.
@bep Do you want to create a poll about changing the default of unsafe to true?
My reasoning is that whoever is adding HTML embedded in the Markdown content in their Hugo sites is knowingly doing that, and they would always need to set unsafe = true.
So far, I haven’t found a reason why one would need to set that to false.
What kind of risk do you foresee on a Hugo generated static site by leaving the unsafe default to false? (There are other means to prevent malicious code injections, like the use of CSP.)
And the BDFL has spoken. These are the kinds of changes that make old WordPress websites look so [comment=23434]. Anyway, I’m happy to continue using Blackfriday until there’s a compelling reason to switch to an otherwise unproven library when Hugo should be past 1.0.
This isn’t a popularity thing. This is easy to turn off for those who don’t want it, which would include every person that would vote. It’s not possible to turn on for those who don’t know about it.
See my comment here if you have further questions:
What about emitting a warning on omission though? To understand what happened I had to go into page source code, find a comment, then google that comment, then get here.
Instead of leaving a comment in source code Hugo should very obviously state what’s happening when it’s generating the site.
This seems like a good compromise if only when the verbose flag is passed. Gruber created Markdown as a superset of HTML and, as it stands, Hugo is no longer using Markdown.
hugo gets updated very often when I update my operating system. I expect my site to keep working if I don’t touch it, but it’s not the case. It would be very nice if there was a breaking changes page somewhere in gohugo.io so I don’t need to read thousands of changes in case something breaks some day.
The Release Notes mentions “if you have lots of inline HTML…”. I don’t, but my site is still broken because the shortcodes are HTML, so they all disappeared. I just wanted to change a few words in my site but it turned out to be much longer.
I noticed the shortcodes were gone, so I went to the documentation (I can’t read the last 20 release notes) to see if the syntax had changed, where I see that you can now use either {{< and >}} and {{% and %}}, or is it />}} and /%}}? both are shown there… and index .Params 0 is now .Get 0? But both ways are still shown without mentioning what is the old and the new way. Tried them all out… then finally noticed the raw HTML omitted messages…
I let someone else parse and convert this into issues if needed
Is there any chance Hugo can move to using semantic versioning so that we at least know when to expect breaking changes (defined here as changes that will break existing sites?)
one thing I’d like to add - just for the records:
I usually don’t use HTML inside markdown, but:
Since it seems not to be possible to join table cells in markdown I sometimes have to add linebreaks within table cells.
Markdown linebreaks (four spaces and a linefeed) obviously breaks the table so in this case I have to use …
Tables looked awful …