a link to https://example.com.
@@ -33,7 +33,7 @@ var _ = Describe("links", func() {
Expect(RenderHTML(source)).To(MatchHTML(expected))
})
- It("should parse substituted URL with scheme", func() {
+ It("substituted URL with scheme", func() {
source := `:example: https://example.com
a link to <{example}>.`
@@ -44,6 +44,37 @@ a link to <{example}>.`
Expect(RenderHTML(source)).To(MatchHTML(expected))
})
+ It("substituted URL with scheme", func() {
+ source := `:example: https://example.com
+
+a link to <{example}>.`
+ expected := `
+`
+ Expect(RenderHTML(source)).To(MatchHTML(expected))
+ })
+
+ It("URL with query string", func() {
+ source := `a link to https://example.com?foo=bar&lang=en[].`
+ expected := `
+`
+ Expect(RenderHTML(source)).To(MatchHTML(expected))
+ })
+
+ It("substituted bare URL with query string", func() {
+ source := `:example: https://example.com?foo=bar&lang=en
+
+a link to <{example}>.`
+ expected := `
+`
+ Expect(RenderHTML(source)).To(MatchHTML(expected))
+ })
+
Context("malformed", func() {
It("should not parse URL without scheme", func() {
@@ -55,7 +86,7 @@ a link to <{example}>.`
Expect(RenderHTML(source)).To(MatchHTML(expected))
})
- It("should parse with special character in URL", func() {
+ It("with special character in URL", func() {
source := `a link to https://example.com>[].`
expected := &types.Document{
Elements: []interface{}{
@@ -87,7 +118,7 @@ a link to <{example}>.`
Expect(ParseDocument(source)).To(MatchDocument(expected))
})
- It("should parse with opening angle bracket", func() {
+ It("with opening angle bracket", func() {
source := `a link to
-a link to https://example.com?a=1&b=2
+a link to https://example.com?a=1&b=2
`
Expect(RenderHTML(source)).To(MatchHTML(expected))
diff --git a/pkg/renderer/sgml/html5/special_character.go b/pkg/renderer/sgml/html5/special_character.go
deleted file mode 100644
index 58d51d88..00000000
--- a/pkg/renderer/sgml/html5/special_character.go
+++ /dev/null
@@ -1,5 +0,0 @@
-package html5
-
-const (
- specialCharacterTmpl = `{{ specialCharacter .Name }}`
-)
diff --git a/pkg/renderer/sgml/html5/string_test.go b/pkg/renderer/sgml/html5/string_test.go
index 78cf393c..8c6da786 100644
--- a/pkg/renderer/sgml/html5/string_test.go
+++ b/pkg/renderer/sgml/html5/string_test.go
@@ -134,4 +134,13 @@ var _ = Describe("strings", func() {
"