diff --git a/src/converter.js b/src/converter.js index 4e0c9f4..f6e422d 100644 --- a/src/converter.js +++ b/src/converter.js @@ -368,8 +368,8 @@ showdown.Converter = function (converterOptions) { clean(doc); // some stuff, like accidental reference links must now be escaped - doc.innerHTML = doc.innerHTML.replace(/\[[\S\t ]]/); - + // TODO + // doc.innerHTML = doc.innerHTML.replace(/\[[\S\t ]]/); var nodes = doc.childNodes, mdDoc = ''; @@ -671,8 +671,8 @@ showdown.Converter = function (converterOptions) { for (var i = 0; i < childrenLength; ++i) { txt += parseNode(children[i]); } - txt += ']'; - txt += '(' + node.getAttribute('href'); + txt += ']('; + txt += '<' + node.getAttribute('href') + '>'; if (node.hasAttribute('title')) { txt += ' "' + node.getAttribute('title') + '"'; } @@ -684,8 +684,8 @@ showdown.Converter = function (converterOptions) { function parseImage (node) { var txt = ''; if (node.hasAttribute('src')) { - txt += '![' + node.getAttribute('alt') + ']'; - txt += '(' + node.getAttribute('src'); + txt += '![' + node.getAttribute('alt') + ']('; + txt += '<' + node.getAttribute('src') + '>'; if (node.hasAttribute('width') && node.hasAttribute('height')) { txt += ' =' + node.getAttribute('width') + 'x' + node.getAttribute('height'); } diff --git a/test/functional/makemarkdown/cases/standard/anchors-relative.md b/test/functional/makemarkdown/cases/standard/anchors-relative.md index c42eeaf..3b3699b 100644 --- a/test/functional/makemarkdown/cases/standard/anchors-relative.md +++ b/test/functional/makemarkdown/cases/standard/anchors-relative.md @@ -1 +1 @@ -See my [About](/about/) page for details. +See my [About]() page for details. diff --git a/test/functional/makemarkdown/cases/standard/anchors.md b/test/functional/makemarkdown/cases/standard/anchors.md index 989f573..0441e15 100644 --- a/test/functional/makemarkdown/cases/standard/anchors.md +++ b/test/functional/makemarkdown/cases/standard/anchors.md @@ -1,3 +1,3 @@ -This is [an example](http://example.com/ "Title") inline link. +This is [an example]( "Title") inline link. -[This link](http://example.net/) has no title attribute. +[This link]() has no title attribute. diff --git a/test/functional/makemarkdown/cases/standard/emphasis.md b/test/functional/makemarkdown/cases/standard/emphasis.md index 789c597..1b8b51f 100644 --- a/test/functional/makemarkdown/cases/standard/emphasis.md +++ b/test/functional/makemarkdown/cases/standard/emphasis.md @@ -68,4 +68,4 @@ foo**bar**baz foo**bar**baz -this is **[imbued link with strong](//google.com)** +this is **[imbued link with strong]()** diff --git a/test/functional/makemarkdown/cases/standard/images-followed-by-brackets.html b/test/functional/makemarkdown/cases/standard/images-followed-by-brackets.html new file mode 100644 index 0000000..5f723bf --- /dev/null +++ b/test/functional/makemarkdown/cases/standard/images-followed-by-brackets.html @@ -0,0 +1,2 @@ +

image link(some text between brackets)

+

image link(some text between brackets)

diff --git a/test/functional/makemarkdown/cases/standard/images-followed-by-brackets.md b/test/functional/makemarkdown/cases/standard/images-followed-by-brackets.md new file mode 100644 index 0000000..1481067 --- /dev/null +++ b/test/functional/makemarkdown/cases/standard/images-followed-by-brackets.md @@ -0,0 +1,3 @@ +![image link](<./image/cat1.png>)(some text between brackets) + +![image link](<./image/cat(1).png>)(some text between brackets) diff --git a/test/functional/makemarkdown/cases/standard/images.md b/test/functional/makemarkdown/cases/standard/images.md index 4296c97..9473295 100644 --- a/test/functional/makemarkdown/cases/standard/images.md +++ b/test/functional/makemarkdown/cases/standard/images.md @@ -1,10 +1,10 @@ -![Alt text](/path/to/img.jpg) +![Alt text]() -![Alt text](/path/to/img.jpg "Optional title") +![Alt text]( "Optional title") -![Alt text](url/to/image.jpg "Optional title attribute") +![Alt text]( "Optional title attribute") -![My Image](url/to/image2.jpg "Optional title attribute") +![My Image]( "Optional title attribute") ![leave me alone]