MCPcopy
hub / github.com/russross/blackfriday / leftAngle

Function leftAngle

inline.go:630–658  ·  view source on GitHub ↗

'<' when tags or autolinks are allowed

(p *Markdown, data []byte, offset int)

Source from the content-addressed store, hash-verified

628
629// '<' when tags or autolinks are allowed
630func leftAngle(p *Markdown, data []byte, offset int) (int, *Node) {
631 data = data[offset:]
632 altype, end := tagLength(data)
633 if size := p.inlineHTMLComment(data); size > 0 {
634 end = size
635 }
636 if end > 2 {
637 if altype != notAutolink {
638 var uLink bytes.Buffer
639 unescapeText(&uLink, data[1:end+1-2])
640 if uLink.Len() > 0 {
641 link := uLink.Bytes()
642 node := NewNode(Link)
643 node.Destination = link
644 if altype == emailAutolink {
645 node.Destination = append([]byte("mailto:"), link...)
646 }
647 node.AppendChild(text(stripMailto(link)))
648 return end, node
649 }
650 } else {
651 htmlTag := NewNode(HTMLSpan)
652 htmlTag.Literal = data[:end]
653 return end, htmlTag
654 }
655 }
656
657 return end, nil
658}
659
660// '\\' backslash escape
661var escapeChars = []byte("\\`*_{}[]()#+-.!:|&<>~")

Callers

nothing calls this directly

Calls 7

AppendChildMethod · 0.95
tagLengthFunction · 0.85
unescapeTextFunction · 0.85
NewNodeFunction · 0.85
textFunction · 0.85
stripMailtoFunction · 0.85
inlineHTMLCommentMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…