Skip to content
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

Provide a plugin exposing an API that lets you mark keywords #1257

Closed
Reinmar opened this issue Sep 21, 2018 · 8 comments
Closed

Provide a plugin exposing an API that lets you mark keywords #1257

Reinmar opened this issue Sep 21, 2018 · 8 comments
Labels
resolution:expired This issue was closed due to lack of feedback. status:discussion type:feature This issue reports a feature request (an idea for a new functionality or a missing option).

Comments

@Reinmar
Copy link
Member

Reinmar commented Sep 21, 2018

Is this a bug report or feature request? (choose one)

🆕 Feature request

📃 Other details that might be useful

I'm thinking about a similar feature to https://markjs.io/. Like:

const markerPlugin = editor.plugins.get( 'Marker' );

const marker = markerPlugin.create( {
    in: editor.model.document.getRoot(),                // Allows limitting it to a given range/container.
    element: { name: 'mark', classes: 'find-result' }   // Defines the element to use in the view
} );

marker.mark( 'Foo' );
marker.mark( /Foo\s+Bar/g );

const results = marker.mark( 'Foo', {
    watch: true
} );

for ( const res of results ) { 
    // res {Range|Marker?}
}

(As you can see I had some problem with naming – that'd have to be rethought.)

Such an API could be used by find/replace feature, keyword tracking, possibly spellchecking (although, it'd have to be optimised for performance and async querying mechanism, so problably not in MVP) etc.


If you'd like to see this API introduced, add 👍 to this ticket.

@Reinmar Reinmar added status:discussion type:feature This issue reports a feature request (an idea for a new functionality or a missing option). labels Sep 21, 2018
@Reinmar Reinmar added this to the backlog milestone Sep 21, 2018
@Reinmar
Copy link
Member Author

Reinmar commented Mar 5, 2019

Another use case: #1592

@Reinmar Reinmar modified the milestones: backlog, next Mar 5, 2019
@Reinmar
Copy link
Member Author

Reinmar commented Apr 5, 2019

Another use case: #1430

@scofalik
Copy link
Contributor

scofalik commented Apr 5, 2019

I think what we (also?) need is a nice tool that would allow us to get text data of a given element and/or get all occurrences of given text in the given element (deep), together with the position where the occurrence happens (and length if we allow regexps). When reading #1430 I came to a conclusion that we have no easy way to find a text in the editor and you need to glue the element's text, search in it and figure out the offset by yourself.

The above could be the base for what you proposed in the original post. I don't like delivering only your proposal because it is limited to using markers.

@andy-bond
Copy link

My organization has a use for this feature. In the process of drafting regulations, there is a list of words that should not be used in the text, except for very rare exceptions. We would love to have the ability to highlight these words so that the person drafting can check whether they could use a different allowed word. I think it would also be nice if we could get a count of the number of occurrences of disallowed words, similar to the Word Count Plugin.

@yankustefan
Copy link

Our organisation has also use for this, in the context of corporate language, where certain words or phrases should not be used. We can spot them in our backend, but we would like to highlight them in CKEditor programatically. Since we would like to suggest a list of alternatives, it would tie into the "Find (search) in document" feature #1430. Essentially, our goal is to implement something like Grammarly's synonym widget.

image

@pomek pomek removed this from the nice-to-have milestone Feb 21, 2022
@CKEditorBot
Copy link
Collaborator

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

@CKEditorBot
Copy link
Collaborator

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

@CKEditorBot
Copy link
Collaborator

We've closed your issue due to inactivity over the last year. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).

@CKEditorBot CKEditorBot added resolution:expired This issue was closed due to lack of feedback. and removed status:stale labels Jan 15, 2024
@CKEditorBot CKEditorBot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution:expired This issue was closed due to lack of feedback. status:discussion type:feature This issue reports a feature request (an idea for a new functionality or a missing option).
Projects
None yet
Development

No branches or pull requests

6 participants