From b63eb7948f9326b9f933f6f9d45c9a38449e0196 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Fri, 29 Oct 2021 22:14:56 +0200 Subject: [PATCH] Add #tag "#" on links --- editor/src/wikilinks2.js | 2 +- editor/test/markdown.test.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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') + }) })