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

Syna is not fully compatible with Hugo 0.60.0 new markdown render #638

Closed
Marzal opened this issue Nov 29, 2019 · 11 comments · Fixed by #645
Closed

Syna is not fully compatible with Hugo 0.60.0 new markdown render #638

Marzal opened this issue Nov 29, 2019 · 11 comments · Fixed by #645
Assignees
Labels
bug deps_hugo hugo dependency compatability issues
Milestone

Comments

@Marzal
Copy link
Contributor

Marzal commented Nov 29, 2019

Is this a BUG REPORT or FEATURE REQUEST?:
bug

What happened:
Hugo 0.60.0 / 0.60.1 changed blackfriday markdown render to Goldmark

What you expected to happen:
All the content is rendered

How to reproduce it (as minimally and precisely as possible):
Build the proyect with hugo > 0.60.0

Anything else we need to know?:
To workaround this until some changes are made:

Add to config.toml

[markup]
   defaultMarkdownHandler = "blackfriday"

Environment:

  • Syna Theme version: 0.15.1 or master
  • Hugo version: 0.60.1
  • Others: Arch Linux
@Marzal Marzal changed the title Hugo 0.60.0 new render is not fully compatible with Syna Syna is not fully compatible with Hugo 0.60.0 new markdown render Nov 29, 2019
@stp-ip stp-ip added the bug label Nov 30, 2019
@stp-ip stp-ip added this to the v0.16.0 milestone Nov 30, 2019
@stp-ip
Copy link
Member

stp-ip commented Nov 30, 2019

Thanks for reporting. Always happy for PRs :)

@Marzal
Copy link
Contributor Author

Marzal commented Nov 30, 2019

I found an official bug report in Hugo.
The option to use the new render and RAW html is:

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

Shortcode {{< is another possible solution

@mpourismaiel
Copy link
Member

Thanks for reporting the issue. We're a bit back on supporting new Hugo versions since there have been quite a few breaking changes. We're investigating ways to work around them but the latest supported version for us right now seems to 0.58.1. Hopefully our next release will add support for latest updates. We always appreciate new PRs.

@stp-ip stp-ip added the deps_hugo hugo dependency compatability issues label Dec 1, 2019
@Marzal
Copy link
Contributor Author

Marzal commented Dec 2, 2019

Just in case this info is useful.
I have not tested all the fragments, but at least with Nav, Item, Search, Portfolio, Content, Embed, Footer and Copyright with unsafe = true everything it's working well in the web were I'm using Syna with Hugo 0.60.1.

@mpourismaiel
Copy link
Member

I'm not sure why unsafe helps. Anyways, creating a PR for it right away.

@mpourismaiel
Copy link
Member

If you can explain to me why without unsafe nothing renders I would really appreciate it. GoldMark is common mark compliant and I don't think we're using anything beyond common mark in our markdown files. Except maybe shortcodes in a few places.

@mpourismaiel mpourismaiel self-assigned this Dec 3, 2019
@Marzal
Copy link
Contributor Author

Marzal commented Dec 3, 2019

unsafe allow RAW html with GoldMark, and markdownify is converting the markdown in html before GoldMark tries to render it (or at least that is what I think)

For example in the item.html fragment the "Title" {{- .Params.title | markdownify -}} and all the other Params work, but the content {{- .self.Content | markdownify -}} is what is omited/changed for Raw HTML omitted because I have an unsorted list that markdonify converts in html which GoldMark doesn't allow by default.
The other calls to markdonwnify are simple sentences that doesn't convert to any html code, just plain words.

title = "Apuntes sobre Zero Waste"
...
+++
* Text
* ... 
* Another text

If I change
{{- .self.Content | markdownify -}} to just {{- .self.Content -}} it work's without needing unsafe

I don't know if is better explained in this bug

@mpourismaiel
Copy link
Member

Okay I think changing {{- .self.Content | markdownify -}} to {{- .self.Content -}} is a much better solution. Created a tracking issue for it #646 so we can investigate all the places it causes problems. I really appreciate your help. I wouldn't have been able to figure this out on my own. Thanks a lot.

@stp-ip
Copy link
Member

stp-ip commented Dec 3, 2019

It seems like the actual solution might be setting it to untrue with the reasoning, if one controls the content this should be fine.

Removing markdownify feels like removing most of the good layout structuring from .Content or am I missing some kind of auto markdown layouting?

@Marzal
Copy link
Contributor Author

Marzal commented Dec 3, 2019

I'm not sure yet what's the real problem with markdownify, if I use a content with just a plain word in the same place still fails, so is not because of the complexity of the source to translate to html. I will do further testing these days.

@mpourismaiel
Copy link
Member

@Marzal We appreciate your help. PRs are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug deps_hugo hugo dependency compatability issues
Development

Successfully merging a pull request may close this issue.

3 participants