mirror of
https://github.com/go-gitea/gitea.git
synced 2026-11-28 06:17:15 +08:00
Markdown, org-mode and other inline-rendered markup files get a source/rendered toggle in commit, compare and pull request diffs, like images and CSV. Source stays the default, matching GitHub. The rendered diff is fetched when opened, and only offered when both the old and the new name are markup files. The rendered diff follows GitHub's rich diff: changed blocks get a colored bar, words are marked inline, formatting-only changes are underlined, code blocks are compared by line and tables by cell, with a whole replacement when the columns of a table or row change. Math, mermaid and emoji are shown as removed and added whole, and invisible characters are escaped like in the source diff. A diff that takes too long is reported like a suppressed source diff. Wiki diffs get no toggle, and the rendered diff tab in the web editor is left for a follow-up. | Change | Rendered diff | | --- | --- | | Source stays the default | <img width="600" alt="Source stays the default" src="https://github.com/user-attachments/assets/87b140a6-4228-4514-8806-6897aeace766" /> | | Paragraphs and words | <img width="600" alt="Paragraphs and words" src="https://github.com/user-attachments/assets/e9c3b969-fb54-43b8-a167-364a81959015" /> | | Formatting, links and tasks | <img width="600" alt="Formatting, links and tasks" src="https://github.com/user-attachments/assets/2582db39-8d28-44e1-bc19-1128f259f070" /> | | Lists | <img width="600" alt="Lists" src="https://github.com/user-attachments/assets/23868a95-da05-4c41-a329-b8a06b6a94ad" /> | | Tables | <img width="600" alt="Tables" src="https://github.com/user-attachments/assets/ac924a0c-33df-4d89-af2d-bb2d74309d17" /> | | Code blocks | <img width="600" alt="Code blocks" src="https://github.com/user-attachments/assets/4a756005-ebf8-418f-a5a5-50520ef2ac4f" /> | | Math and mermaid | <img width="600" alt="Math and mermaid" src="https://github.com/user-attachments/assets/d1c6c96f-e7f4-4ed2-9744-8677fda68bbe" /> | This supersedes https://github.com/go-gitea/gitea/pull/37167, whose review raised the block-level and math/mermaid cases. Fixes: https://github.com/go-gitea/gitea/issues/21633 Assisted-by: Claude Code:claude-opus-5-5 --------- Co-authored-by: bircni <bircni@icloud.com> Co-authored-by: silverwind <me@silverwind.io>