mirror of
https://github.com/yuin/goldmark
synced 2025-03-04 23:04:52 +00:00
fix: Make softlinebreak public
This commit is contained in:
parent
90c46e0829
commit
18790744cb
1 changed files with 2 additions and 2 deletions
|
|
@ -116,7 +116,7 @@ const (
|
||||||
EastAsianLineBreaksCSS3Draft
|
EastAsianLineBreaksCSS3Draft
|
||||||
)
|
)
|
||||||
|
|
||||||
func (b EastAsianLineBreaks) softLineBreak(thisLastRune rune, siblingFirstRune rune) bool {
|
func (b EastAsianLineBreaks) SoftLineBreak(thisLastRune rune, siblingFirstRune rune) bool {
|
||||||
switch b {
|
switch b {
|
||||||
case EastAsianLineBreaksNone:
|
case EastAsianLineBreaksNone:
|
||||||
return false
|
return false
|
||||||
|
|
@ -740,7 +740,7 @@ func (r *Renderer) renderText(w util.BufWriter, source []byte, node ast.Node, en
|
||||||
if siblingText := sibling.(*ast.Text).Text(source); len(siblingText) != 0 {
|
if siblingText := sibling.(*ast.Text).Text(source); len(siblingText) != 0 {
|
||||||
thisLastRune := util.ToRune(value, len(value)-1)
|
thisLastRune := util.ToRune(value, len(value)-1)
|
||||||
siblingFirstRune, _ := utf8.DecodeRune(siblingText)
|
siblingFirstRune, _ := utf8.DecodeRune(siblingText)
|
||||||
if r.EastAsianLineBreaks.softLineBreak(thisLastRune, siblingFirstRune) {
|
if r.EastAsianLineBreaks.SoftLineBreak(thisLastRune, siblingFirstRune) {
|
||||||
_ = w.WriteByte('\n')
|
_ = w.WriteByte('\n')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue