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

Function maybeLineBreak

inline.go:178–191  ·  view source on GitHub ↗

newline preceded by two spaces becomes

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

Source from the content-addressed store, hash-verified

176
177// newline preceded by two spaces becomes <br>
178func maybeLineBreak(p *Markdown, data []byte, offset int) (int, *Node) {
179 origOffset := offset
180 for offset < len(data) && data[offset] == ' ' {
181 offset++
182 }
183
184 if offset < len(data) && data[offset] == '\n' {
185 if offset-origOffset >= 2 {
186 return offset - origOffset + 1, NewNode(Hardbreak)
187 }
188 return offset - origOffset, nil
189 }
190 return 0, nil
191}
192
193// newline without two spaces works when HardLineBreak is enabled
194func lineBreak(p *Markdown, data []byte, offset int) (int, *Node) {

Callers

nothing calls this directly

Calls 1

NewNodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…