Skip to content

Externally rendered markdown broken by 867f46f #8299

Closed
@HarvsG

Description

@HarvsG
  • Gitea version (or commit ref):
  • Git version:
  • Operating system:
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

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 HTML

<div class="file-view jupyter has-emoji">
  <div id="notebook">
    <div id="notebook-container">

However, previously it would pass class=markdown which would maintain styling:

<div class="file-view markdown has-emoji">
  <div id="notebook">
    <div id="notebook-container">

Using the chrome inspector to edit the class from jupyter to markdown fixes this and returns styling.

The culprit line appears to be line

ctx.Data["MarkupType"] = markupType
added 1 month ago in 867f46f. This was a fix for #7868 (pull request #7869).

A quick fix would be to change the above line to:
ctx.Data["MarkupType"] = markupType + " markdown".

...

Screenshots

Current appearance in master.
Screenshot 2019-09-27 at 09 57 36
Old appearance in v1.82 or after adding class=markdown in master
Screenshot 2019-09-27 at 09 56 37

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions