File: elem_quote.go

package info (click to toggle)
golang-github-johanneskaufmann-html-to-markdown 2.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,084 kB
  • sloc: makefile: 3
file content (23 lines) | stat: -rw-r--r-- 298 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package escape

func IsBlockQuote(chars []byte, index int) int {
	if chars[index] != '>' {
		return -1
	}

	for i := index - 1; i >= 0; i-- {
		if chars[i] == '\n' {
			break
		}
		if chars[i] == placeholderByte {
			continue
		}
		if chars[i] == ' ' {
			continue
		}

		return -1
	}

	return 1
}