Compare commits

...

2 Commits

Author SHA1 Message Date
a4bff99cee Fix TODO/DONE line-through
All checks were successful
continuous-integration/drone/push Build is passing
2021-10-29 22:32:25 +02:00
b63eb7948f Add #tag "#" on links 2021-10-29 22:14:56 +02:00
3 changed files with 8 additions and 4 deletions

View File

@ -388,9 +388,9 @@ function Editor(holder, input) {
}
try {
const todoItem = $(converted).find(':checkbox')
if (todoItem.length) {
const todo = !todoItem.is(':checked')
const todoItem = $.parseHTML(converted)
if (todoItem.length && $(todoItem[0]).is(':checkbox')) {
const todo = !$(todoItem[0]).is(':checked')
element.toggleClass('todo--done', todo === false)
element.toggleClass('todo--todo', todo === true)
} else {

View File

@ -67,7 +67,7 @@ Plugin.prototype.render = function (tokens, id, options, env) {
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) => {

View File

@ -59,4 +59,8 @@ describe('MD', 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>')
})
it('parseLinks tag', function () {
assert.deepStrictEqual(MD.renderInline("test #[[test]]"), 'test <a href="/test" class="wiki-link">#test</a>')
})
})