Spell checker that works with CodeMirror?

610 views
Skip to first unread message

Si

unread,
Jun 30, 2021, 3:30:43 PM6/30/21
to TiddlyWiki

I'm wondering if anyone knows of a spell checker browser extension that works with the CodeMirror plugin? I've tried Grammerly to no avail.

TW Tones

unread,
Jun 30, 2021, 6:52:08 PM6/30/21
to TiddlyWiki
Si,

I came across this in the past and created a simple alternative editor to open the same tiddler as a simple textarea to enable Grammarly. Its just a spell check process.

Tones

Sebastián Ortega

unread,
Jul 1, 2021, 4:14:52 AM7/1/21
to TiddlyWiki
I did exactly that to get the standard browser spell checker.
spell_check.png

To get this I created a new tiddler:
Alternatively you can import the tiddler from the attached file.

And that's all.
$ _custom_ui_EditTemplate_body_preview_spellcheck.json

PMario

unread,
Jul 1, 2021, 5:03:03 AM7/1/21
to TiddlyWiki
Hi,
That's a very clever approach, since 3rd party libraries are always huge in size, since they need language specific dictionaries.

IMO we should ship this little tweak with the codemirror plugin, so it is available by default

-mario

PMario

unread,
Jul 1, 2021, 5:06:30 AM7/1/21
to TiddlyWiki
I did create an issue: https://github.com/Jermolene/TiddlyWiki5/issues/5841 at github

-m

unread,
Jul 1, 2021, 6:34:00 AM7/1/21
to TiddlyWiki
Hello,

spell check is not working:

spell check.png

Regards
Stefan

PMario

unread,
Jul 1, 2021, 7:10:04 AM7/1/21
to TiddlyWiki
Hi Stefan,

In your screenshot it works on the right side as expected. .. BUT it seems you switched to German language. With right-click : Sprachen you should get a selector, to select the language.

If there is no selector, you'll need to install a new dictionary. see: "Wörterbücher hinzufügen" .. I'm using: "British English Dictionary (Marco Pinto)" and  "German dictionary (de_DE)"

have fun!
-mario

PMario

unread,
Jul 1, 2021, 7:11:43 AM7/1/21
to TiddlyWiki
Uuups, I didn't read the text in the screenshot.

It is a spell-checker and not a grammar checker. I don't know if there is a plugin, that also checks for the grammar.
-m

Si

unread,
Jul 1, 2021, 9:01:03 AM7/1/21
to TiddlyWiki
Hi Tones, mehequeda

Thanks a lot - I had seen that method suggested by Jeremy in an older thread relating to this topic. @mehequeda I really appreciate you providing instructions - thank you!

In general though I was hoping to find a browser extension that could look directly into the CodeMirror text-box so I can see corrections while I am writing, but I will use that workaround if nothing comes up.

TW Tones

unread,
Jul 1, 2021, 9:28:11 AM7/1/21
to TiddlyWiki
There seems to be a solution mentioned at the bottom of this thread https://stackoverflow.com/questions/12343922/codemirror-with-spell-checker

Unfortunately I do not know how to implement it, but it would be worth raising it on github, it looks it may be quite easy.

In CodeMirror 5.18.0 and above, you can set inputStyle: 'contenteditable' with spellcheck: true to be able to use your web browser's spellcheck features. For example:
var myTextArea = document.getElementById('my-text-area'); var editor = CodeMirror.fromTextArea(myTextArea, { inputStyle: 'contenteditable', spellcheck: true, });

The relevant commits that made this solution possible are:

Regards
Tones

Si

unread,
Jul 1, 2021, 4:50:09 PM7/1/21
to TiddlyWiki
@mehequeda

Somewhat off-topic but I noticed that you have a CamelCase link there. I've been pondering using them lately so I wondered if you use them for all your titles, and if so why did you choose to use CamelCase over Space Case?

PMario

unread,
Jul 1, 2021, 6:43:40 PM7/1/21
to TiddlyWiki
On Thursday, July 1, 2021 at 3:28:11 PM UTC+2 TW Tones wrote:
There seems to be a solution mentioned at the bottom of this thread https://stackoverflow.com/questions/12343922/codemirror-with-spell-checker

It needs a 700kByte dictionary for English alone. As I wrote, the biggest problems with these spell checkers is size.

-mario

Scott Kingery

