False positives in spellchecker in macOS Monterey (spell checker and grammar)

I am finding that on macOS 12.4, occasionally the default spellchecker will flag false positives for certain words. I’ve just updated to v0.15.9, and tried disabling community plug-ins etc in case that was somehow relevant.

For example, in the following sentence, the word ‘off’ is marked as mis-spelled:

Turning the iPad off & on again fixed it.

In this example, changing the ‘&’ for the word ‘and’ causes the error to go away.

Turning the iPad off and on again fixed it.

This is not a general pattern though (it’s not that ‘any word before an & is flagged’) - it seems that certain arbitrary word combinations trigger it sometimes, and at least in this specific case, this triggering is persisting with the same sentence in the context of different notes, whether it’s copied and pasted or re-typed (I have memories of tracking down strange behaviour elsewhere in the past where invisible characters have somehow been inserted into seemingly identical strings).

Indeed, changing almost any of the surrounding words seems to effect it; none of the following has the error:

Turning it off & on again fixed it.
Turning the iPhone off & on again fixed it.

I understand that Obsidian is using the system spellchecker. I don’t know quite how that integration works or at what point this bug introduces itself, but have at least checked that a similar false-positive is not triggered with the same sentence in Pages on the same machine, for instance.

I can’t remember if I’ve seen this type of bug manifest on non-mac devices, but this specific example is not reproduce-able on my Windows desktop or my old MacBook running Big Sur (I made sure to also update Obsidian to v0.15.9 there as well). I can only specifically remember noticing it on this new (M1 Pro MBP) laptop.

It’s pretty distracting.

I am now noticing that I also get similar behaviour in this editor in Safari. I’m now trying to establish whether the same is also true for other browser-based editors (I suppose it could still be that shared Obsidian code used here is responsible, but this seems to point at it being more of a macOS bug).

StackEdit, which is using the browser’s spellchecker I think, is not triggering false positives with my test sentence.

Some more examples of things that do cause the error (always the word ‘off’):

The iPad off & on again.
Any iPad off & on again.

and some that don’t:

The iPad off & on again. //error
Word iPad off & on again.

Actually, I’m finding that the behaviour of this forum software vs the Obsidian app is slightly different in some cases, but it’s probably not worth listing too much, unless someone finds it useful to help diagnose.

Obsidian uses Apple’s spellchecker on mac.
Send the bug report to Apple.

Please re-read my bug report, I’ve made efforts to cross-check against other things also using the Apple spellchecker. Not that this means it isn’t an Apple bug, and it should be reported there, but it does seem there’s something somewhat peculiar to the Obsidian integration.

If you take the same text and you copy in textedit, what happens?

This happens because Apple’s spellcher does both spellcheck and grammar check.

We strongly recommend you to search the forum with possible keywords before submitting a new bug report. Please also try your repro steps with third-party plugins and custom CSS disabled and see if it’s still reproducible. If it’s an issue with third-party plugins or themes, try contacting the author for help.

Steps to reproduce

It happens randomly. Words will show in notes as red underlined indicating misspelled but they are in fact correct.

Expected result

Words in the dictionary or common words and spelled correctly should not be underlined red.

Actual result

Mix of things that are underlined some I expected some not.

Environment

  • Operating system: Mac Os x Catalina 10.15.7
  • Debug info:SYSTEM INFO:
    Obsidian version: v0.15.6
    Installer version: v0.14.2
    Operating system: Darwin Kernel Version 19.6.0: Mon Apr 18 21:50:40 PDT 2022; root:xnu-6153.141.62~1/RELEASE_X86_64 19.6.0
    Login status: logged in
    Catalyst license: supporter
    Insider build toggle: off
    Live preview: off
    Legacy editor: off
    Base theme: light
    Community theme: Oogie
    Snippets enabled: 2
    Safe mode: on

RECOMMENDATIONS:
Custom theme: for cosmetic issues, please first try updating your theme to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community theme and snippets.

Here is a normal word showing the problem:
Screen Shot 2022-07-15 at 7.32.43 PM

and here is a case where I’d expect all to be considered misspelled but they aren’t

Screen Shot 2022-07-15 at 8.41.28 PM


Additional information

Download and reinstall Obsidian. Attach a file where this happens in the sandbox vault.

Done

um, ok how and where do I do that? I looked in help in Obsidian searching for sandbox. Nothing

I looked in the Library/Application Support/obsidian folder under my username and there is nothing with sandbox in the name.

Sorry, but clueless here as to how to accomplish what you are asking me to do.

PS I have a file isolated that still shows the problem but no idea where or how to get it to you.

If you copy this text in an apple app or in chrome, is it misspelled?

Lower left corner click on ? then click on Open Sandbox vault. see if ti happens there.
You can upload the file anywhere you want and post a link here.

Copied into Textedit and still shows underlined red.

Screen Shot 2022-07-17 at 2.49.32 PM

I copied the text into a file in the sandbox but it’s not showing underlined.

Tried to drag the file onto the sandbox vault to upload it unchanged and nothing happens.

Made a duplicte of the file and founc the sandbox vault and added it and then restarted Onsidian and does notshow underlined red but my copy in my vault still does.

if this showing underlined in textedit, you should send this bug report to Apple. We use Apple spellchecker on Macs.

Perhaps Apple’s spellcheker is not a simple spellchecker and does some grammar check or semantic check. I don’t know.

This one does look like a grammar check:
Screen Shot 2022-07-17 at 2.49.32 PM

Good point, let me look into that.

updates:Apple spellcheck can look at grammar. Most apps have it as spelling and grammar under the Edit menu where you can set one or both options. However in Obsidian it is not implemented that way and in the Obsidian settings under Editor under spellcheck the only option is on or off. I’d like to try turning grammar off and seeing if that helps but I can’t do so in Obsidian. I had assumed that since it only said spellcheck that only that was enabled in Obsidian.

That’s interesting, TextEdit does indeed flag it in the same way - as mentioned, I’d tried Pages and another browser-based MD editor that I believed to be using essentially the same system, and they both didn’t.