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

Error `this.quillJS.getLine is not a function`

Open vadimkantorov opened this issue 6 months ago • 2 comments

Hi @cloverhearts !

I'm setting up Quill + QuillMarkdown as follows:

<html>
    <body>
        <head>
            <link href="https://cdn.quilljs.com/1.0.0/quill.snow.css" rel="stylesheet" />
            <script src="https://cdn.quilljs.com/1.0.0/quill.js"></script>
            <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/quilljs-markdown@latest/dist/quilljs-markdown-common-style.css" />
            <script src="https://cdn.jsdelivr.net/npm/quilljs-markdown@latest/dist/quilljs-markdown.js"></script>
        </head>

        <div id="editor"></div>
        <script>
            const editor = new Quill('#editor', { theme: 'snow' });
            const editor_markdown = new QuillMarkdown(editor);
        </script>
    </body>
</html>

This loads without errors in Chrome DevConsole.

However, when I start typing # hello, I get this strange result:

  • no header formatting
  • more identical errors at every char typed
  • the reversed output: hello# instead of # hello
image
app.js:34 Uncaught TypeError: this.quillJS.getLine is not a function
    at t.value (app.js:34:39)
    at Emitter.emit (quill.js:4316:28)
    at Emitter.emit (quill.js:4146:100)
    at Editor.update (quill.js:4046:44)
    at Emitter.emit (quill.js:4310:34)
    at Emitter.emit (quill.js:4146:100)
    at Scroll.update (quill.js:6299:23)
    at MutationObserver.<anonymous> (quill.js:1401:20)
value @ app.js:34
emit @ quill.js:4316
emit @ quill.js:4146
update @ quill.js:4046
emit @ quill.js:4310
emit @ quill.js:4146
update @ quill.js:6299
(anonymous) @ quill.js:1401

How could I get this basic example to work?

Thank you very much :)


Basically, my usecase is creating a simple WYSIWYG markdown editor for files stored at GitHub. Is this secnario possible? Does quilljs-markdown preserve the underlying Markdown? Or is it not possible to retrieve it? I saw https://github.com/cloverhearts/quilljs-markdown/issues/70#issuecomment-1528716904, but don't understand completely the limitation you described

vadimkantorov avatar Dec 12 '23 16:12 vadimkantorov