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

YAML frontmatter rendered improperly #5377

Closed
mcnesium opened this issue Nov 22, 2018 · 7 comments · Fixed by #11016
Closed

YAML frontmatter rendered improperly #5377

mcnesium opened this issue Nov 22, 2018 · 7 comments · Fixed by #11016
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/enhancement An improvement of existing functionality
Milestone

Comments

@mcnesium
Copy link
Contributor

Exemplary, in a Jekyll project, markdown files have a YAML front matter like this default one in index.md:

---
# Feel free to add content and custom Front Matter to this file.
# To modify the layout, see https://jekyllrb.com/docs/themes/#overriding-theme-defaults

layout: default
---

Gitea tries to render it as if it was regular Markdown:

screenshot from 2018-11-22 10-28-41

Instead, it should detect it being the YAML frontmatter and render it properly, e.g. like this (screenshot created by adding four spaces in front of each line in the front matter):

screenshot from 2018-11-22 10-30-03

@lafriks lafriks added the type/enhancement An improvement of existing functionality label Nov 22, 2018
@stale
Copy link

stale bot commented Jan 21, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Jan 21, 2019
@mcnesium
Copy link
Contributor Author

refresh/unstale

@stale stale bot removed the issue/stale label Jan 22, 2019
@lunny lunny added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Feb 7, 2019
@ghost
Copy link

ghost commented Sep 18, 2019

There is an open pull request for gogs: gogs/gogs#4643

@dakira
Copy link
Contributor

dakira commented Dec 5, 2019

I have the same problem. Would be nice if the front matter just weren't rendered at all. Edit: I guess this should be implemented on the side of the markdown parser. Which parser is in use by Gitea?

@davidsvantesson
Copy link
Contributor

@zeripath Do you think the change to goldmark makes a difference for this issue, does it have any specific support for it?

@dakira
Copy link
Contributor

dakira commented Feb 24, 2020

@davidsvantesson I haven't checked how it looks now, but Goldmark definitely has support for yaml frontmatter. It is used as the default renderer for Hugo which does also have yaml frontmatter.

@zeripath
Copy link
Contributor

@davidsvantesson @dakira we would need to use the https://github.com/yuin/goldmark-meta extension.

I guess it would probably be quite easy to do. The issue is deciding whether to always enable it or not.

I mean yaml front matter is a particular extension to commonmark - it may not be expected.

zeripath added a commit to zeripath/gitea that referenced this issue Apr 8, 2020
Add goldmark-meta to render yaml frontmatter as a table

Fix go-gitea#5377

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added a commit that referenced this issue Apr 9, 2020
Add goldmark-meta to render yaml frontmatter as a table

Fix #5377

Signed-off-by: Andrew Thornton <art27@cantab.net>
@lafriks lafriks added this to the 1.12.0 milestone Apr 9, 2020
ydelafollye pushed a commit to ydelafollye/gitea that referenced this issue Jul 31, 2020
Add goldmark-meta to render yaml frontmatter as a table

Fix go-gitea#5377

Signed-off-by: Andrew Thornton <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants