Skip to content
This repository was archived by the owner on Dec 17, 2018. It is now read-only.
This repository was archived by the owner on Dec 17, 2018. It is now read-only.

Handling of apostrophes is incorrect #2

@nkovacs

Description

@nkovacs

Copied from messageformat/messageformat#175

messageformat.js does not handle double apostrophes correctly.

var mf = new MessageFormat('en');

console.log(mf.compile("I see '{many}'")());
console.log(mf.compile("I said '{''Wow!''}'")());
console.log(mf.compile("I don't know")());
console.log(mf.compile("I don''t know")());

This should output (assuming DOUBLE_OPTIONAL):

  1. I see {many}
  2. I said {'Wow!'}
  3. I don't know
  4. I don't know

The first two don't work at all, and the fourth one outputs two single quotes instead of one.

See http://icu-project.org/apiref/icu4j/com/ibm/icu/text/MessagePattern.ApostropheMode.html
and http://userguide.icu-project.org/formatparse/messages#TOC-Quoting-Escaping

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions