Use multiple underscore when there are multiple spaces
This commit is contained in:
parent
760eb11694
commit
001e4748dd
|
@ -69,7 +69,7 @@ Plugin.prototype.render = function (tokens, id, options, env) {
|
|||
return '<input type="checkbox" class="checkbox" checked>';
|
||||
}
|
||||
}
|
||||
return '<a href="'+this.options.relativeBaseURL+encodeURIComponent(link.replace(' ', '_')) + '" class="wiki-link">' + (tag ? '#' : '') + link + '</a>';
|
||||
return '<a href="'+this.options.relativeBaseURL+encodeURIComponent(link.replace(/ +/g, '_')) + '" class="wiki-link">' + (tag ? '#' : '') + link + '</a>';
|
||||
}
|
||||
|
||||
export default (options) => {
|
||||
|
|
|
@ -65,6 +65,6 @@ describe('MD', function () {
|
|||
})
|
||||
|
||||
it('parseLinks double url', function () {
|
||||
assert.deepStrictEqual(MD.renderInline("[[test [[link]] test2]]"), '<a href="/edit/test_%5B%5Blink%5D%5D%20test2" class="wiki-link">test [[link]] test2</a>')
|
||||
assert.deepStrictEqual(MD.renderInline("[[test [[link]] test2]]"), '<a href="/edit/test_%5B%5Blink%5D%5D_test2" class="wiki-link">test [[link]] test2</a>')
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue
Block a user