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

Error this.quillJS.getLine is not a function #74

Open
vadimkantorov opened this issue Dec 12, 2023 · 2 comments
Open

Error this.quillJS.getLine is not a function #74

vadimkantorov opened this issue Dec 12, 2023 · 2 comments

Comments

@vadimkantorov
Copy link

vadimkantorov commented Dec 12, 2023

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 #70 (comment), but don't understand completely the limitation you described

@vadimkantorov
Copy link
Author

vadimkantorov commented Dec 12, 2023

Okay, it appears it's because I followed Quill's README a bit too well and used Quill version 1.0.0 instead of 1.3.7: slab/quill#3932

But maybe it would be great if quilljs-markdown README included this complete HTML example

@cloverhearts
Copy link
Owner

Thank you for your report.
I'll fix it soon. 👍

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

No branches or pull requests

2 participants