Add #tag "#" on links
This commit is contained in:
parent
70f1b62646
commit
b63eb7948f
|
@ -67,7 +67,7 @@ Plugin.prototype.render = function (tokens, id, options, env) {
|
||||||
return '<input type="checkbox" class="checkbox" checked>';
|
return '<input type="checkbox" class="checkbox" checked>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return '<a href="/' + link.replace(' ', '_') + '" class="wiki-link">' + link + '</a>';
|
return '<a href="/' + link.replace(' ', '_') + '" class="wiki-link">' + (tag ? '#' : '') + link + '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
export default (options) => {
|
export default (options) => {
|
||||||
|
|
|
@ -59,4 +59,8 @@ describe('MD', function () {
|
||||||
it('parseLinks 6', function () {
|
it('parseLinks 6', function () {
|
||||||
assert.deepStrictEqual(MD.renderInline("test [[test]] [[test2]]"), 'test <a href="/test" class="wiki-link">test</a> <a href="/test2" class="wiki-link">test2</a>')
|
assert.deepStrictEqual(MD.renderInline("test [[test]] [[test2]]"), 'test <a href="/test" class="wiki-link">test</a> <a href="/test2" class="wiki-link">test2</a>')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('parseLinks tag', function () {
|
||||||
|
assert.deepStrictEqual(MD.renderInline("test #[[test]]"), 'test <a href="/test" class="wiki-link">#test</a>')
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user