-
Notifications
You must be signed in to change notification settings - Fork 169
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
HTML returned from mentionSelect
function is being escaped
#45
Comments
@dmacfarlane I've created PR resolving this issue: #50 |
Can I apply CSS to element selected using mentionSelect |
@gurpreet2-kaur I don't see a reason why you couldn't |
I am using function [mentionConfig]="{maxItems:2,mentionSelect:modifyvalue} |
@agarbund hi.. Is it formatting supposed to work like this: onMentionSelect(selection): string {
return '<b>' + selection.label + '</b>';
} Because the result in my <textarea matInput [rows]="4" style="resize: none;"
type="text" [mention]="mentions"
[mentionConfig]="{mentionSelect: onMentionSelect}">
</textarea> |
@silentsnooc you can't have a formatted text in https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Editable_content |
If anyone reaches here in search for @mentions for Angular 2+ with support for HTML in |
@agarbund Could you provide an example? This is not working for me: <div [mention]="mentions" [mentionConfig]="mentionConfig" contenteditable
style="padding-bottom: 24px;">
</div> I am still getting " <b>Text</b>". |
@silentsnooc can I see the issue somewhere? jsbin or sth like that |
@agarbund I created a stackblitz example: https://stackblitz.com/edit/angular-389kgl |
@silentsnooc an example you've attached is using a version of I couldn't import a package directly from git on stackblitz demo, but if you want to see a working example of formatting a selected item, then clone my fork, run If you prefer to stick with packages from NPM you might also check a package I've published recently. |
I know this issue is quite old but this happens to me as well in a tinymce using iframe.. @dmacfarlane any plans on this? or am I missing something? thanks! |
hi @silentsnooc Is it working now? |
@tanmayrajani, my work-around for that is to return a blank string, wait a tick with setTimeout so the search term gets cleared out, then insert the html manually using tinymce's API. |
Still, I am facing the same issue, |
Closing in favor of #170. |
Can you please explain the exact solution or a stackblitz if possible. |
Hey @dmacfarlane it's me again :) I'm continuing rewrite of app to Angular 4 and encountered following issue:
I'm attaching
[mention]
to contenteditable div. A function which is formatting selected item returns HTML to style selected label nicely and disallow editing it:However, this HTML is being escaped when inserted to contenteditable element. Any idea how to bypass this?
The text was updated successfully, but these errors were encountered: