Page MenuHomePhabricator

iOS converts quotation marks into curly quotation marks
Closed, ResolvedPublicBUG REPORT

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Just to clarify if you mean iOS Web or the iOS app?

Jdrewniak claimed this task.
Jdrewniak subscribed.

From the original user report

@Home Lander: You can disable iOS "Smart Punctuation" under Settings, General, Keyboard. PrimeHunter (talk) 21:30, 3 February 2025 (UTC)
Thanks, that worked like a charm! Home Lander (talk) 00:46, 4 February 2025 (UTC)

It looks like the issue is due to Apple's Smart Punctuation feature, we can be disabled in iOS system settings. This is a non-standard feature so there's no way for us to disable it at the mediawiki/skin level, so I'm going to resolve this task since disabling those settings looks like the correct answer here.

DLynch reopened this task as Open.EditedFeb 10 2025, 5:09 PM
DLynch subscribed.

There actually is a way to disable this at the skin level. If you set spellcheck="false" on an input, smart quotes are one of the things that's disabled. See: webkit source. There's a trade-off, since it'd also stop autocomplete typo-fixing -- though historically that's frustrating-and-annoying at least as often as it's correctly fixing things, so: 🤷🏻

We could also obviously convert all curly quotes into basic quotes in php. strtr( $text, [ '“' => '"', '”' => '"', ] ) would be sufficient for the quotes iOS generates (though there's a bunch of other ones if we wanted to be thorough), and could be applied to search inputs. (Whether we should is a fair question -- depends on whether we think people are ever actually trying to do a literal search for a specific punctuation character, I guess?)

Jdlrobson-WMF subscribed.

I think adding spellcheck=false would be best addressed in the Codex TypeaheadSearch component given we are about to migrate Minerva to use it.

CCiufo-WMF subscribed.

We'll discuss this as a team, but otherwise feel free to submit a patch to Codex.

Codex already supports it, insofar as you don't block it. You just need to do:

<cdx-typeahead-search
    :spellcheck="false"
>

...and it'll work fine.

Change #1134288 had a related patch set uploaded (by DLynch; author: DLynch):

[mediawiki/skins/MinervaNeue@master] Set spellcheck=false on the searchbox input

https://gerrit.wikimedia.org/r/1134288

As such: ^ that patch.

That'll make it suppress smart quotes in the current system. Whenever you port it to Codex, you just need to remember to include the relevant attribute.

Codex already supports it, insofar as you don't block it. You just need to do:

It does! But it seems like a good default to have?

If not, we are definitely not blocked on doing this and can take the approach of patching the Vector implement, if we don't think that make sense as a default?

That'll make it suppress smart quotes in the current system. Whenever you port it to Codex, you just need to remember to include the relevant attribute.

I noted on commit message it's a little more involved than that. We'd also need to patch MobileFrontend since that's currently how most mobile users interact with search. That said given we're planning to remove the MobileFrontend code and integrate Codex TypeaheadSearch over the next 3 months I'd rather focus on a fix in TypeaheadSearch, than a short-lived one in Minerva. Hope that makes sense?

Change #1134302 had a related patch set uploaded (by DLynch; author: DLynch):

[mediawiki/extensions/MobileFrontend@master] Set spellcheck=false on the searchbox input

https://gerrit.wikimedia.org/r/1134302

I figure that it's a quick fix as-is, so if you're confident that you do want the behavior then we might as well fix it now and just plan on carrying that forward into the codex reimplementation.

Change #1135445 had a related patch set uploaded (by DLynch; author: DLynch):

[mediawiki/core@master] Set spellcheck=false on the searchbox input

https://gerrit.wikimedia.org/r/1135445

Change #1134288 abandoned by Jdlrobson:

[mediawiki/skins/MinervaNeue@master] Set spellcheck=false on the searchbox input

Reason:

I +2ed https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1135445 instead so this is not needed any more

https://gerrit.wikimedia.org/r/1134288

Change #1135445 merged by jenkins-bot:

[mediawiki/core@master] Set spellcheck=false on the searchbox input

https://gerrit.wikimedia.org/r/1135445

Change #1134302 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Set spellcheck=false on the searchbox input

https://gerrit.wikimedia.org/r/1134302