remarkable icon indicating copy to clipboard operation
remarkable copied to clipboard

Task lists support?

Open whisper-bye opened this issue 8 years ago • 6 comments

like this:

- [x] Incomplete task list item
- [ ] **Completed** task list item

to this:

  • [ ] Completed task list item
  • [x] Incomplete task list item

whisper-bye avatar Jan 28 '16 19:01 whisper-bye

+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.

jasonb-vbt avatar Jan 28 '16 19:01 jasonb-vbt

:+1:

I think this is a very necessary addition, I'm in the process of trying to write a plugin for it.

0livare avatar May 24 '16 20:05 0livare

Is there any progress on this issue?

dnlfrst avatar Sep 18 '19 20:09 dnlfrst

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

asd-a avatar Feb 22 '20 13:02 asd-a

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

asd-a avatar Feb 23 '20 04:02 asd-a

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.

Vladmaster99 avatar Jan 05 '21 20:01 Vladmaster99