Skip to content
/ gitea Public
forked from go-gitea/gitea

Commit

Permalink
Disable all typographic replacements in markdown renderer (go-gitea#1…
Browse files Browse the repository at this point in the history
…1871)

* Disable all typographic replacements in markdown renderer

Previously we only disabled some of them. This disables all the default
replacements that goldmark's typographer extension offers, matching
GitHub's renderer.

Ref: https://github.com/yuin/goldmark#typographer-extension
Fixes: go-gitea#11001

* remove typographer extension completely

* fix test

* really fix test

Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: techknowlogick <[email protected]>
  • Loading branch information
3 people authored Jun 13, 2020
1 parent b6adf80 commit 2447ffc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion modules/markup/html_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func TestRender_email(t *testing.T) {
// Test that should *not* be turned into email links
test(
"\"[email protected]\"",
`<p>[email protected]</p>`)
`<p>&#34;[email protected]&#34;</p>`)
test(
"/home/gitea/mailstore/info@gitea/com",
`<p>/home/gitea/mailstore/info@gitea/com</p>`)
Expand Down
7 changes: 0 additions & 7 deletions modules/markup/markdown/markdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ func render(body []byte, urlPrefix string, metas map[string]string, wikiMarkdown
extension.TaskList,
extension.DefinitionList,
common.FootnoteExtension,
extension.NewTypographer(
extension.WithTypographicSubstitutions(extension.TypographicSubstitutions{
extension.EnDash: nil,
extension.EmDash: nil,
extension.Ellipsis: nil,
}),
),
meta.Meta,
),
goldmark.WithParserOptions(
Expand Down

0 comments on commit 2447ffc

Please sign in to comment.