Skip to content

Frontmatter summary icon is not displayed #34101

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

Closed
rijenkii opened this issue Apr 2, 2025 · 4 comments · Fixed by #34102
Closed

Frontmatter summary icon is not displayed #34101

rijenkii opened this issue Apr 2, 2025 · 4 comments · Fixed by #34102
Labels
Milestone

Comments

@rijenkii
Copy link

rijenkii commented Apr 2, 2025

Description

<summary> of the <details> tag which contains contents of the markdown frontmatter contains an <i class="icon table"> tag, but it does not render.

Example issue body:

---
this: is
a: yaml frontmatter
---
the `<summary>` of the `<details>` html tag above has element `<i class="icon table"></i>`, and it does not render.

Demo link: https://demo.gitea.com/rijenkii/123123/issues/1

Related code:

// FIXME: the "icon xxx" is from Fomantic UI, it's really questionable whether it still works correctly
err := r.renderInternal.FormatWithSafeAttrs(w, `<i class="icon %s"></i>`, name)

Possibly related code:

rc := &RenderConfig{
Meta: markup.RenderMetaAsDetails,
Icon: "table",
Lang: "",
}

Gitea Version

1.24.0+dev-529-g92dfec704f

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

Image

Git Version

No response

Operating System

No response

How are you running Gitea?

Demo

Database

None

@wxiaoguang
Copy link
Contributor

Thank you for the detailed analysis! It seems to be a regression of the "removal of Fomantic font icon"

Will take a look.

@wxiaoguang
Copy link
Contributor

-> Fix markdown frontmatter rendering #34102

Does it look good to you?

@rijenkii
Copy link
Author

rijenkii commented Apr 2, 2025

Yeah, it looks nicer than before.

List of keys is a nice touch, but I'm not sure how (and if) it will work with non-object frontmatters (however I am not sure they are supported at all):

---
- hello: world
  testing: lists
- and: frontmatter
  rendering: edgcases
---

They do seem completely broken rn (frontmatter yaml is pasted into the document body) (out of scope for this issue, can create another if this usecase is even supported):

Image

@wxiaoguang
Copy link
Contributor

List of keys is a nice touch, but I'm not sure how (and if) it will work with non-object frontmatters (however I am not sure they are supported at all):

Yes, there was a bug, they broke. New UI is still better in this case (at least, no serious broken):

Old UI

Image

New UI

Image

@lunny lunny added this to the 1.23.7 milestone Apr 2, 2025
@lunny lunny closed this as completed in ba921fd Apr 3, 2025
wxiaoguang added a commit to wxiaoguang/gitea that referenced this issue Apr 3, 2025
Fix go-gitea#34101
# Conflicts:
#	modules/markup/markdown/renderconfig_test.go
wxiaoguang added a commit to wxiaoguang/gitea that referenced this issue Apr 3, 2025
Fix go-gitea#34101
# Conflicts:
#	modules/markup/markdown/renderconfig_test.go
wxiaoguang added a commit to wxiaoguang/gitea that referenced this issue Apr 3, 2025
Fix go-gitea#34101
# Conflicts:
#	modules/markup/markdown/renderconfig_test.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants