newline preceded by two spaces becomes
(p *Markdown, data []byte, offset int)
| 176 | |
| 177 | // newline preceded by two spaces becomes <br> |
| 178 | func 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 |
| 194 | func lineBreak(p *Markdown, data []byte, offset int) (int, *Node) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…