markup/goldmark: Update the CJK extension to allow specifying line break styles

This commit follows https://github.com/yuin/goldmark/pull/411
This commit is contained in:
OMOTO Tsukasa
2023-10-29 18:13:56 +09:00
committed by GitHub
parent 3f64b5a3de
commit db14238ba3
5 changed files with 69 additions and 7 deletions

View File

@@ -140,7 +140,11 @@ func newMarkdown(pcfg converter.ProviderConfig) goldmark.Markdown {
if cfg.Extensions.CJK.Enable {
opts := []extension.CJKOption{}
if cfg.Extensions.CJK.EastAsianLineBreaks {
opts = append(opts, extension.WithEastAsianLineBreaks())
if cfg.Extensions.CJK.EastAsianLineBreaksStyle == "css3draft" {
opts = append(opts, extension.WithEastAsianLineBreaks(extension.EastAsianLineBreaksCSS3Draft))
} else {
opts = append(opts, extension.WithEastAsianLineBreaks())
}
}
if cfg.Extensions.CJK.EscapedSpace {