Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task lists support? #189

Open
1 of 2 tasks
whisper-bye opened this issue Jan 28, 2016 · 6 comments
Open
1 of 2 tasks

Task lists support? #189

whisper-bye opened this issue Jan 28, 2016 · 6 comments

Comments

@whisper-bye
Copy link

whisper-bye commented Jan 28, 2016

like this:

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

to this:

  • Completed task list item
  • Incomplete task list item
@jasonb-vbt
Copy link

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

@0livare
Copy link

0livare commented May 24, 2016

👍

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

@dnlfrst
Copy link

dnlfrst commented Sep 18, 2019

Is there any progress on this issue?

@asd-a
Copy link

asd-a commented Feb 22, 2020

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
Copy link

asd-a commented Feb 23, 2020

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

@Vladmaster99
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants