Source File
segment.go
Belonging Package
github.com/yuin/goldmark/text
func ( *Segment) ( []byte) Segment {
:= [.Start:.Stop]
:= util.TrimRightSpaceLength()
if == len() {
return NewSegment(.Start, .Start)
}
return NewSegmentPadding(.Start, .Stop-, .Padding)
}
func ( *Segment) ( []byte) Segment {
:= [.Start:.Stop]
:= util.TrimLeftSpaceLength()
return NewSegment(.Start+, .Stop)
}
func ( *Segment) ( int, []byte) Segment {
:= .Padding
for ; > 0; -- {
if == 0 {
break
}
--
}
if == 0 {
return NewSegmentPadding(.Start, .Stop, )
}
:= [.Start:.Stop]
:= .Start
for , := range {
if >= .Stop-1 || <= 0 {
break
}
if == ' ' {
--
} else if == '\t' {
-= 4
} else {
break
}
++
}
if < 0 {
= * -1
}
return NewSegmentPadding(, .Stop, )
}
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |