This repository was archived by the owner on May 4, 2020. It is now read-only.
·
121 commits
to master
since this release
4.0.0 (2020-03-04)
Features
- intl-messageformat: combine formatHTMLMessage into format (d59fbf1)
- intl-messageformat-parser: Add native support for parsing XML tag (51c49fa)
BREAKING CHANGES
- intl-messageformat: We've modified the way we parse and format embedded
XML/HTML as follow:
formatHTMLMessagehas been combined withformat- All tags specified must have corresponding values and will throw
error if it's missing, e.g:new IntlMessageFormat("a <b>strong</b>").format({ b: (...chunks) => <strong>chunks</strong> }) - Self-closing tags are treated as string literal by default. We don't
allow formatting self-closing tags because we already use ICU
{placeholder}syntax for that. - XML/HTML tags are escaped using apostrophe just like other ICU
constructs. - Remove dependency on DOMParser and restrictions on void element like
<link>. This effectively means you don't need to polyfill DOMParser in
Node anymore
fix(intl-messageformat-parser): fix escaping for XML tag
- intl-messageformat-parser: This changes the AST and causes potential conflicts
with previous parser version
fix(eslint-plugin-formatjs): Adapt to new parser
chore(babel-plugin-react-intl): update package lock