diff --git a/lib/renderer.js b/lib/renderer.js index ef26b74..520380c 100644 --- a/lib/renderer.js +++ b/lib/renderer.js @@ -51,7 +51,16 @@ class Renderer extends MarkedRenderer { } } - let out = ` { result.should.eql([ '

Hello world

', - '
' + escapeHTML(code) + '
\n', + '
' + escapeHTML(code) + '
', '

Hello world

', '

hello

' ].join('') + '\n'); @@ -150,6 +150,16 @@ describe('Marked renderer', () => { ].join('\n')); }); + it('shouldn\'t encode when not a valid URL', () => { + const url = 'http://localhost:4000你好'; + + const body = `[foo](${url})`; + + const result = r({text: body}); + + result.should.eql(`

foo

\n`); + }); + describe('autolink option tests', () => { const hexo = new Hexo(__dirname, {silent: true}); const ctx = Object.assign(hexo, {