Non-breaking spaces inside quotation marks would be appreciated

Off topic : Scrivener seems awesome ! I haven’t been able to use all the new features but the new zoom and so on… Great.

On topic :
In French, the words inside quotation marks have to be separated from the marks by a non-breaking space, that way : « Hello, my name is… » You don’t write «Hello, my name is…»

There is an option in Scrivener in the Correction tab to turn " into «».

Depending on your mac preferences, you can have spaces between the mark and the word (that way : « Hello ») or no space («Hello»).

If you choose to have spaces in the Mac preferences (« abc »), then in Scrivener, these spaces aren’t non-breaking ones. So at the end of the line, you might end up with a quotation mark alone. That way :

blablablabla blabla blabla blabla «
Hello » blablablabla blablablablabla

Not very nice. It takes many manual corrections.

Could it be possible, when you tick the boxed option below in Scrivener and the « abc » option in your Mac preferences to automatically have non-breaking spaces ? No big deal but it’d be practical.

Thx for reading :slight_smile:
That’s a great release !

That’s very strange, because Scrivener isn’t responsible for adding these quotation marks–Apple is. When you turn on that option, Scrivener simply tells Apple’s text system to “use smart quotes”, and Apple’s text system pulls the necessary quotes as set in the System Preferences. So there’s no code in Scrivener handling this other than an off/on switch.

Argh! In fact, I’ve just checked this further - this seems to be a nasty bug in High Sierra. Have you tested this on other programs? Exactly the same problem occurs in TextEdit and Pages. I tested on Sierra and it works fine. It seems that on High Sierra, Apple is using regular spaces rather than non-breaking spaces in the System Preferences smart quotes. On Sierra, it is using non-breaking spaces.

I’ll report this to Apple, but I suggest you do too, as this is a very nasty bug on their part.

As a workaround, you could set up replacements in System Preferences to swap these sequences for sequences with non-breaking spaces instead.

All the best,
Keith

I’ve submitted this bug to Apple as bug #35656639. For the next 3.0 update, I’ve also added some code that intercepts Apple’s smart quote insertion code and looks for a plain space at the start or end of the smart quote, and swaps it for a non-breaking space if necessary. Unfortunately it’s not possible to do this in all areas of the app, though, so this will only be a fix in Scrivener’s main text area and notes areas. Synopses and other areas will still be affected by the bug until Apple fixes it, so please do report it to Apple too.

Thanks and all the best,
Keith

Thx for the quick answer, the code and the bug report to Apple !!! That’s helping ppl !

I noticed this bug on previous versions of mac os and haven’t even noticed that Sierra had fixed it.
So I was to live with it on Scrivener 3…

I’ve just tested Scrivener 2 on an old macbook with Sierra. Space are non-breaking ones. Indeed.
I also tested Word on High Sierra. Spaces are non-breaking ones too. So Microsoft did some extra-coding.

I will definitely report this bug to Apple. Thank you very much for your help :slight_smile:

Bug reported :slight_smile:

That’s where it really matters. So that’s perfect. :slight_smile:

Great, thanks. Word is never a good app to use for testing Apple bugs, because Microsoft built their own text system from the ground up so relies on very few Apple technologies. But Mail, TextEdit, Pages and Apple apps as well as apps such as Scrivener that build on their core technologies will all have this smart quote bug.

At least I have a workaround for the main editor lined up. It’s a silly bug to have crept back into an OS though…