Skip to content
Permalink
Browse files

markdown: change isNumber to report negatively on empty input (#46)

This change fixes an edge case where an escaped period after a link
did not get get unescaped. Escaping the period in that context is not
necessary, so it's helpful to unescape it and produce cleaner output.
  • Loading branch information...
tianon authored and dmitshur committed Mar 11, 2019
1 parent 0ad3159 commit b3016f853336a9ec856ab8d75a7ca672ca3b056c
Showing with 7 additions and 1 deletion.
  1. +1 −1 markdown/main.go
  2. +3 −0 markdown/testdata/url.golden.md
  3. +3 −0 markdown/testdata/url.in.md
@@ -346,7 +346,7 @@ func isNumber(data []byte) bool {
return false
}
}
return true
return len(data) > 0
}

func needsEscaping(text []byte, lastNormalText string) bool {
@@ -0,0 +1,3 @@
Lorem [ipsum](https://www.example.com).

Lorem [ipsum](https://www.example.com).
@@ -0,0 +1,3 @@
Lorem [ipsum](https://www.example.com).

Lorem [ipsum](https://www.example.com)\.

0 comments on commit b3016f8

Please sign in to comment.
You can’t perform that action at this time.