This commit is contained in:
Russ Ross 2011-05-31 11:49:49 -06:00
parent df64ec5d0f
commit f3386eb849
3 changed files with 20 additions and 20 deletions

View File

@ -754,7 +754,7 @@ func blockCode(out *bytes.Buffer, rndr *render, data []byte) int {
n++
}
if n > 0 {
work.Truncate(len(workbytes)-n)
work.Truncate(len(workbytes) - n)
}
work.WriteByte('\n')

View File

@ -537,13 +537,13 @@ func inlineEntity(out *bytes.Buffer, rndr *render, data []byte, offset int) int
func inlineAutoLink(out *bytes.Buffer, rndr *render, data []byte, offset int) int {
// quick check to rule out most false hits on ':'
if len(data) < offset + 3 || data[offset+1] != '/' || data[offset+2] != '/' {
if len(data) < offset+3 || data[offset+1] != '/' || data[offset+2] != '/' {
return 0
}
// scan backward for a word boundary
rewind := 0
for offset - rewind > 0 && rewind <= 7 && !isspace(data[offset-rewind-1]) && !isspace(data[offset-rewind-1]) {
for offset-rewind > 0 && rewind <= 7 && !isspace(data[offset-rewind-1]) && !isspace(data[offset-rewind-1]) {
rewind++
}
if rewind > 6 { // longest supported protocol is "mailto" which has 6 letters