diff --git a/editor/src/wikilinks2.js b/editor/src/wikilinks2.js index ab8b35a..a58d83d 100644 --- a/editor/src/wikilinks2.js +++ b/editor/src/wikilinks2.js @@ -67,7 +67,7 @@ Plugin.prototype.render = function (tokens, id, options, env) { return ''; } } - return '' + link + ''; + return '' + (tag ? '#' : '') + link + ''; } export default (options) => { diff --git a/editor/test/markdown.test.js b/editor/test/markdown.test.js index 25ff763..87c77f9 100644 --- a/editor/test/markdown.test.js +++ b/editor/test/markdown.test.js @@ -59,4 +59,8 @@ describe('MD', function () { it('parseLinks 6', function () { assert.deepStrictEqual(MD.renderInline("test [[test]] [[test2]]"), 'test test test2') }) + + it('parseLinks tag', function () { + assert.deepStrictEqual(MD.renderInline("test #[[test]]"), 'test #test') + }) })