Page MenuHomePhabricator

Typing quote or apostrophe in the section editor produces directional variants
Open, MediumPublic


How many times were you able to reproduce it?


Steps to reproduce

  1. Navigate to the article section editor interface (navigate to an article, tap an edit pencil)
  2. While editing, tap the ' or " key on the keyboard

Expected results

' or " are inserted

Actual results

One of the directional variants , , , or are inserted

Environments observed

App version: 6.2.0 1581
OS versions: iOS 12
Device model: X


The enwiki style guide forbids directional quotes and apostrophes:

Event Timeline

JoeWalsh renamed this task from Typing quote and apostrophe on new editor keyboard produces slanty 'smart' variants to Typing quote or apostrophe in the section editor produces directional variants.Feb 20 2019, 11:36 AM
JoeWalsh claimed this task.
JoeWalsh triaged this task as Medium priority.
JoeWalsh updated the task description. (Show Details)
JoeWalsh moved this task from Needs Triage to Bug Backlog on the Wikipedia-iOS-App-Backlog board.

This attempted fix broke autocomplete in other unexpected ways - for example if you typed "I'm it would replace it with "“I'm. I'm not sure if there's a less invasive way to have CodeMirror replace the directional quotes and apostrophes - extraKeys didn't work either. Another option for a fix would be replacing directional quotes and apostrophes in the wikitext before uploading it.

Ya we'd have to replace it in the wikitext sent to the edit preview API too...

JMinor added a subscriber: JMinor.

This issue also exists for mobile web on iOS, and I would guess on Android as well, given our limited control over keyboard behaviors.

I like the idea of potentially making the quotes "dumb" at submit time. Toni suggested perhaps via a confirmation dialog ("looks like you're quotes were smart we made them dumb, is that okay?"

It would also be good to understand if this affects other latin character languages, so we know if we should do this in all languages or just english. For example, what do we do about guillemets which inherintly have a direction and are used in French and other langs?

Until we have more clarity I'm moving this to Needs Acceptance Criteria

@Johan thoughts on ways to decide what to do here? See description for context. Basically the default keyboard behavior contradicts the style guide in english, and this is likely an issue across mobile, and potentially in other latin script languages. Do we let people do it anyway and hope a bot/user fixes it? Prevent it entirely? Ask the users? Is this an issue in any other languages?

Uh, so this is not going to be easy. for example states that in German the "dumb" quotes may only be used when the wikitext or HTML demand it and it isn't seen in the article. In all article text, curly quote marks are to be used.

Als Anführungszeichen sind in der deutschsprachigen Wikipedia ausschließlich typographische Anführungszeichen zu verwenden, einzugeben wie unten erklärt. Die Anführungszeichen des Schreibmaschinensatzes (") – erzeugt durch Umschalt + 2 bzw. Shift + 2 – sind im Artikeltext nicht zu verwenden. Diese Zeichen sind ausschließlich an solchen Stellen zu verwenden, wo dies für HTML- bzw. MediaWiki-konformen Quellcode zwingend notwendig ist, z. B. bei Einzelnachweisen (z. B. <ref name="NN">) oder bei Tabellenformatierungen (z. B. {| class="wikitable"). Sie sind dann nur im Quellcode und nicht im dargestellten Artikeltext sichtbar.

Als Anführungszeichen im Artikeltext sollen also in erster Linie „ und “ verwendet werden; für geschachtelte Anführungszeichen ‚ und ‘. is a good illustration of the problem of trying to standardise anything around quotation marks. Taking guillemets as an example: just in the main Scandinavian countries they vary between «Norwegian», »Swedish» and »Danish«.

The Swedish style guide, explicitly states that you're free to use dumb quotation marks, curly quotation marks or guillemets:

I'd strongly recommend against doing this for all languages.

There might be other languages where the same thing would be helpful, but in that case we should probably implement it on a per-language basis.

For clarity, is this the problem?

  • iOS, and therefore the iOS mobile app for editing Wikipedia, automatically converts straight ("dumb") quotation marks into curly ("smart") quotation marks.
  • This automatic conversion makes typing wikitext for formatting (e.g., italics) difficult.
  • In article text, the use of curly quotes is mandatory at dewiki and prohibited at enwiki.



We're less concerned about users typing wikitext for formatting since there is a dedicated toolbar that applies formatting to text. Typing bold and italic syntax with the iOS keyboard is cumbersome regardless of whether or not there are smart quotes since it auto-switches back to the default keyboard after typing an apostrophe. This behavior is useful for writing prose with apostrophes, so we'd like to keep it.

The other two items you mention are a good summary of the issue - the keyboard inserts curly quotes and apostrophes and there are differing rules around their use on different wikis.

I was able to change the punctuation settings from curvy apostrophe to straighter one (') on the iPad. Indeed, I learned from both sources (this one and that one) that I can go to the Settings app on an iPad. Then I should go to the General menu, press "Keyboards" and then disable "Smart punctuations" option. Speaking of which, the quotation mark became straighter again (").

To simplify: Settings app > General > Keyboards > disable "Smart punctuation"

The sources may have referred to iOS 11. Nonetheless, the disabling method also works for later versions, like iPadOS and iOS 13.7