mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-08-02 09:13:44 +00:00
Update vendor for next release (#1343)
This commit is contained in:
7
vendor/github.com/mattermost/mattermost-server/v5/utils/markdown/lines.go
generated
vendored
7
vendor/github.com/mattermost/mattermost-server/v5/utils/markdown/lines.go
generated
vendored
@@ -3,13 +3,16 @@
|
||||
|
||||
package markdown
|
||||
|
||||
import "strings"
|
||||
|
||||
type Line struct {
|
||||
Range
|
||||
}
|
||||
|
||||
func ParseLines(markdown string) (lines []Line) {
|
||||
func ParseLines(markdown string) []Line {
|
||||
lineStartPosition := 0
|
||||
isAfterCarriageReturn := false
|
||||
lines := make([]Line, 0, strings.Count(markdown, "\n"))
|
||||
for position, r := range markdown {
|
||||
if r == '\n' {
|
||||
lines = append(lines, Line{Range{lineStartPosition, position + 1}})
|
||||
@@ -23,5 +26,5 @@ func ParseLines(markdown string) (lines []Line) {
|
||||
if lineStartPosition < len(markdown) {
|
||||
lines = append(lines, Line{Range{lineStartPosition, len(markdown)}})
|
||||
}
|
||||
return
|
||||
return lines
|
||||
}
|
||||
|
Reference in New Issue
Block a user