diff --git a/lib/compileText.js b/lib/compileText.js index 33e5cf3..dd72353 100644 --- a/lib/compileText.js +++ b/lib/compileText.js @@ -8,7 +8,7 @@ function CompileText(ast) { let result = ""; if (element.type === "url") { result = mapper(element.children); - str += mapper(element.children) + " " + element.url; + str += mapper(element.children) + " (" + element.url + ")"; } else { result = mapper(element.children); str = str + result; diff --git a/test/compileText.test.js b/test/compileText.test.js index 00c1924..f89c26f 100644 --- a/test/compileText.test.js +++ b/test/compileText.test.js @@ -16,7 +16,7 @@ describe("Compile AST to Raw String", function () { const ast = [ { type: "url", children: ["The Feathers"], url: "feathers.studio" }, ]; - expect(CompileText(ast)).to.eql("The Feathers feathers.studio"); + expect(CompileText(ast)).to.eql("The Feathers (feathers.studio)"); }); it("Formatted Link AST", function () { @@ -32,7 +32,7 @@ describe("Compile AST to Raw String", function () { url: "feathers.studio", }, ]; - expect(CompileText(ast)).to.eql("The Feathers feathers.studio"); + expect(CompileText(ast)).to.eql("The Feathers (feathers.studio)"); }); // it("Wrongly Formatted Link AST", function () {