Turn off Spellcheck?

Hi

It looks to me as if the spell check attribute is not a feature of CSS - only HTML which is to be expected since CSS should change appearance and layout but not functionality or content although that line has been blurred a little.

My test word in the text area I am editing right now is below.

baad

I added spellcheck=“false” in the HTML for this editor whilst I was using it using Mozilla developer tools and observed that the spell checker no longer detected the word baad. Of course this was only a temporary change and one that only affects me locally.

If you can find out how to permanently change the HTML for the editor element in Tiddlywiki it might be the solution for you.

Regards the CSS route, it would seem there are experiments in this direction but it seems that browser support is currently not there. This fix would of course merely be a method for turning off the visual indications of a mis spelling but would not turn off the spell checker itself.

Thanks for that shortcut. I didn’t know about that. I usually need to do all the menu-clicking.

Thanks for digging up the info. … I didn’t know about that. After a very short test, it seems to be possible to enable the browser spell-checker on a per DOM element level.

So it should be straight forward to create a new toolbar button and even a keyboard shortcut, that does exactly that.

We would also need to create a small visual indicator, that the spellchecker is off. … Sometimes I do have text without a typo … sometimes :wink:

1 Like

I did create a GH issue: https://github.com/Jermolene/TiddlyWiki5/issues/6927 so it won’t be forgotten.

I’m not promising anything, but I would also appreciate this function quite a bit.

May be not a editor toolbar setting. May be page-toolbar setting. It would be possible to make that setting persistent. So the status will be saved and reloaded.

I would make the “per tiddler” setting temporary. It has the potential to create a lot of redundant state tiddlers, that are only needed for a short time period, but users will forget about them so they will be bloat

@ all: What do you think?

@pmario This is the direction I was heading if it turned out to be possible.

I would go with a global per-wiki setting rather than a per-tiddler setting. Isn’t that how the preview toggle works in the edit template? There would need to be an indicator above or below the textarea, and maybe in the Settings also.

100% agree.   

Of course the alternative approach is to have an additional dictionary to which you add terms found in macros so they are no longer highlighted as misspellings. Such dictionaries can be toggled on/off in the browser and can be used simultaneously with other dictionaries.

Perhaps one day in the future we could add custom addon dictionaries to tiddlywiki itself?, but until then looking at the code highlighting options may offer some relief, especially when previewing code.

I’m pretty sure, that the FireFox dictionary can’t add new terms. … Buf I’ve had a look, how to create custom browser dictionaries. Most browsers seem to use the “hunspell” library, which needs a “special” format that uses 2 different files. 1 file with the “word list” and 1 file with some “grammer rules”. …

The tricky part is, to create those 2 files in a convenient way. eg: Have a maintainable, human readable source structure PLUS a “build stack” that turns this structure into the requested result.

I posted a demo to enable/disable spellchecking here: https://amreus.tiddlyhost.com

The toggle affects any text-edit widget. It is possible the feature will be added officially soon.

It requires the 3 modified core tiddlers as listed. The state is saved with the wiki. There is no ControlPanel or other user interface other than the checkbox in the Customizations tiddler.

Questions? Issues?

1 Like

Can you document its effect when using codemirror please?

In short I can not answer that because I don’t know at this time.

I briefly looked at the codemirror plugin this morning and it looks to me like codemirror replaces the piece of tiddlywiki that makes the textarea, and so I think the changes I made will have no effect when used with codemirror. Put another way, the codemirror plugin would need to be modified to use the spellchecking toggle.

I think it more likely we need to;

  • Modify the spell check to cope with code mirror edit fields.
  • Just allow an option to view the same tiddler in a standard edit view for spell check.
  • Create a custom preview which is in fact the classic editor in which spell check can occur.

Create a custom preview which is in fact the classic editor in which spell check can occur.

edit-template-spell-check preview.json (621 Bytes)

You could make an alternate edit template that does the same thing.

Here I created a new editor preview that uses a simple edit text area, if using code mirror select preview “Spell check default editor” and click inside and you can use the standard browser spell checker. I also recommend ## Hidden Setting: Show Edit Preview per Tiddler

Is it possible to have spellcheck in the preview window on while it is off in the main editor window?

In my example with the special preview, the spell check is not operating on the codemirror editor, but does in the preview window, so gives you this result.

Hi Tony
I use the default TW editor and your solution does not work for me! Is there anything wrong in my side?

I did not come at it from this perspective, you can tun off spell check provided by the browser altogether to stop it on the TW Editor.

Incidentally spell checkers often don’t work on codemirror - so if you use codemirror then you must use the preview that uses the default editor (text area) to spell check. Which can be viewed simultaneously with the codemirror editor, thus the default editor allowed spell check.

The OT asked could it be selectively turned off, my suggestions was use code mirror, which does not use the spell checker and selectively use the special preview to enable spellcheck. Which is kind of reverse solution.

I think what you are asking for is a reverse of a reverse, an in this case two reverses don’t make a forward.

Perhaps restate your requirement in full and we try and find a solution for that.

Folks, just to have a place to store this otherwise I may lose it. As per this link, you can turn on (or off) spell check changing the package.json file of TW adding
“chromium-args”: “–enable-spell-checking”, and I just found that you can also do:

chrome.settingsPrivate.setPref(‘browser.enable_spellchecking’, true) // false to disable
chrome.settingsPrivate.setPref(‘spellcheck.dictionaries’, [“en-US”, “de-DE”,“pt-BR”], “null”, ()=>{}) // set

in the TW desktop browser console (pressing F12, going to console and typing (or copy/paste) for those who are not used to a console). In the case you are enabling it, if you didn’t have the dictionary, it will be downloaded to the dictionaries’ folder (on Linux: ~/.config/TiddlyDesktop/Dictionaries/ )

These settings can be enabled via a JS file, but I don’t know exactly which one I could use right now, so I did it through the console, as I’m a little bit out of time to make more tests. Maybe it could help to find a solution to enable it via control panel. Rgds…

2 Likes

I have already created this preview to use for spell checking when codemirror is installed, because browser spell checkers don’t work with code mirror, and share it here;

  • In a tiddler you are editing in code mirror, select the preview “Spell Check Default Editor” click into the preview and spell check works in there.
  • By installing code mirror you effectively disable spell check unless you use this work around.
    • There may be in browser tools that work with codemirror.

edit-template-spell-check preview.json (621 Bytes)

1 Like