[PR #186] [MERGED] Markdown rendering overhaul #15209

Closed
opened 2025-11-02 11:41:22 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/186
Author: @andrew-boyarshin
Created: 11/16/2016
Status: Merged
Merged: 2/14/2017
Merged by: @lunny

Base: masterHead: markdownPR


📝 Commits (2)

  • 7ae1a52 Markdown rendering overhaul
  • efb718c Fix markdown API, add markdown module and API tests, improve code coverage

📊 Changes

13 files changed (+1374 additions, -187 deletions)

View changed files

📝 cmd/web.go (+5 -0)
📝 modules/markdown/markdown.go (+357 -101)
📝 modules/markdown/markdown_test.go (+514 -37)
📝 public/css/index.css (+6 -1)
📝 public/js/index.js (+2 -0)
public/js/libs/autolink.js (+12 -0)
📝 public/less/_markdown.less (+5 -1)
📝 routers/api/v1/misc/markdown.go (+4 -3)
routers/api/v1/misc/markdown_test.go (+184 -0)
📝 routers/repo/wiki.go (+260 -41)
📝 templates/base/footer.tmpl (+1 -0)
📝 templates/repo/wiki/pages.tmpl (+2 -0)
📝 templates/repo/wiki/view.tmpl (+22 -3)

📄 Description

The majority of markdown files should now look great.

  1. Implemented sidebar and footer (GitHub like). Header can also be done, but even GitHub doesn't implement one.
  2. Implemented [[...]] image & link handling. It is quite a feature. It supports a variety of syntaxes.
![logo](http://libgdx.badlogicgames.com/img/logo.png)
[[[https://d3js.org/logo.svg|alt="D3js Logo"|height=210px|width=210px]]](https://d3js.org)
[[https://d3js.org/logo.svg|alt="D3js Logo"|height=210px|width=210px]]
[[Install]]
[[my internal link|internal-ref]]
![](000 hello world.png)
It is my great responsibility to send you... to http://google.com in order to find all your answers there.
The point is, <https://google.com> is more correct.
[Wiki](Home) ▸ **API Reference**
[[semantic versioning|http://semver.org]]
[[images/icon-install.png]]
  1. Added the ability to display any kind of text blobs with rendering as Markdown. For example guard uses Textile for its Home wiki page. Textile and markdown have common roots, so that it renders perfectly with Markdown parser. Anyway, it is better to display something, than to display nothing.
  2. Fixed a bug in markdown parser (stopped any special formatting after non-closeable tags like img)
  3. I've mirrored about 15 wikis. Everything renders fine, all images are resolved perfectly (even html hardcoded should work in most cases).

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/186 **Author:** [@andrew-boyarshin](https://github.com/andrew-boyarshin) **Created:** 11/16/2016 **Status:** ✅ Merged **Merged:** 2/14/2017 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `markdownPR` --- ### 📝 Commits (2) - [`7ae1a52`](https://github.com/go-gitea/gitea/commit/7ae1a52b8b0ddd046cbccef6f76db3581a882a66) Markdown rendering overhaul - [`efb718c`](https://github.com/go-gitea/gitea/commit/efb718cebd8cedd45166d39d36422ff3873fe2a7) Fix markdown API, add markdown module and API tests, improve code coverage ### 📊 Changes **13 files changed** (+1374 additions, -187 deletions) <details> <summary>View changed files</summary> 📝 `cmd/web.go` (+5 -0) 📝 `modules/markdown/markdown.go` (+357 -101) 📝 `modules/markdown/markdown_test.go` (+514 -37) 📝 `public/css/index.css` (+6 -1) 📝 `public/js/index.js` (+2 -0) ➕ `public/js/libs/autolink.js` (+12 -0) 📝 `public/less/_markdown.less` (+5 -1) 📝 `routers/api/v1/misc/markdown.go` (+4 -3) ➕ `routers/api/v1/misc/markdown_test.go` (+184 -0) 📝 `routers/repo/wiki.go` (+260 -41) 📝 `templates/base/footer.tmpl` (+1 -0) 📝 `templates/repo/wiki/pages.tmpl` (+2 -0) 📝 `templates/repo/wiki/view.tmpl` (+22 -3) </details> ### 📄 Description The majority of markdown files should now look great. 1. Implemented sidebar and footer (GitHub like). Header can also be done, but even GitHub doesn't implement one. 2. Implemented `[[...]]` image & link handling. It is quite a feature. It supports a variety of syntaxes. ``` markdown ![logo](http://libgdx.badlogicgames.com/img/logo.png) [[[https://d3js.org/logo.svg|alt="D3js Logo"|height=210px|width=210px]]](https://d3js.org) [[https://d3js.org/logo.svg|alt="D3js Logo"|height=210px|width=210px]] [[Install]] [[my internal link|internal-ref]] ![](000 hello world.png) It is my great responsibility to send you... to http://google.com in order to find all your answers there. The point is, <https://google.com> is more correct. [Wiki](Home) ▸ **API Reference** [[semantic versioning|http://semver.org]] [[images/icon-install.png]] ``` 1. Added the ability to display any kind of text blobs with rendering as Markdown. For example [guard](https://github.com/guard/guard/wiki) uses Textile for its Home wiki page. Textile and markdown have common roots, so that it renders perfectly with Markdown parser. Anyway, it is better to display something, than to display nothing. 2. Fixed a bug in markdown parser (stopped any special formatting after non-closeable tags like img) 3. I've mirrored about 15 wikis. Everything renders fine, all images are resolved perfectly (even html hardcoded should work in most cases). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 11:41:22 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#15209