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

Method renderParagraph

block.go:1428–1451  ·  view source on GitHub ↗

render a single paragraph that has already been parsed out

(data []byte)

Source from the content-addressed store, hash-verified

1426
1427// render a single paragraph that has already been parsed out
1428func (p *Markdown) renderParagraph(data []byte) {
1429 if len(data) == 0 {
1430 return
1431 }
1432
1433 // trim leading spaces
1434 beg := 0
1435 for data[beg] == ' ' {
1436 beg++
1437 }
1438
1439 end := len(data)
1440 // trim trailing newline
1441 if data[len(data)-1] == '\n' {
1442 end--
1443 }
1444
1445 // trim trailing spaces
1446 for end > beg && data[end-1] == ' ' {
1447 end--
1448 }
1449
1450 p.addBlock(Paragraph, data[beg:end])
1451}
1452
1453func (p *Markdown) paragraph(data []byte) int {
1454 // prev: index of 1st char of previous line

Callers 1

paragraphMethod · 0.95

Calls 1

addBlockMethod · 0.95

Tested by

no test coverage detected