* perf: apply perfpsrint linter (#33967) * perf: apply perfpsrint linter * further simplifications * improved TestParseHashtags coverage * more simplifications * simplify renderBlockHTML further --------- Co-authored-by: Jesse Hallam <jesse@mattermost.com> * Fixed a bad merge --------- Co-authored-by: Catena cyber <35799796+catenacyber@users.noreply.github.com> Co-authored-by: Jesse Hallam <jesse@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
183e6c4a07
Коммит
b3d6c0c564
@@ -3,6 +3,8 @@
|
||||
|
||||
package markdown
|
||||
|
||||
import "strings"
|
||||
|
||||
type ReferenceDefinition struct {
|
||||
RawDestination Range
|
||||
|
||||
@@ -24,10 +26,11 @@ func (d *ReferenceDefinition) Title() string {
|
||||
}
|
||||
|
||||
func parseReferenceDefinition(markdown string, ranges []Range) (*ReferenceDefinition, []Range) {
|
||||
raw := ""
|
||||
var rawSb strings.Builder
|
||||
for _, r := range ranges {
|
||||
raw += markdown[r.Position:r.End]
|
||||
rawSb.WriteString(markdown[r.Position:r.End])
|
||||
}
|
||||
raw := rawSb.String()
|
||||
|
||||
label, next, ok := parseLinkLabel(raw, 0)
|
||||
if !ok {
|
||||
|
||||
Ссылка в новой задаче
Block a user