unread,
Jul 1, 2021, 7:29:07 PM7/1/21
to TiddlyWiki
Thanks for posting this. Works great with the standard editor and Grammarly browser extension.  
 grammarly_tiddlywiki.jpg

TW Tones

unread,
Jul 1, 2021, 8:13:58 PM7/1/21
to TiddlyWiki
Mehequeda, Scot et al, thanks for sharing.


I think the solution would be well served if 
  • a wiki with code mirror allowed a full tiddler text editor, using a non-preview method "as well"
  • I have always felt it would be nice to get preview to open either side of the source and or above or below
    • This seems ever more relevant if we have a reason to show two editors at once. 
    • Perhaps the preview in a vertical arrangement would mean you can have more than one preview and editor open at a time , changing previews to checkboxes rather than radio selections.

I may have a go while I squirrel this solution away for later. 

Thanks all

Tones

PMario

unread,
Jul 2, 2021, 2:25:39 AM7/2/21
to TiddlyWiki
On Friday, July 2, 2021 at 1:29:07 AM UTC+2 Scott Kingery wrote:
Thanks for posting this. Works great with the standard editor and Grammarly browser extension.  

There are 2 problems I see with tools like this.

a) you need to be always online
b) You need to create an account and every word you type will be sent to their server.

I personally have a privacy issue here. TiddlyWiki is a tool that lets you own your data. I wouldn't want to connect it to a tool that spies on my data.

Just my opinion
-mario

unread,
Jul 2, 2021, 2:33:28 AM7/2/21
to TiddlyWiki

I’m with Mario – it’s a privacy issue…

Greetings
Stefan

unread,
Jul 2, 2021, 2:41:15 AM7/2/21
to TiddlyWiki
BTW: I would expect to see not correct spelled words in the output view.
I don't want to switch between 'output' and 'spell check'

Stefan

TW Tones

unread,
Jul 4, 2021, 7:26:21 AM7/4/21
to TiddlyWiki
Mario

I assume then if you do not want to use an internet dictionary as you source of word checks then perhaps you need the aforementioned 700k of data that is a dictionary. Of course the browser allows us to download a dictionary to use the spall check, but grammar is another thing. Arguably it lends itself to a consolidated online database. So with privacy comes reduced functionality "as a rule" when that functionality comes from an on demand database that someone else curates.

In am keen to know what you think about this apparent issue?

Tones
Message has been deleted

Carsten

unread,
Jul 4, 2021, 7:39:35 AM7/4/21
to TiddlyWiki
Need to correct my answer from before. The Solution provided by mehequeda (https://groups.google.com/g/tiddlywiki/c/PwoBZHggN2s/m/ojOUnblkAQAJ) works fine with LanguageTool. After you open the spell check preview, click into the field and the spellcheck will work.

PMario

unread,
Jul 5, 2021, 6:51:47 AM7/5/21
to TiddlyWiki
On Sunday, July 4, 2021 at 1:26:21 PM UTC+2 TW Tones wrote:

I assume then if you do not want to use an internet dictionary as you source of word checks then perhaps you need the aforementioned 700k of data that is a dictionary.

No. I'm perfectly fine with the "Spell Check" preview option, using the browser built-in dictionaries. ... Since I can install different versions, I can freely switch between them, without adding bloat to the wiki.
 
Of course the browser allows us to download a dictionary to use the spall check, but grammar is another thing. Arguably it lends itself to a consolidated online database. So with privacy comes reduced functionality "as a rule" when that functionality comes from an on demand database that someone else curates.

I think: If something is free, I am the product. I'm very sceptic to send personal content for grammar checking to a 3rd party server where non-European legislative applies.
 
In am keen to know what you think about this apparent issue?

I'm pretty sure, that I'm not the first one with privacy concerns. I'm pretty sure, that someone else did publish an open-source solution, that I could use.

If I really need grammar checking I would search for an open-source project, that provides some docker images, that I can build - test and tweak for my own purposes. Then I would try to find the source for a browser addOn that I can configure or tweak to connect to my own server.

I would probably have a closer look at: LanguageTool. I didn't fully reat their privacy statement yet, so I don't know, if I would trust them or not. But it looks interesting. Especially since I did find some docker related stuff already.

-mario

TW Tones

unread,
Jul 5, 2021, 6:20:43 PM7/5/21
to TiddlyWiki
Mario,

Thanks for the response. It is important for me to understand because you come from a stricter privacy approach than myself.

Regards
Tones
Reply all
Reply to author
Forward
0 new messages