mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	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 <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
		@@ -208,7 +208,7 @@ func TestRender_email(t *testing.T) {
 | 
				
			|||||||
	// Test that should *not* be turned into email links
 | 
						// Test that should *not* be turned into email links
 | 
				
			||||||
	test(
 | 
						test(
 | 
				
			||||||
		"\"info@gitea.com\"",
 | 
							"\"info@gitea.com\"",
 | 
				
			||||||
		`<p>“info@gitea.com”</p>`)
 | 
							`<p>"info@gitea.com"</p>`)
 | 
				
			||||||
	test(
 | 
						test(
 | 
				
			||||||
		"/home/gitea/mailstore/info@gitea/com",
 | 
							"/home/gitea/mailstore/info@gitea/com",
 | 
				
			||||||
		`<p>/home/gitea/mailstore/info@gitea/com</p>`)
 | 
							`<p>/home/gitea/mailstore/info@gitea/com</p>`)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -49,13 +49,6 @@ func render(body []byte, urlPrefix string, metas map[string]string, wikiMarkdown
 | 
				
			|||||||
				extension.TaskList,
 | 
									extension.TaskList,
 | 
				
			||||||
				extension.DefinitionList,
 | 
									extension.DefinitionList,
 | 
				
			||||||
				common.FootnoteExtension,
 | 
									common.FootnoteExtension,
 | 
				
			||||||
				extension.NewTypographer(
 | 
					 | 
				
			||||||
					extension.WithTypographicSubstitutions(extension.TypographicSubstitutions{
 | 
					 | 
				
			||||||
						extension.EnDash:   nil,
 | 
					 | 
				
			||||||
						extension.EmDash:   nil,
 | 
					 | 
				
			||||||
						extension.Ellipsis: nil,
 | 
					 | 
				
			||||||
					}),
 | 
					 | 
				
			||||||
				),
 | 
					 | 
				
			||||||
				meta.Meta,
 | 
									meta.Meta,
 | 
				
			||||||
			),
 | 
								),
 | 
				
			||||||
			goldmark.WithParserOptions(
 | 
								goldmark.WithParserOptions(
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user