diff --git a/extension/cjk.go b/extension/cjk.go index 9cf5381..aabafad 100644 --- a/extension/cjk.go +++ b/extension/cjk.go @@ -13,12 +13,14 @@ type CJKOption func(*cjk) type EastAsianLineBreaksStyle int const ( + // EastAsianLineBreaksStyleSimple is a style where soft line breaks are ignored + // if both sides of the break are east asian wide characters. EastAsianLineBreaksStyleSimple EastAsianLineBreaksStyle = iota + // EastAsianLineBreaksCSS3Draft is a style where soft line breaks are ignored + // even if only one side of the break is an east asian wide character. EastAsianLineBreaksCSS3Draft ) -type EastAsianLineBreaksFunction func() - // WithEastAsianLineBreaks is a functional option that indicates whether softline breaks // between east asian wide characters should be ignored. func WithEastAsianLineBreaks(style ...EastAsianLineBreaksStyle) CJKOption { diff --git a/renderer/html/html.go b/renderer/html/html.go index e2629cc..2da6362 100644 --- a/renderer/html/html.go +++ b/renderer/html/html.go @@ -103,10 +103,15 @@ func WithHardWraps() interface { // EastAsianLineBreaks is an option name used in WithEastAsianLineBreaks. const optEastAsianLineBreaks renderer.OptionName = "EastAsianLineBreaks" +// A EastAsianLineBreaksStyle is a style of east asian line breaks. type EastAsianLineBreaksStyle int const ( + // EastAsianLineBreaksStyleSimple is a style where soft line breaks are ignored + // if both sides of the break are east asian wide characters. EastAsianLineBreaksStyleSimple EastAsianLineBreaksStyle = iota + // EastAsianLineBreaksCSS3Draft is a style where soft line breaks are ignored + // even if only one side of the break is an east asian wide character. EastAsianLineBreaksCSS3Draft )