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

Plantuml not rendering in Readme only in Issues and Wiki #19110

Closed
lukaskwkw opened this issue Mar 16, 2022 · 9 comments · Fixed by #19615
Closed

Plantuml not rendering in Readme only in Issues and Wiki #19110

lukaskwkw opened this issue Mar 16, 2022 · 9 comments · Fixed by #19615
Labels
Milestone

Comments

@lukaskwkw
Copy link

lukaskwkw commented Mar 16, 2022

Gitea Version

1.16.4

Git Version

2.30.2

Operating System

Windows 11

How are you running Gitea?

Docker image

Database

PostgreSQL

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Description

PlantUML rendering is only working in Issues & Wiki. Not in README.md files.

I.e. using code in README.md

```plantuml
@startuml
Bob -> Alice : hello
@enduml
```

will generate <code> block with language-plantuml class but won't render any content in if body

{{if .RequireHighlightJS}}
nothing here
{{end}}

I was able to workaround this by adding PageIsViewCode condition into if statement from docs example:
https://docs.gitea.io/en-us/customizing-gitea/#example-plantuml

{{if or .PageIsViewCode .RequireHighlightJS}}

It might be similar to #12307

Screenshots

with single RequireHighlightJS condition
obraz
with addtional PageIsViewCode condition
obraz

@silverwind
Copy link
Member

We should probably remove RequireHighlightJS and instead suggest to always just call parsePlantumlCodeBlocks. We're not even using higlight.js anymore.

@lunny lunny added the type/bug label Mar 17, 2022
@lunny lunny added this to the 1.16.5 milestone Mar 17, 2022
@zeripath
Copy link
Contributor

We should probably remove RequireHighlightJS and instead suggest to always just call parsePlantumlCodeBlocks. We're not even using higlight.js anymore.

Yeah I suspect we should just drop the RequireHighlightJS things from our templates.

@lukaskwkw you should be fine to just remove the requirement on the RequireHighlightJS from your pages - an alternative option might be to also detect IsMarkup in addition to RequireHightlightJs and perhaps we should migrate all places that use RequireHighlightJS to IsMarkup instead.

@lunny
Copy link
Member

lunny commented Mar 19, 2022

Looks like RequireHighlightJS could be removed, no standard template use that now.

@lunny
Copy link
Member

lunny commented Mar 19, 2022

IsMarkup is still not accurate. We need to detect all markdown sections which has plantuml code blocks.

@silverwind
Copy link
Member

silverwind commented Mar 21, 2022

I think JS should just execute document.querySelectorAll('language-plantuml') only, no need to hand-hold it via template variables. Scripts will need to lazy-loaded by JS that way.

@zeripath
Copy link
Contributor

@silverwind do you want to propose a documentation update PR?

@silverwind
Copy link
Member

Yes, once I figure out something that works.

@6543 6543 modified the milestones: 1.16.5, 1.16.6 Mar 24, 2022
@6543 6543 modified the milestones: 1.16.6, 1.16.7 Apr 6, 2022
@6543 6543 modified the milestones: 1.16.7, 1.16.8 May 1, 2022
@wxiaoguang
Copy link
Contributor

@lukaskwkw try this one (the example works for 1.16.x)

And please help to report or fix potential problems in it.

@lunny
Copy link
Member

lunny commented May 5, 2022

Since it's a break change, maybe we don't need to back port to v1.16

@lunny lunny modified the milestones: 1.16.8, 1.17.0 May 5, 2022
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants