Compare commits
2 Commits
70f1b62646
...
a4bff99cee
| Author | SHA1 | Date | |
|---|---|---|---|
| a4bff99cee | |||
| b63eb7948f |
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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>')
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user