Skip to content

Commit 2447ffc

Browse files
silverwindlafrikstechknowlogick
authored
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: #11001 * remove typographer extension completely * fix test * really fix test Co-authored-by: Lauris BH <[email protected]> Co-authored-by: techknowlogick <[email protected]>
1 parent b6adf80 commit 2447ffc

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

modules/markup/html_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ func TestRender_email(t *testing.T) {
208208
// Test that should *not* be turned into email links
209209
test(
210210
211-
`<p>[email protected]</p>`)
211+
`<p>&#34;[email protected]&#34;</p>`)
212212
test(
213213
"/home/gitea/mailstore/info@gitea/com",
214214
`<p>/home/gitea/mailstore/info@gitea/com</p>`)

modules/markup/markdown/markdown.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,6 @@ func render(body []byte, urlPrefix string, metas map[string]string, wikiMarkdown
4949
extension.TaskList,
5050
extension.DefinitionList,
5151
common.FootnoteExtension,
52-
extension.NewTypographer(
53-
extension.WithTypographicSubstitutions(extension.TypographicSubstitutions{
54-
extension.EnDash: nil,
55-
extension.EmDash: nil,
56-
extension.Ellipsis: nil,
57-
}),
58-
),
5952
meta.Meta,
6053
),
6154
goldmark.WithParserOptions(

0 commit comments

Comments
 (0)