remarkable
remarkable copied to clipboard
Task lists support?
like this:
- [x] Incomplete task list item
- [ ] **Completed** task list item
to this:
- [ ] Completed task list item
- [x] Incomplete task list item
+1 for this idea in general, but take it up with the CommonMark people, and if they add it to the spec then open a remarkable issue for spec compliance.
:+1:
I think this is a very necessary addition, I'm in the process of trying to write a plugin for it.
Is there any progress on this issue?
Is there any progress on this issue?
I just know we can
add <input type="checkbox" disabled class="task-list-item-checkbox">
for [ ]
,
add
<input type="checkbox" disabled class="task-list-item-checkbox" checked>
for [x]
but i am not smart enough to write a plugin
function remarkabletasklist(md,options){
function rendertasklist(checked){
if(checked){return '<input type="checkbox" disabled class="task-list-item-checkbox" checked>';}
return '<input type="checkbox" disabled class="task-list-item-checkbox">';
}
function parsetasklist(state){
var pos = state.pos;
var maxpos = state.posMax;
if(pos === maxpos){return false;}
if(state.src.charCodeAt(pos) !== 91){return false;}
++pos;
if(state.src.charCodeAt(pos) === 93){
state.push({
type: 'tasklist',
checked: false,
level: state.level
});
state.pos = pos+1;
return true;
}
if(state.src.charCodeAt(pos) === 120 || state.src.charCodeAt(pos) === 88 || state.src.charCodeAt(pos) === 32){
var checked = (state.src.charCodeAt(pos) !== 32);
++pos;
if(state.src.charCodeAt(pos) !== 93){return false;}
state.push({
type: 'tasklist',
checked: checked,
level: state.level
});
state.pos = pos+1;
return true;
}
return false;
}
md.inline.ruler.push('tasklist',parsetasklist,options);
md.renderer.rules.tasklist = function(tokens, idx){
return rendertasklist(tokens[idx].checked);
}
}
it's almost ok for task-list unless you use^[]
,^[ ]
,^[x]
for footnotes
Yes this is needed by me as well. Needed for Tiddlywiki that uses the remarkable javascript commonmark parser and GFM Task checkbox's are the bees knees. Only reason I am using TiddlywikiClassic on Nodejs.