GithubHelp home page GithubHelp logo

Comments (15)

jamespatterson avatar jamespatterson commented on September 25, 2024 2

I have found this happens in several cases. I could not reproduce the OP's case exactly, because the enlarge method properly moved my caret outside of the href attribute. However...

  1. I was getting a crash on line 65 of v1.04, which is the version that currently packages with CKEditor's package builder. The crash occurs because startNode is null, and range.setStartAfer doesn't validate the input. The result of the crash is the <!--cke_bookmark--> logic is not removed. v1.05+ added a try/catch block which avoided the crash. Closer, but it still didn't work because the <!--cke_bookmark--> comments were not relocated. (But perhaps the CKEditor package builder needs a new release pushed.)

  2. Issues with Fake Objects
    When positioning the caret in code that will ultimately be transformed by the fakeobjects plugin, the <!--cke_bookmark--> become visible in the source editor. Every switch adds another pair. The fakeobjects plugin collects all the markup into a data attribute, which textselection does not see, and therefore the comments are restored into the source editor. I found this in my testing with the showprotected plugin, which uses a fakeobject to insert an icon in place of protectedSource replacements (which are normally invisible).

  3. Issues with Widgets
    If I position the caret within code managed by a widget, the widget will not properly initialize when switching from source mode. This is because textselection injects the comments before the data filters run, at least for the plugins I've tested, which upcast the widget code into markup, and therefore nothing matches. Try this with the standard placeholder plugin. It looks for [[some_name]] but fails to find it because textselection converts it to [[some_<!--cke_bookmark_393S-->nam<!--cke_bookmark_393E-->e]]. You get plain text that is selected, but once it is unselected the widget is restored.

So I think Fake Objects, or a plugin that manipulates the bookmarks out of textselection's reach, will cause problems that might mean permanent changes to the source code. I really like this plugin, and I'll keep working with it and try to contribute a solution. For now, I will need to disable it because the conflicting plugins are mandatory and so is keeping the source markup 100% in tact when switching modes.

If textselection could be improved to manage the selection before plugins manipulate the WYSIWYG when switching to source mode, and after all other plugins are done upcasting the visuals when switching out of source mode, I think it would behave. However, I am new to CKEditor development and I do not know yet if that level of control is offered by the API.

from ckeditor-textselection-plugin.

tdi007 avatar tdi007 commented on September 25, 2024 1

no comment, no idea

from ckeditor-textselection-plugin.

w8tcha avatar w8tcha commented on September 25, 2024 1

Sorry that i haven't answer yet because i didn't have any time. Until now. I tried to reproduce the issue without success. Can you post you editor config?

And you wrote Source Dialog or did you mean the Source Area? Because the Textselection Plugin is not available for the Source Dialog Plugin.

from ckeditor-textselection-plugin.

tdi007 avatar tdi007 commented on September 25, 2024

Hi,
I added a little video capture (zipped mp4 file) and the zipped configuration files (hopefully this is what you asked for). Here you can see ther issue.

cke_bookmark-added.zip

CKEditor_Config.zip

from ckeditor-textselection-plugin.

w8tcha avatar w8tcha commented on September 25, 2024

No thats not the config file. the config file is ether the config.js or did you use an cms system for your website where the editor is integrated?

from ckeditor-textselection-plugin.

tdi007 avatar tdi007 commented on September 25, 2024

Hi,
I added the config.js file and yes we use ckeditor in drupal 7.43 together with wysiwyg 7.x-2.2+63-dev and IMCE wysiwyg api bridge 7.x-1.0
config.js.zip

from ckeditor-textselection-plugin.

w8tcha avatar w8tcha commented on September 25, 2024

The Problem now is the config file is not used by the editor. The config is generated in the html code via the cms system (drupal). that makes it more difficult for me to reproduce. So now i need to find a way to reproduce the issue.

from ckeditor-textselection-plugin.

tdi007 avatar tdi007 commented on September 25, 2024

Any update?

from ckeditor-textselection-plugin.

w8tcha avatar w8tcha commented on September 25, 2024

No sorry. With the latest versions of the editor and plugins i still can not reproduce the issue.

from ckeditor-textselection-plugin.

jasonluttrell avatar jasonluttrell commented on September 25, 2024

FYI, I have this problem as well in CodeMirror 1.15. It appears with or without the Text Selection plugin, so it's probably unrelated. It happens when you click back and forth from the editor and the source views, inserting the comment where the cursor was. The problem is that it results in an additional, unwanted line break.

from ckeditor-textselection-plugin.

larsinsd avatar larsinsd commented on September 25, 2024

This cke_bookmark thing only happens in fullPage: true, but since that's a pretty common use case, and it's been broken like this for 2 years (including in the latest versions of CKEditor 4.7.0), a lot of use are looking forward to a solution.

from ckeditor-textselection-plugin.

w8tcha avatar w8tcha commented on September 25, 2024

Sorry but, I still didn't found a way to reproduce the problem.

from ckeditor-textselection-plugin.

larsinsd avatar larsinsd commented on September 25, 2024

Can you create a demo on your website that has fullPage: true set? Make sure you add the CodeMirror and TextSelection plugins and I will show you the exact steps to reproduce it (it's easy).

from ckeditor-textselection-plugin.

w8tcha avatar w8tcha commented on September 25, 2024

now i remember the problem in fullpage mode due the limitations of the plugin with the bookmark solution the plugin will not work in fullpage mode as i already wrote here...

#22

i updated the codemirror plugin to make sure the textselection is disabled.

from ckeditor-textselection-plugin.

w8tcha avatar w8tcha commented on September 25, 2024

i'm testing a new solution

https://github.com/w8tcha/CKEditor-TextSelection-Plugin/releases/tag/v1.07

from ckeditor-textselection-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.