From 2447ffc74a6e3ab57d98a52de0a7398cadb71e08 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sat, 13 Jun 2020 08:10:17 +0200 Subject: [PATCH] Disable all typographic replacements in markdown renderer (#11871) * 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: https://github.com/go-gitea/gitea/issues/11001 * remove typographer extension completely * fix test * really fix test Co-authored-by: Lauris BH Co-authored-by: techknowlogick --- modules/markup/html_test.go | 2 +- modules/markup/markdown/markdown.go | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/modules/markup/html_test.go b/modules/markup/html_test.go index 686057d11..a73236a7a 100644 --- a/modules/markup/html_test.go +++ b/modules/markup/html_test.go @@ -208,7 +208,7 @@ func TestRender_email(t *testing.T) { // Test that should *not* be turned into email links test( "\"info@gitea.com\"", - `

“info@gitea.com”

`) + `

"info@gitea.com"

`) test( "/home/gitea/mailstore/info@gitea/com", `

/home/gitea/mailstore/info@gitea/com

`) diff --git a/modules/markup/markdown/markdown.go b/modules/markup/markdown/markdown.go index 515d68468..128268bc8 100644 --- a/modules/markup/markdown/markdown.go +++ b/modules/markup/markdown/markdown.go @@ -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(