question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Parchment] Unable to create mention blot

See original GitHub issue

Steps for Reproduction I use VueJS and Quill in my project. Also I want to use quill-mention. Everythings is Okay but when I select any option of mention, show me error: Image of mention error

I use this module like this:

<script>
    import 'quill/dist/quill.snow.css';
    import 'quill-mention/dist/quill.mention.min.css';

    import {quillEditor} from 'vue-quill-editor';
    
    import mention from 'quill-mention';
    Quill.register({
        'modules/mention': mention
    });

    export default {
        components: {
            quillEditor
        },

        props: {
            toolbar: { default: false },
            name:{default: ''},
            id: { default: '' },
            value: { default: '' },
            placeholder: { default: ''}
        },

        data() {
            return {
                editorOption: {
                    modules: {
                        toolbar: [
                            [{'font': []}],
                            [{'header': [1, 2, 3, 4, 5, 6, false]}],
                            [{'align': []}, {'color': []}, {'background': []}],
                            ['blockquote', {'direction': 'rtl'}],
                            ['bold', 'italic'],
                            ['underline', 'strike'],
                            [{'indent': '-1'}, {'indent': '+1'}],
                            [{'list': 'ordered'}, {'list': 'bullet'}],
                            ['link', 'image']
                        ],
                        mention: {
                            allowedChars: /^[A-Za-z\s]*$/,
                            mentionDenotationChars: ["@"],
                            offsetLeft : ($('body').hasClass('rtl') ? -250 : 0 ) ,
                            renderItem :function(item){
                                return item.display
                            },
                            source: function (searchTerm, renderList, mentionChar) {
                                var values = [
                                    { display: 'John', value: 'Fredrik Sundqvist' },
                                    { display: 'Sara', value: 'Patrik Sjölin' }
                                ];

                                if (searchTerm.length === 0) {
                                    renderList(values, searchTerm);
                                } else {
                                    const matches = [];
                                    for (var i = 0; i < values.length; i++)
                                        if (~values[i].value.toLowerCase().indexOf(searchTerm.toLowerCase())) matches.push(values[i]);
                                    renderList(matches, searchTerm);
                                }
                            }
                        }
                    },
                    placeholder: 'aaaaaaaaaaaaaaaaa',
                    theme: 'snow'  // or 'bubble'
                },
                content: ''
            }
        },

        created() {
            .....
        },

        computed: {
           .......
        }
    };
</script>

What’s problem? What should I do?

Platforms: Chrome Last version

Version: 1.3.6

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:7
  • Comments:5

github_iconTop GitHub Comments

7reactions
hardikmodi1commented, Sep 16, 2019

Facing the same issue with everything setup perfect as described in readme.

2reactions
gitamgadtaulacommented, Jan 9, 2021

HI i am facing the same issue, does anyone have a solution?

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Parchment] Unable to create mention blot · Issue #76 - GitHub
I use this module in Quill but error me: [Parchment] Unable to create mention blot I used this: import mention from 'quill-mention'; ...
Read more >
angular 5 and quilljs [Parchment] Unable to create blot
I was apple to fix my problem with next approach ... declare var Quill: any; const BlockEmbed = Quill.import('blots/embed'); export class ...
Read more >
Quill/Parchment error: Unable to create list-item blot - CodePen
Insecure Resource. The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https....
Read more >
Getting to know QuillJS - Part 1 (Parchment, Blots, and Lifecycle)
When creating a Blot with Parchment.create(blotName) and passing in a ... be unable to make this distinction between Italic and AltItalic .
Read more >
HtmlEditor - How to create a custom blot based on Quill's blot
You can get base Quill blots, formats, or Parchment by using the get method. I've prepared a code snippet to demonstrate this technique:....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found