From 9fe1ecf6050bbebfe4096e5c41a1e711dd16190d Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sat, 6 Aug 2022 01:16:08 +0700 Subject: all: rewrite unit tests for inlineParser using test.Data Using string literal for testing string input that may contains backtick or double quote make the test code become unreadable and hard to modify. The test.Data help this by moving the input and expected output into a file that can we write as is. --- element.go | 14 - inline_parser.go | 6 +- inline_parser_test.go | 814 ++------------------------ testdata/inline_parser/inline_parser_test.txt | 247 ++++++++ 4 files changed, 294 insertions(+), 787 deletions(-) create mode 100644 testdata/inline_parser/inline_parser_test.txt diff --git a/element.go b/element.go index 46d045d..a558055 100644 --- a/element.go +++ b/element.go @@ -256,20 +256,6 @@ func (el *element) backTrimSpace() { el.raw = el.raw[:x+1] } -func (el *element) debug(n int) { - var x int - for x = 0; x < n; x++ { - fmt.Printf("\t") - } - fmt.Printf("el: {kind:%-3d style:%-3d raw:%s}\n", el.kind, el.style, el.raw) - if el.child != nil { - el.child.debug(n + 1) - } - if el.next != nil { - el.next.debug(n) - } -} - func (el *element) lastSuccessor() (last *element) { if el.child == nil { return nil diff --git a/inline_parser.go b/inline_parser.go index 62287bf..881374e 100644 --- a/inline_parser.go +++ b/inline_parser.go @@ -617,12 +617,16 @@ func (pi *inlineParser) parseFormat(kind int, style int64) bool { el *element idx int + prevc byte + nextc byte hasEnd bool ) _, idx = indexByteUnescape(raw, pi.c) for idx >= 0 { - var prevc, nextc byte + prevc = 0 + nextc = 0 + if idx > 0 { prevc = raw[idx-1] } diff --git a/inline_parser_test.go b/inline_parser_test.go index c26b209..62c4f74 100644 --- a/inline_parser_test.go +++ b/inline_parser_test.go @@ -5,804 +5,78 @@ package asciidoctor import ( "bytes" + "fmt" "testing" - "github.com/shuLhan/share/lib/debug" "github.com/shuLhan/share/lib/test" ) -func TestInlineParser_do(t *testing.T) { - type testCase struct { - content string - exp string - } - - var _testDoc = &Document{ - anchors: make(map[string]*anchor), - titleID: make(map[string]string), - } - - var cases = []testCase{{ - content: "*A _B `C_ D` E*", - exp: "A B C D E", - }, { - content: "A * B *, C *=*.", - exp: "A * B , C *=.", - }, { - content: "*A _B `C D* E_ F.", - exp: "A B `C D E F.", - }} - +func TestInlineParser(t *testing.T) { var ( - buf bytes.Buffer - c testCase - container *element - got string - ) - for _, c = range cases { - buf.Reset() - - container = parseInlineMarkup(_testDoc, []byte(c.content)) - container.toHTML(_testDoc, &buf) - - if debug.Value > 0 { - container.debug(0) - } - - got = buf.String() - test.Assert(t, c.content, c.exp, got) - } -} - -func TestInlineParser_parseAttrRef(t *testing.T) { - type testCase struct { - content string - exp string - } - - var _testDoc = &Document{ - Attributes: map[string]string{ - `x`: `https://kilabit.info`, - }, - } - - var cases = []testCase{{ - content: `A {x}[*B*] C`, - exp: `A B C`, - }, { - content: `A {x }[*B*] C`, - exp: `A B C`, - }, { - content: `A {x }*B* C`, - exp: `A https://kilabit.info*B* C`, - }, { - content: `A {y }*B* C`, - exp: `A {y }B C`, - }} - - var ( - buf bytes.Buffer - c testCase - container *element - got string - ) - - for _, c = range cases { - buf.Reset() - - container = parseInlineMarkup(_testDoc, []byte(c.content)) - container.toHTML(_testDoc, &buf) - - if debug.Value > 0 { - container.debug(0) - } - - got = buf.String() - test.Assert(t, c.content, c.exp, got) - } -} - -func TestInlineParser_parseCrossReference(t *testing.T) { - type testCase struct { - content string - exp string - } - - var _testDoc = &Document{ - anchors: map[string]*anchor{ - `x`: &anchor{ - label: `X y`, + _testDoc = &Document{ + Attributes: map[string]string{ + `x`: `https://kilabit.info`, }, - }, - titleID: map[string]string{ - `X y`: `x`, - }, - } - - var cases = []testCase{{ - content: `A <>`, - exp: `A X y`, - }, { - content: `A <>`, - exp: `A Label`, - }, { - content: `A <>`, - exp: `A X y`, - }, { - content: `A <>`, - exp: `A Label`, - }} - - var ( - buf bytes.Buffer - c testCase - container *element - got string - ) - for _, c = range cases { - buf.Reset() - - container = parseInlineMarkup(_testDoc, []byte(c.content)) - container.toHTML(_testDoc, &buf) - - if debug.Value > 0 { - container.debug(0) - } - - got = buf.String() - test.Assert(t, c.content, c.exp, got) - } -} - -func TestInlineParser_parseFormat(t *testing.T) { - type testCase struct { - content string - exp string - } - - var _testDoc = &Document{ - anchors: make(map[string]*anchor), - titleID: make(map[string]string), - } - - var cases = []testCase{{ - content: `_A_B`, - exp: `_A_B`, - }, { - content: `_A_ B`, - exp: `A B`, - }, { - content: `_A _B`, - exp: `_A _B`, - }, { - content: `*A*B`, - exp: `*A*B`, - }, { - content: `*A* B`, - exp: `A B`, - }, { - content: `*A *B`, - exp: `*A *B`, - }, { - content: "`A`B", - exp: "`A`B", - }, { - content: "`A` B", - exp: `A B`, - }, { - content: "`A `B", - exp: "`A `B", - }, { - content: "A `/**/` *B*", - exp: "A // B", - }} - - var ( - buf bytes.Buffer - c testCase - container *element - got string - ) - - for _, c = range cases { - buf.Reset() - - container = parseInlineMarkup(_testDoc, []byte(c.content)) - container.toHTML(_testDoc, &buf) - - if debug.Value > 0 { - container.debug(0) - } - - got = buf.String() - test.Assert(t, c.content, c.exp, got) - } -} - -func TestInlineParser_parseFormatUnconstrained(t *testing.T) { - type testCase struct { - content string - exp string - } - - var _testDoc = &Document{ - anchors: make(map[string]*anchor), - titleID: make(map[string]string), - } - - var cases = []testCase{{ - content: `__A__B`, - exp: `AB`, - }, { - content: `__A *B*__`, - exp: `A B`, - }, { - content: `__A _B_ C__`, - exp: `A B C`, - }, { - content: `__A B_ C__`, - exp: `A B_ C`, - }, { - content: `__A *B*_`, - exp: `_A B`, - }, { - content: `_A *B*__`, - exp: `A B_`, - }} - - var ( - buf bytes.Buffer - c testCase - container *element - got string - ) - - for _, c = range cases { - buf.Reset() - - container = parseInlineMarkup(_testDoc, []byte(c.content)) - container.toHTML(_testDoc, &buf) - - if debug.Value > 0 { - container.debug(0) - } - - got = buf.String() - test.Assert(t, c.content, c.exp, got) - } -} - -func TestInlineParser_parseInlineID(t *testing.T) { - type testCase struct { - content string - exp string - isForToC bool - } - - var _testDoc = &Document{ - anchors: make(map[string]*anchor), - titleID: make(map[string]string), - } - - var cases = []testCase{{ - content: `[[A]] B`, - exp: ` B`, - }, { - content: `[[A]] B`, - exp: ` B`, - isForToC: true, - }, { - content: `[[A] B`, - exp: `[[A] B`, - }, { - content: `[A]] B`, - exp: `[A]] B`, - }, { - content: `[[A ]] B`, - exp: `[[A ]] B`, - }, { - content: `[[ A]] B`, - exp: `[[ A]] B`, - }, { - content: `[[A B]] C`, - exp: `[[A B]] C`, - }} - - var ( - buf bytes.Buffer - c testCase - container *element - got string - ) - - for _, c = range cases { - buf.Reset() - - container = parseInlineMarkup(_testDoc, []byte(c.content)) - _testDoc.isForToC = c.isForToC - container.toHTML(_testDoc, &buf) - _testDoc.isForToC = false - - if debug.Value > 0 { - container.debug(0) - } - - got = buf.String() - test.Assert(t, c.content, c.exp, got) - } -} - -func TestInlineParser_parseInlineIDShort(t *testing.T) { - type testCase struct { - content string - exp string - } - - var _testDoc = &Document{ - anchors: make(map[string]*anchor), - titleID: make(map[string]string), - } - - var cases = []testCase{{ - content: `[#A]#B#`, - exp: `B`, - }, { - content: `[#A]#B`, - exp: `[#A]#B`, - }, { - content: `[#A]B#`, - exp: `[#A]B#`, - }, { - content: `[#A ]#B#`, - exp: `[#A ]#B#`, - }, { - content: `[# A]# B#`, - exp: `[# A]# B#`, - }, { - content: `[#A B]# C#`, - exp: `[#A B]# C#`, - }} - - var ( - buf bytes.Buffer - c testCase - container *element - got string - ) - - for _, c = range cases { - buf.Reset() - - container = parseInlineMarkup(_testDoc, []byte(c.content)) - container.toHTML(_testDoc, &buf) - - if debug.Value > 0 { - container.debug(0) - } - - got = buf.String() - test.Assert(t, c.content, c.exp, got) - } -} - -func TestInlineParser_parseInlineImage(t *testing.T) { - type testCase struct { - content string - exp string - } - - var _testDoc = &Document{ - anchors: make(map[string]*anchor), - titleID: make(map[string]string), - } - - var cases = []testCase{{ - content: `image:https://upload.wikimedia.org/wikipedia/commons/3/35/Tux.svg[Linux,25,35]`, - exp: `Linux`, - }, { - content: `image:linux.png[Linux,150,150,float="right"] -You can find Linux everywhere these days!`, - exp: `Linux -You can find Linux everywhere these days!`, - }, { - content: `image:sunset.jpg[Sunset,150,150,role="right"] What a beautiful sunset!`, - exp: `Sunset What a beautiful sunset!`, - }, { - content: `image:sunset.jpg[Sunset] -image:linux.png[2]`, - exp: `Sunset -2`, - }} - - var ( - buf bytes.Buffer - c testCase - container *element - got string - ) - - for _, c = range cases { - buf.Reset() - - container = parseInlineMarkup(_testDoc, []byte(c.content)) - container.toHTML(_testDoc, &buf) - - if debug.Value > 0 { - container.debug(0) - } - - got = buf.String() - test.Assert(t, c.content, c.exp, got) - } -} - -func TestInlineParser_parsePassthrough(t *testing.T) { - type testCase struct { - content string - exp string - } - - var _testDoc = &Document{ - anchors: make(map[string]*anchor), - titleID: make(map[string]string), - } - - var cases = []testCase{{ - content: "`+__A *B*__+`", - exp: "__A *B*__", - }, { - content: `\+__A *B*__+`, - exp: `+A B+`, - }, { - content: `+__A *B*__\+`, - exp: `+A B+`, - }, { - content: `X+__A *B*__+`, - exp: `X+A B+`, - }, { - content: `+__A *B*__+X`, - exp: `+A B+X`, - }} - - var ( - buf bytes.Buffer - c testCase - container *element - got string - ) - - for _, c = range cases { - buf.Reset() - - container = parseInlineMarkup(_testDoc, []byte(c.content)) - container.toHTML(_testDoc, &buf) - - if debug.Value > 0 { - container.debug(0) - } - - got = buf.String() - test.Assert(t, c.content, c.exp, got) - } -} - -func TestInlineParser_parsePassthroughDouble(t *testing.T) { - type testCase struct { - content string - exp string - } - - var _testDoc = &Document{ - anchors: make(map[string]*anchor), - titleID: make(map[string]string), - } - - var cases = []testCase{{ - content: "`++__A *B*__++`", - exp: "__A *B*__", - }, { - content: "`++__A *B*__+`", - exp: "A B+", - }, { - content: `\++__A *B*__++`, - exp: `+__A *B*__+`, - }, { - content: `+\+__A *B*__++`, - exp: `+__A *B*__+`, - }, { - content: `++__A *B*__\++`, - exp: `A B++`, - }, { - content: `++__A *B*__+\+`, - exp: `A B++`, - }, { - content: `++ A ++`, - exp: ` A `, - }} - - var ( - buf bytes.Buffer - c testCase - container *element - got string - ) - - for _, c = range cases { - buf.Reset() - - container = parseInlineMarkup(_testDoc, []byte(c.content)) - container.toHTML(_testDoc, &buf) - - if debug.Value > 0 { - container.debug(0) - } - - got = buf.String() - test.Assert(t, c.content, c.exp, got) - } -} - -func TestInlineParser_parsePassthroughTriple(t *testing.T) { - type testCase struct { - content string - exp string - } - - var _testDoc = &Document{ - anchors: make(map[string]*anchor), - titleID: make(map[string]string), - } - - var cases = []testCase{{ - content: `+++__A *B*__+++`, - exp: `__A *B*__`, - }, { - content: `+++__A *B*__++`, - exp: `+__A *B*__`, - }, { - content: `\+++__A *B*__+++`, - exp: `+__A *B*__+`, - }, { - content: `+\++__A *B*__+++`, - exp: `+A B+`, - }, { - content: `++\+__A *B*__+++`, - exp: `+__A *B*__+`, - }, { - content: `+++__A *B*__\+++`, - exp: `+__A *B*__+`, - }, { - content: `+++__A *B*__+\++`, - exp: `__A *B*__++`, - }, { - content: `+++__A *B*__++\+`, - exp: `+__A *B*__+`, - }, { - content: `+++ A +++`, - exp: ` A `, - }} - var ( - buf bytes.Buffer - c testCase - container *element - got string - ) - - for _, c = range cases { - buf.Reset() - - container = parseInlineMarkup(_testDoc, []byte(c.content)) - container.toHTML(_testDoc, &buf) - - if debug.Value > 0 { - container.debug(0) + anchors: map[string]*anchor{ + `x`: &anchor{ + label: `X y`, + }, + }, + titleID: map[string]string{ + `X y`: `x`, + }, } - got = buf.String() - test.Assert(t, c.content, c.exp, got) - } -} - -func TestInlineParser_parseQuote(t *testing.T) { - type testCase struct { - content string - exp string - } - - var _testDoc = &Document{ - anchors: make(map[string]*anchor), - titleID: make(map[string]string), - } - - var cases = []testCase{{ - content: "\"`A double quote without end.", - exp: "\"`A double quote without end.", - }, { - content: "\"` A double quote around space `\"", - exp: "\"` A double quote around space `\"", - }, { - content: "\"`A double quote`\"", - exp: "“A double quote”", - }, { - content: "\"`Escaped double quote\\`\"", - exp: "\"`Escaped double quote`\"", - }, { - content: "'`A single quote without end.", - exp: "'`A single quote without end.", - }, { - content: "'` A single quote around space `'", - exp: "'` A single quote around space ’", - }, { - content: "\"`A single quote`\"", - exp: "“A single quote”", - }, { - content: "\"`Escaped single quote\\`\"", - exp: "\"`Escaped single quote`\"", - }} - - var ( buf bytes.Buffer - c testCase + tdata *test.Data container *element - got string + err error + name string + lineNum string + vbytes []byte + exps [][]byte + lines [][]byte + x int ) - for _, c = range cases { - buf.Reset() - - container = parseInlineMarkup(_testDoc, []byte(c.content)) - container.toHTML(_testDoc, &buf) - - if debug.Value > 0 { - container.debug(0) - } - got = buf.String() - test.Assert(t, c.content, c.exp, got) + tdata, err = test.LoadData(`testdata/inline_parser/inline_parser_test.txt`) + if err != nil { + t.Fatal(err) } -} -func TestInlineParser_parseSubscsript(t *testing.T) { - type testCase struct { - content string - exp string - } - - var _testDoc = &Document{ - anchors: make(map[string]*anchor), - titleID: make(map[string]string), - } + for name, vbytes = range tdata.Input { + t.Run(name, func(t *testing.T) { + lines = bytes.Split(vbytes, []byte("\n")) + exps = bytes.Split(tdata.Output[name], []byte("\n")) - var cases = []testCase{{ - content: "A~B~C", - exp: "ABC", - }, { - content: "A~B ~C", - exp: "A~B ~C", - }, { - content: "A~ B~C", - exp: "A~ B~C", - }, { - content: `A\~B~C`, - exp: "A~B~C", - }, { - content: `A~B\~C`, - exp: "A~B~C", - }} + for x, vbytes = range lines { + buf.Reset() + container = parseInlineMarkup(_testDoc, vbytes) + container.toHTML(_testDoc, &buf) - var ( - buf bytes.Buffer - c testCase - container *element - got string - ) - - for _, c = range cases { - buf.Reset() - - container = parseInlineMarkup(_testDoc, []byte(c.content)) - container.toHTML(_testDoc, &buf) - - if debug.Value > 0 { - container.debug(0) - } - - got = buf.String() - test.Assert(t, c.content, c.exp, got) - } -} - -func TestInlineParser_parseSuperscript(t *testing.T) { - type testCase struct { - content string - exp string - } - - var _testDoc = &Document{ - anchors: make(map[string]*anchor), - titleID: make(map[string]string), - } - - var cases = []testCase{{ - content: `A^B^C`, - exp: `ABC`, - }, { - content: `A^B ^C`, - exp: `A^B ^C`, - }, { - content: `A^ B^C`, - exp: `A^ B^C`, - }, { - content: `A\^B^C`, - exp: `A^B^C`, - }, { - content: `A^B\^C`, - exp: `A^B^C`, - }} - - var ( - buf bytes.Buffer - c testCase - container *element - got string - ) - - for _, c = range cases { - buf.Reset() - - container = parseInlineMarkup(_testDoc, []byte(c.content)) - container.toHTML(_testDoc, &buf) - - if debug.Value > 0 { - container.debug(0) - } - - got = buf.String() - test.Assert(t, c.content, c.exp, got) + lineNum = fmt.Sprintf("#%d", x) + test.Assert(t, lineNum, string(exps[x]), buf.String()) + } + }) } } -func TestInlineParser_parseURL(t *testing.T) { +func TestInlineParser_parseInlineID_isForToC(t *testing.T) { type testCase struct { content string exp string } var _testDoc = &Document{ - anchors: make(map[string]*anchor), - titleID: make(map[string]string), + anchors: make(map[string]*anchor), + titleID: make(map[string]string), + isForToC: true, } var cases = []testCase{{ - content: `https://asciidoctor.org/abc`, - exp: `https://asciidoctor.org/abc`, - }, { - content: `https://asciidoctor.org.`, - exp: `https://asciidoctor.org.`, - }, { - content: `https://asciidoctor.org[Asciidoctor^,role="a,b"].`, - exp: `Asciidoctor.`, - }, { - content: `\https://example.org.`, - exp: `https://example.org.`, - }, { - content: `irc://irc.freenode.org/#fedora[Fedora IRC channel].`, - exp: `Fedora IRC channel.`, - }, { - content: `mailto:ms@kilabit.info.`, - exp: `mailto:ms@kilabit.info.`, - }, { - content: `mailto:ms@kilabit.info[Mail to me].`, - exp: `Mail to me.`, - }, { - content: `Relative file link:test.html[test.html].`, - exp: `Relative file test.html.`, - }, { - content: `link:https://kilabit.info[Kilabit^].`, - exp: `Kilabit.`, - }, { - content: `http: this is not link`, - exp: `http: this is not link`, + content: `[[A]] B`, + exp: ` B`, }} var ( @@ -818,10 +92,6 @@ func TestInlineParser_parseURL(t *testing.T) { container = parseInlineMarkup(_testDoc, []byte(c.content)) container.toHTML(_testDoc, &buf) - if debug.Value > 0 { - container.debug(0) - } - got = buf.String() test.Assert(t, c.content, c.exp, got) } diff --git a/testdata/inline_parser/inline_parser_test.txt b/testdata/inline_parser/inline_parser_test.txt new file mode 100644 index 0000000..b40465d --- /dev/null +++ b/testdata/inline_parser/inline_parser_test.txt @@ -0,0 +1,247 @@ +Various tests for inlineParser. + +>>> +*A _B `C_ D` E* +A * B *, C *=*. +*A _B `C D* E_ F. + +<<< +A B C D E +A * B , C *=. +A B `C D E F. + +>>> parseAttrRef +A {x}[*B*] C +A {x }[*B*] C +A {x }*B* C +A {y }*B* C + +<<< parseAttrRef +A B C +A B C +A https://kilabit.info*B* C +A {y }B C + +>>> parseCrossRef +A <> +A <> +A <> +A <> + +<<< parseCrossRef +A X y +A Label +A X y +A Label + +>>> parseFormat +_A_B +_A_ B +_A _B +*A*B +*A* B +*A *B +`A`B +`A` B +`A `B +A `/**/` *B* + +<<< parseFormat +_A_B +A B +_A _B +*A*B +A B +*A *B +`A`B +A B +`A `B +A // B + +>>> parseFormatUnconstrained +__A__B +__A *B*__ +__A _B_ C__ +__A B_ C__ +__A *B*_ +_A *B*__ + +<<< parseFormatUnconstrained +AB +A B +A B C +A B_ C +_A B +A B_ + +>>> parseInlineID +[[A]] B +[[A] B +[A]] B +[[A ]] B +[[ A]] B +[[A B]] C + +<<< parseInlineID + B +[[A] B +[A]] B +[[A ]] B +[[ A]] B +[[A B]] C + +>>> parseInlineIDShort +[#Q]#W# +[#Q]#W +[#Q]W# +[#Q ]#W# +[# Q]# W# +[#Q W]# E# + +<<< parseInlineIDShort +W +[#Q]#W +[#Q]W# +[#Q ]#W# +[# Q]# W# +[#Q W]# E# + +>>> parseInlineImage +image:https://upload.wikimedia.org/wikipedia/commons/3/35/Tux.svg[Linux,25,35] +image:linux.png[Linux,150,150,float="right"] You can find Linux everywhere these days! +image:sunset.jpg[Sunset,150,150,role="right"] What a beautiful sunset! +image:sunset.jpg[Sunset] +image:linux.png[2] + +<<< parseInlineImage +Linux +Linux You can find Linux everywhere these days! +Sunset What a beautiful sunset! +Sunset +2 + +>>> parsePassthrough +`+__A *B*__+` +\+__A *B*__+ ++__A *B*__\+ +X+__A *B*__+ ++__A *B*__+X + +<<< parsePassthrough +__A *B*__ ++A B+ ++A B+ +X+A B+ ++A B+X + +>>> parsePassthroughDouble +`++__A *B*__++` +`++__A *B*__+` +\++__A *B*__++ ++\+__A *B*__++ +++__A *B*__\++ +++__A *B*__+\+ +++ A ++. + +<<< parsePassthroughDouble +__A *B*__ +A B+ ++__A *B*__+ ++__A *B*__+ +A B++ +A B++ + A . + +>>> parsePassthroughTriple ++++__A *B*__+++ ++++__A *B*__++ +\+++__A *B*__+++ ++\++__A *B*__+++ +++\+__A *B*__+++ ++++__A *B*__\+++ ++++__A *B*__+\++ ++++__A *B*__++\+ ++++ A +++. + +<<< parsePassthroughTriple +__A *B*__ ++__A *B*__ ++__A *B*__+ ++A B+ ++__A *B*__+ ++__A *B*__+ +__A *B*__++ ++__A *B*__+ + A . + +>>> parseQuote +"`A double quote without end. +"` A double quote around space `" +"`A double quote`" +"`Escaped double quote\`" +'`A single quote without end. +'` A single quote around space `' +"`A single quote`" +"`Escaped single quote\`" + +<<< parseQuote +"`A double quote without end. +"` A double quote around space `" +“A double quote” +"`Escaped double quote`" +'`A single quote without end. +'` A single quote around space ’ +“A single quote” +"`Escaped single quote`" + +>>> parseSubscript +A~B~C +A~B ~C +A~ B~C +A\~B~C +A~B\~C + +<<< parseSubscript +ABC +A~B ~C +A~ B~C +A~B~C +A~B~C + +>>> parseSuperscript +A^B^C +A^B ^C +A^ B^C +A\^B^C +A^B\^C + +<<< parseSuperscript +ABC +A^B ^C +A^ B^C +A^B^C +A^B^C + +>>> parseURL +https://asciidoctor.org/abc +https://asciidoctor.org. +https://asciidoctor.org[Asciidoctor^,role="a,b"]. +\https://example.org. +irc://irc.freenode.org/#fedora[Fedora IRC channel]. +mailto:ms@kilabit.info. +mailto:ms@kilabit.info[Mail to me]. +Relative file link:test.html[test.html]. +link:https://kilabit.info[Kilabit^]. +http: this is not link + +<<< parseURL +https://asciidoctor.org/abc +https://asciidoctor.org. +Asciidoctor. +https://example.org. +Fedora IRC channel. +mailto:ms@kilabit.info. +Mail to me. +Relative file test.html. +Kilabit. +http: this is not link -- cgit v1.3