Add option to disable AutoLink parsing

This commit is contained in:
Niklas Fasching 2018-12-02 23:53:31 +01:00
parent 592be07cfd
commit 3c2e9ed204
2 changed files with 3 additions and 1 deletions

View file

@ -126,7 +126,7 @@ func (d *Document) parseFootnoteReference(input string, start int) (int, Node) {
}
func (d *Document) parseAutoLink(input string, start int) (int, int, Node) {
if len(input[start:]) < 3 || input[start+1] != '/' || input[start+2] != '/' {
if !d.AutoLink || len(input[start:]) < 3 || input[start+1] != '/' || input[start+2] != '/' {
return 0, 0, nil
}
protocolStart, protocol := start-1, ""