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

How to allow quill mention chars? #7

Closed
FrazeColder opened this issue Nov 22, 2020 · 2 comments
Closed

How to allow quill mention chars? #7

FrazeColder opened this issue Nov 22, 2020 · 2 comments

Comments

@FrazeColder
Copy link

FrazeColder commented Nov 22, 2020

Hi,

thanks for this awesome package! However, I have one problem.

I am using this package here to support mentions within my comments. The problem I am facing is that when I type a @ and select a user everything works fine! The mention tag is getting placed correct!

But when I edit an comment again the mention gets kind of destroy. Normally the mention looks like this @myuser. But when clicking on edit the mention looks like this @a href="http://mywebsiteproject.test/user/myuser" target=_blankmyuser.

So, there is a problem which the text which gets pasted into the textfield... But I don't know why.
The HTML Tag of a mention looks like this:

<span class="mention" data-index="0" data-denotation-char="@" data-id="1" data-value="<a href=&quot;http://mywebsiteproject.test/user/myuser&quot; target=_blank>myuser" data-link="http://mywebsiteproject.test/user/myuser">
    <span contenteditable="false">
        <span class="ql-mention-denotation-char">@</span>
        <a href="http://mywebsiteproject.test/user/myuser" target="_blank">myuser</a>
    </span>
</span>

But after I pressed edit the html tags look like this:

<span class="mention" data-index="0" data-denotation-char="@" data-id="1" data-value="a href=&quot;http://mywebsiteproject.test/user/DealBee&quot; target=_blankDealBee" data-link="http://mywebsiteproject.test/user/DealBee">
    <span contenteditable="false">
        <span class="ql-mention-denotation-char">@</span>
        a href="http://mywebsiteproject.test/user/DealBee" target=_blankDealBee
    </span>
</span>

=> Basically there is a problem with the tag..

This is how my clipboard module looks like:

clipboard: {
    allowed: {
        tags: ['a', 'b', 'strong', 'u', 's', 'i', 'p', 'br', 'ul', 'ol', 'li', 'span'],
        attributes: ['href', 'rel', 'target', 'class', 'data-index', 'data-denotation-char', 'data-id', 'data-value', 'data-link', 'contenteditable', 'ql-mention-denotation-char']
    },
    keepSelection: true,
},

Does anybody know how to fix this problem/allow the mention tags and attributes?

Kind regards

@Artem-Schander
Copy link
Owner

Hi, thanks for raising this issue.
I'll look into it as soon as i find some time.

@Artem-Schander
Copy link
Owner

Hi @FrazeColder,

Sorry for the long wait.
Do you still have this issue?
Unfortunately I can not reproduce it. Here is a sandbox with a working example.

How did you manage to get an A tag into the data-value prop?

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

No branches or pull requests

2 participants