christiaan / tinymce-codemirror

Development moved to gitlab.com/tinymce-plugins/tinymce-codemirror
https://gitlab.com/tinymce-plugins/tinymce-codemirror
Apache License 2.0
71 stars 29 forks source link

HTML get damaged with replace URL in Editor #9

Closed Daijobou closed 5 years ago

Daijobou commented 8 years ago

Is this a Plugin bug, TinyMCE bug or a problem with CodeMirror itself?

https://github.com/codemirror/CodeMirror/issues/4145

christiaan commented 8 years ago

This seems to be a bug related wit this plugin. It could be a TinyMCE bug but definitely not a CodeMirror bug.

Daijobou commented 8 years ago

Maybe here is a problem with this line? https://github.com/christiaan/tinymce-codemirror/blob/master/plugins/codemirror/source.html#L197

Because this is included (bold text) after submit source-code <a href="file.jpg<span id=">" target="_blank">URL1</a>

thomich commented 8 years ago

Hello @Daijobou

Can you reproduce your reported issue also with latest TinyMCE and tinymce-codemirror code?

Thanks for your reply

Regards thomi

Daijobou commented 8 years ago

Yes.

thomich commented 8 years ago

I tested this issue with: tiny_mce: 4.4.2 current codemirror plugin (master) for tiny_mce codemirror i use for the plugin: codemirror-5.8

i followed this steps and can't reproduce:

1 add this code into source editor

<a
   href="URL1" target="_blank">Text</a>

selection_002

2 click ok in source editor and check link in tiny_mce

selection_004

3 reopen source editor and check source code

selection_005

4 add real URL in source editor

selection_006

5 check again link with tiny_mce link editor.. all success

if you can provide more information, more details, let us know.. we will try to help ;)

regards thomi

Daijobou commented 8 years ago

Thanks, but your step two is wrong. :)

  1. open source editor
  2. edit in source editor the URL with a real one
  3. close source editor

result in tinymce looks like:

" target="_blank">Text

thomich commented 8 years ago

Yeah i see what you mean...

whats the reason why you use two lines for adding a link? do you follow any special coding style like PEP 8 or similar?

workaround can be:

instead of this:

<a
   href="URL1" target="_blank">Text</a>

add it like this

<a href="URL1" target="_blank">Text</a>

Daijobou commented 8 years ago

I never use this way to add links, but someone have do it and report the bug to me and I report it her, because its a bug in any way. I have said him the same, to use a single line. ;)

thomich commented 8 years ago

okies...

have checked with default tiny_mce code editor and there it works...

climbing down the codemirror plugin code to find out the issue ;)

will update here..

thomi