sibiraj-s / ngx-editor

🖋️ Rich Text Editor for angular using ProseMirror
https://sibiraj-s.github.io/ngx-editor/
MIT License
424 stars 183 forks source link

Link button translation href #157

Closed HufkensJeroen closed 4 years ago

HufkensJeroen commented 5 years ago

I'm submitting a

Description

Hi,

For the linking button, the text is translated for the href between double quote's. Where can i find the functionality for changing this to single quote's?

Thanks in advance, Kind regards, Jeroen

Version Information

ngx-editor: 3.3.0
angular: 5.2.0

Browser

sibiraj-s commented 5 years ago

Thanks for reporting this. I can get the point that something unusual is happening. but I cant quite understand exactly whats happening can you elaborate?

HufkensJeroen commented 5 years ago

Thanks for reporting this. I can get the point that something unusual is happening. but I cant quite understand exactly whats happening can you elaborate?

So we are using this part of the code to translate it to a json object, the fact that the href="some url" is used this has conflicts with the json object, by which it cannot be parsed. That is why i try to change this so that we atleast can use this functionality.

HufkensJeroen commented 5 years ago

Thanks for reporting this. I can get the point that something unusual is happening. but I cant quite understand exactly whats happening can you elaborate?

Do you have any update on this?

Kr, Jeroen

sibiraj-s commented 5 years ago

So you want to use single quote instead of double in the editor?

HufkensJeroen commented 5 years ago

So you want to use single quote instead of double in the editor?

Yes single quote :-) so that when the data is saved it can be parsed into the json

HufkensJeroen commented 5 years ago

Do you have any update on this matter?

jerthiry commented 5 years ago

Hi, I'm also encountering this issue on Angular 5. I think the issue is that the href is inserted with document.execCommand('insertHTML', false, html); which replaces the single quotes by double quotes when inserting in the editor.

jerthiry commented 5 years ago

Because I tried replacing double quotes with single quotes in the module code when creating the href and it is fine until the document.execCommand('insertHTML', false, html); line is executed.

sibiraj-s commented 5 years ago

Hi, Sorry for the delay. I am fixing issues in FCFS basis. Will work on this soon, I think I may need some help on this. Meanwhile, if fixable send a PR to development branch 😄.

jerthiry commented 5 years ago

I chose to process the HTML with a regex to simply replace double quotes by simple quotes before sending the POST request. Thanks anyway !

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in the thread.