-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Externally rendered markdown broken by 867f46f #8299
Comments
The other possible solution would be to edit gitea/templates/repo/view_file.tmpl Line 48 in 867f46f
<div class="file-view {{if .IsMarkup}}{{.MarkupType}} markdown{{else if .IsRenderedHTML}}plain-text{{else if .IsTextFile}}code-view{{end}} has-emoji">
However both of these solutions run the risk of creating |
@HarvsG Please send a PR. |
@HarvsG Hej, I was not aware that the If the old behaviour should be restored, I'd propose to introduce a new styling class for each markupType eg |
@noerw, Agreed. However the current Perhaps we could create a copy of the current gitea/templates/repo/view_file.tmpl Line 48 in 867f46f
E.g <div class="file-view {{if .IsMarkup}}markup {{.MarkupType}}{{else if .IsRenderedHTML}}plain-text{{else if .IsTextFile}}code-view{{end}} has-emoji">
gitea/custom/conf/app.ini.sample Lines 797 to 804 in c6fb7fe
@noerw If you think this is a good idea, would you would be able to help me with the CSS changes as my CSS is weak, much less my 'less' skills. |
Your proposal sounds good, but refactoring this will need some elaborate manual testing (or is there a frontend test suite?). |
So let's sent two PRs. One for bug fix and another for a refactoring. :) |
fixes go-gitea#8299, a regression from 867f46f. unlike it's name suggests, the .markdown class is needed for most markup types. a future refactor should rename this class to something more generic
[x]
):Description
Somewhere between gitea version 1.8.2 and
master
the display of rendered html has changed in the repo view.both using the same render command: RENDER_COMMAND = "jupyter nbconvert --stdout --to html --template full "
In both cases
nbconvert==5.6.0
In the latest version it passes the HTML as below with
class=jupyter
, this results in unstyled HTMLHowever, previously it would pass
class=markdown
which would maintain styling:Using the chrome inspector to edit the class from
jupyter
tomarkdown
fixes this and returns styling.The culprit line appears to be line
gitea/routers/repo/view.go
Line 288 in c6fb7fe
A quick fix would be to change the above line to:
ctx.Data["MarkupType"] = markupType + " markdown"
....
Screenshots
Current appearance in
master
.Old appearance in v1.82 or after adding
class=markdown
inmaster
The text was updated successfully, but these errors were encountered: