]> source.dussan.org Git - gitea.git/commitdiff
Fix table alignment in markdown (#16596) (#16602)
authorzeripath <art27@cantab.net>
Tue, 3 Aug 2021 23:16:00 +0000 (00:16 +0100)
committerGitHub <noreply@github.com>
Tue, 3 Aug 2021 23:16:00 +0000 (00:16 +0100)
Backport #16596

Set the TableOptions in markdown to allow alignment of the tables to work correctly

Fix #15959

Signed-off-by: Andrew Thornton <art27@cantab.net>
modules/markup/markdown/markdown.go

index cac2a180faeef4a96fa9aad4ec5ec17b5351e35b..ab026dd1b85036295d30d10ec18e5e5fa746d82e 100644 (file)
@@ -87,7 +87,9 @@ func newParserContext(ctx *markup.RenderContext) parser.Context {
 func actualRender(ctx *markup.RenderContext, input io.Reader, output io.Writer) error {
        once.Do(func() {
                converter = goldmark.New(
-                       goldmark.WithExtensions(extension.Table,
+                       goldmark.WithExtensions(
+                               extension.NewTable(
+                                       extension.WithTableCellAlignMethod(extension.TableCellAlignAttribute)),
                                extension.Strikethrough,
                                extension.TaskList,
                                extension.DefinitionList,