Comments (15)
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...
-
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, andrange.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.) -
Issues with Fake Objects
When positioning the caret in code that will ultimately be transformed by thefakeobjects
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, whichtextselection
does not see, and therefore the comments are restored into the source editor. I found this in my testing with theshowprotected
plugin, which uses a fakeobject to insert an icon in place ofprotectedSource
replacements (which are normally invisible). -
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 becausetextselection
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 standardplaceholder
plugin. It looks for[[some_name]]
but fails to find it becausetextselection
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.
no comment, no idea
from ckeditor-textselection-plugin.
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.
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.
from ckeditor-textselection-plugin.
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.
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.
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.
Any update?
from ckeditor-textselection-plugin.
No sorry. With the latest versions of the editor and plugins i still can not reproduce the issue.
from ckeditor-textselection-plugin.
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.
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.
Sorry but, I still didn't found a way to reproduce the problem.
from ckeditor-textselection-plugin.
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.
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...
i updated the codemirror plugin to make sure the textselection is disabled.
from ckeditor-textselection-plugin.
i'm testing a new solution
https://github.com/w8tcha/CKEditor-TextSelection-Plugin/releases/tag/v1.07
from ckeditor-textselection-plugin.
Related Issues (20)
- decodeURIComponent fails if source text contains % HOT 4
- Cursor position only works to first tag on return to WYSIWYG HOT 4
- Could this work with other source code plugins? HOT 2
- scroll caret / selection into view HOT 4
- If cursor is in the <head> section of a FullPage document, extra code is added HOT 8
- Selected text is removed in IE10 and IE11 HOT 1
- Content lost when clicking undo after switching from WYSIWYG to SOURCE and back to WYSIWYG HOT 2
- cursor misplaced returning from sourcodeview HOT 4
- Switching from Source to WYSIWIG and back duplicates TABLE/TR/TD HOT 2
- Turning to Source when a widget is focused adds empty paragraphs around it HOT 4
- Storing content in browser local storage does not work properly / sporadically loses changes without local storage HOT 4
- fullPage = true compatibility HOT 3
- The plugin seems to prevent the content from changing when switching to source and back? HOT 4
- Dropping selection when switching to WYSIWYG if the selection starts or ends with the HTML element HOT 3
- Selection/Position not kept if fullPage: true in CKEditor config HOT 2
- Bookmark Spans not getting removed HOT 2
- CKEditor 5 upgrade HOT 2
- TextSelection doesn't work in SourceDialog with CodeMirror HOT 7
- Hi, In source mode, How to autoscroll the selection? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ckeditor-textselection-plugin.