I think the way to fix this is something like:

sentence_ending_punctuation = ['.', '!', '?', '…']

When someone types two spaces in a row {
    if (auto punctuation is turned on) {
        last_letter_position = the position of the last character in Unicode’s 
“Letter” category
        trailing_punctuation = the string between the last_letter_position and 
the first space
        if trailing_punctuation contains none of the characters from 
sentence_ending_punctuation {
            replace the last space with a period
        }
    }
}

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to ubuntu-keyboard in Ubuntu.
https://bugs.launchpad.net/bugs/1579083

Title:
  Typing two spaces after sentence-ending punctuation inserts a mistaken
  period (full stop)

Status in ubuntu-keyboard package in Ubuntu:
  Confirmed

Bug description:
  0. In System Settings, ensure that “Language & Text” > “Auto punctuation” is 
turned on.
  1. Focus any normal text field. For example, create a new note in Notes.
  2. Type “Hello” then press Space twice.
  3. Type “Hello.” then press Space twice.
  4. Type “Hello!” then press Space twice.
  5. Type “Hello?” then press Space twice.
  6. Type “Hello…” then press Space twice.
  7. Type “The usual greeting (Hello)” then press Space twice.
  8. Type “The usual greeting. (Hello.)” then press Space twice.

  What happens:
  2,3,4,5,6,7,8. An extra period is inserted.

  What should happen:
  2. An extra period is inserted.
  3. An extra period is NOT inserted.
  4. An extra period is NOT inserted.
  5. An extra period is NOT inserted.
  6. An extra period is NOT inserted.
  7. An extra period is inserted.
  8. An extra period is NOT inserted.

  Problem occurs with: Ubuntu 15.04 r323
  Does not occur with: iOS 9.3.1 (except cases 6 and 8), Android 6.0.1 (except 
case 8)

  Bug 1540373 is the equivalent for the TLD key (.com etc).

  [Originally reported by Bob Summerwill on the ubuntu-phone@ mailing
  list. <https://lists.launchpad.net/ubuntu-phone/msg20236.html>]

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-keyboard/+bug/1579083/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to