vue-markdown icon indicating copy to clipboard operation
vue-markdown copied to clipboard

Bug with '#' if editing with TOC enabled

Open Tattomoosa opened this issue 6 years ago • 5 comments

When Vue-Markdown is previewing a textarea that is being edited with the toc enabled, it throws an error when inputting # without a title after it.

This crashes the implementation in the live demo (markdown stops updating), but in my app it actually keeps working and just keeps throwing errors into the console.

Uncaught TypeError: Cannot read property 'type' of undefined
at Array.<anonymous> (vue-markdown.min.js:4)
at n.process (vue-markdown.min.js:2)
at s.parse (vue-markdown.min.js:1)
at s.render (vue-markdown.min.js:1)
at C (vue-markdown.min.js:1)
at VueMarkdown.<anonymous> (vue-markdown.min.js:1)
at Watcher.run (vue.js:3251)
at runBatcherQueue (vue.js:2984)
at Array.flushBatcherQueue (vue.js:2958)
at MutationObserver.nextTickHandler (vue.js:434)

To reproduce, turn on toc in the live demo

Tattomoosa avatar Apr 21 '18 03:04 Tattomoosa

This issue is the same as mine

onedou avatar May 17 '18 01:05 onedou

image

onedou avatar May 17 '18 01:05 onedou

+1

beebase avatar Oct 05 '18 16:10 beebase

me too

zoi-aoba avatar Nov 16 '18 12:11 zoi-aoba

I have the same problem. maybe toc should skip this situation?

fangbinwei avatar Dec 27 '18 03:12 fangbinwei