summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattermost/mattermost-server/v5/shared/markdown/paragraph.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2023-08-05 20:43:19 +0200
committerGitHub <noreply@github.com>2023-08-05 20:43:19 +0200
commit56e7bd01ca09ad52b0c4f48f146a20a4f1b78696 (patch)
treeb1355645342667209263cbd355dc0b4254f1e8fe /vendor/github.com/mattermost/mattermost-server/v5/shared/markdown/paragraph.go
parent9459495484d6e06a3d46de64fccd8d06f7ccc72c (diff)
downloadmatterbridge-msglm-56e7bd01ca09ad52b0c4f48f146a20a4f1b78696.tar.gz
matterbridge-msglm-56e7bd01ca09ad52b0c4f48f146a20a4f1b78696.tar.bz2
matterbridge-msglm-56e7bd01ca09ad52b0c4f48f146a20a4f1b78696.zip
Update dependencies and remove old matterclient lib (#2067)HEADmaster
Diffstat (limited to 'vendor/github.com/mattermost/mattermost-server/v5/shared/markdown/paragraph.go')
-rw-r--r--vendor/github.com/mattermost/mattermost-server/v5/shared/markdown/paragraph.go71
1 files changed, 0 insertions, 71 deletions
diff --git a/vendor/github.com/mattermost/mattermost-server/v5/shared/markdown/paragraph.go b/vendor/github.com/mattermost/mattermost-server/v5/shared/markdown/paragraph.go
deleted file mode 100644
index aef01b5e..00000000
--- a/vendor/github.com/mattermost/mattermost-server/v5/shared/markdown/paragraph.go
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
-// See LICENSE.txt for license information.
-
-package markdown
-
-import (
- "strings"
-)
-
-type Paragraph struct {
- blockBase
- markdown string
-
- Text []Range
- ReferenceDefinitions []*ReferenceDefinition
-}
-
-func (b *Paragraph) ParseInlines(referenceDefinitions []*ReferenceDefinition) []Inline {
- return ParseInlines(b.markdown, b.Text, referenceDefinitions)
-}
-
-func (b *Paragraph) Continuation(indentation int, r Range) *continuation {
- s := b.markdown[r.Position:r.End]
- if strings.TrimSpace(s) == "" {
- return nil
- }
- return &continuation{
- Indentation: indentation,
- Remaining: r,
- }
-}
-
-func (b *Paragraph) Close() {
- for {
- for i := 0; i < len(b.Text); i++ {
- b.Text[i] = trimLeftSpace(b.markdown, b.Text[i])
- if b.Text[i].Position < b.Text[i].End {
- break
- }
- }
-
- if len(b.Text) == 0 || b.Text[0].Position < b.Text[0].End && b.markdown[b.Text[0].Position] != '[' {
- break
- }
-
- definition, remaining := parseReferenceDefinition(b.markdown, b.Text)
- if definition == nil {
- break
- }
- b.ReferenceDefinitions = append(b.ReferenceDefinitions, definition)
- b.Text = remaining
- }
-
- for i := len(b.Text) - 1; i >= 0; i-- {
- b.Text[i] = trimRightSpace(b.markdown, b.Text[i])
- if b.Text[i].Position < b.Text[i].End {
- break
- }
- }
-}
-
-func newParagraph(markdown string, r Range) *Paragraph {
- s := markdown[r.Position:r.End]
- if strings.TrimSpace(s) == "" {
- return nil
- }
- return &Paragraph{
- markdown: markdown,
- Text: []Range{r},
- }
-}