tui.editor icon indicating copy to clipboard operation
tui.editor copied to clipboard

Repeat: How to use editor or viewes to publish checklist?

Open posel opened this issue 4 years ago • 4 comments

Note: I had already this question but it has lost the comment behind the comment mark, sorry.

Summary

The viewer (object viewer) allows check / uncheck checkboxes, which is great. But I didn't found how to get and store check modifications. getMarkdown method is not published in viewer but it really make sense for this case.

Is there a way how to download changes or somehow get information about the checklist status? Or can I set somehow set up editor to allow only checklists? However it does not make sense - there are may other elements to hide (toolbar etc.)

Screenshots

image

Version

All editors

Additional context

Editors are great, ... but checklists would be more usefull when it allows display them and modify.

posel avatar Sep 02 '20 05:09 posel

@posel It seems that you want to know the state before and after when you click the marker (checkbox) of the task. In the current state, when the change event is fired, I think you should check the marker state by fetching the markdown value and parsing it yourself.

const viewer = Editor.factory({
  el: document.querySelector('#viewer'),
  viewer: true,
  events: {
    change: ev => {
      const content = editor.getMarkdown();
    }
  }
});;

But, as you said, there is no getMarkdown API in the Viewer. This is a bug, so I'll fix it as soon as possible.

seonim-ryu avatar Sep 08 '20 11:09 seonim-ryu

I know, how to read changes in editor and use it. But editor is not good to use only for checks - it enables everything.

Thank's for viewer update ! I'll glad for that because it significantly improves possibilities how to use it!

posel avatar Sep 14 '20 21:09 posel

Would love to see this implemented! And also a way to prevent the checkboxes from being checked in the Viewer when you want it to be read only. Thanks!

robynm avatar Dec 22 '23 00:12 robynm

But, as you said, there is no getMarkdown API in the Viewer. This is a bug, so I'll fix it as soon as possible.

Is there an estimation when getMarkdown will be implemented in the Viewer mode?

harpax avatar Jan 18 '24 12:01 harpax