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

Method uliPrefix

block.go:1068–1083  ·  view source on GitHub ↗

returns unordered list item prefix

(data []byte)

Source from the content-addressed store, hash-verified

1066
1067// returns unordered list item prefix
1068func (p *Markdown) uliPrefix(data []byte) int {
1069 i := 0
1070 // start with up to 3 spaces
1071 for i < len(data) && i < 3 && data[i] == ' ' {
1072 i++
1073 }
1074 if i >= len(data)-1 {
1075 return 0
1076 }
1077 // need one of {'*', '+', '-'} followed by a space or a tab
1078 if (data[i] != '*' && data[i] != '+' && data[i] != '-') ||
1079 (data[i+1] != ' ' && data[i+1] != '\t') {
1080 return 0
1081 }
1082 return i + 2
1083}
1084
1085// returns ordered list item prefix
1086func (p *Markdown) oliPrefix(data []byte) int {

Callers 4

blockMethod · 0.95
listTypeChangedMethod · 0.95
listItemMethod · 0.95
paragraphMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected