TinyMCE 4 Plugin

I see looks like some dependency between chrome and firefox. I’ll see about making it more browser agnostic.

Alright, done. The problem seems to have been when going a bit outside the range via DEL and Backspace so I added some extra handlers for those to allow for +/- 1 when used.

It works as far as I see. If there is still an issue, tell me step by step how to replicate it.

Copy the English demo text from languagetool.org and add xxx to an few, so there’s xxxan in the text. For me, the underline is still only below an instead of under the whole word. Moving the cursor away doesn’t help. Adding a return at the end of the paragraph then triggers a re-check.

I think one of my recent patch broke something. (I did another patch in between my response). Sigh, I’ll fix it as part of next release alongside another bug I found.

Wait it seems to work fine. The front page on languagetools.org does not have a serializer for when you copy. So what ends up happening is that you end up copying the styles along side. Copy it first into a text editor that will get rid of the styles. Then try.

(What I broke in my last patch was the serializer as well ironically, though that is independent from the issue with the front page)

Edit: Of course its still an issue I should fix (dealing with spans that are copied over better)

With plain text, it’s better. But the issue count always seems to increase when I replace the “an” with some other word with a typo. Also, the old underlines sometimes don’t get removed it seems:

The spans are most likely cutting up the issue so it is counting it multiple times. That can be seen via the dialog. Either way I’ll see about fixing the span issue.

As for the old underlines, nothing I can do about that. Those are not an issue with my code but issue with the code on the front page of language tools.

Normally, when my serializer was working prior to last patch, when you copy the text, it would remove the styling. But the version on the language tools website has no serializer so it just sends over the styles.

What I might do is make a fork of the Paste plugin and offer an option of paste as plain text. But that would be a feature outside of languagetool plugin itself.

By the way, since I am doing a bunch of testing, I also notice some issues here and there. Should I make a thread for these issues or report them in github.

For example:

My Rabit Leather belt = no mispelling found
My Rabit Leather Belt = no mispelling found
I found a Rabit Leather belt = no mispelling found
My Rabit leather belt = mispelling found

Or is it assuming Rabit is a person’s name or something due to the double capital letters?

I also noticed that LibreOffice seems to run both spellcheckers at the same time (I use Libre to compare to see if my is rendering properly, and at first I though I made a mistake somewhere and kept trying to fix it to no avail until I noticed it was the processor lol)

Please open a github issue. For your examples, the integrated spell checker accepts all lowercase words also when they appear uppercase, and there’s no second rule that complains about these words.

LibreOffice comes with its own spell checker. So for simple spelling issues, you see the LibreOffice results, for more advanced errors, you see the LT results.

I’m not sure I’m following you - the latest test I did was with plain text, i.e. I removed any formatting from the text before I pasted it.

Yes. Refer to the disambiguation rule UPPER_UNKNOWN_NNP_UPPERCASE_SEQ.

You can see the behaviour in the stand-alone version of LT. In the Tagger Result dialog, select ‘Show disambiguator log’. For ‘My Rabit Leather belt’, part of the disambiguation is:
UPPER_UNKNOWN_NNP_UPPERCASE_SEQ[1]: Rabit[Rabit/null,I-NP-singular] -> Rabit[Rabit/NNP,I-NP-singular]

I tried disabling that rule via “disabledRules” and it still doesn’t pick it up.

Oh I assumed the screenshot you gave though has a flat line purple line in there was from styling. I see whats going on, ok I’ll fix it.

Alright, I fixed it. All of these were regressions from the previous patch. I think it should be good now with or without styling.

It’s a disambiguation rule, these cannot be turned off. Only rules from grammar.xml can be turned off (and those from Java code). But I think turning it off wouldn’t help anyway, as there’s just no rule yet that complains about words written uppercase when they should be lowercase.

Well the issue isn’t about it being upper case or lower case in specific. Maybe I can give a better example of the problem:

I stayed at the Holday Inn Express. = no spelling mistake
I stayed at the holday Inn Express. = spelling mistake
I went on a Holday again. = spelling mistake

Holiday Inn Express is a name per say, but it uses common words and I can misspell holiday and wouldn’t even notice. I am more interested in it catching misspelled words then correcting lower and upper case.

Anyways I’ll open an issue in Github I guess. Don’t want to go off course too much from the main topic. It just came up when I was testing content and comparing it to LibreOffice and thought something was broken on my end. (The built in libreoffice check found it an issue while LT did not so before I realized they were both being used I thought I made the error)

Sorry to say, but there’s still a way to confuse the script and get errors without underline. Just go to the “an” error and add some “x” in front of it, remove them, add more etc. Maybe it depends on how long you wait after your edit, the requests in the background might overlap or so? I’d also suggest making the re-check time much faster, maybe 500ms instead of 3 seconds.

I was wrong. But let’s discuss the details at issue 752.

I really don’t want it to recheck it ever 500ms and for multiple reasons:
1 - It would be pointless for people using public servers
2 - It might introduce a lot of other problems as the user gets checked on every char they type

I know the issue and have an idea how to fix it. How it works is it only rechecks again after 3 seconds if there is a span. But since the span disappears.

Once the span is gone, it goes back to doing things the old fashioned way which is comparing the result vs the cache. When the cache matches, it doesn’t bother re-sending it. Which at that point you make another mistake and it doesn’t show up unless you change nodes.

What I will probably do is after you manually correct, I’ll have it check again in 15 seconds and 60 seconds. This should catch 99.9% of those scenarios which in itself would be pretty rare.