-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
- version:
nodeversion: 12yarnversion: 1.22react-intlversion: 2.9.0
Do you want to request a feature or report a bug?:
bug.
(would be a feature if this functionality is missing altogether)
What is the current behavior?:
When using FormattedHTMLMessage to parse the following string -
Sample message string : Hello <span class='bold'>'{name}'</span>
I'm getting an 'unexpected token' error.
yarn run v1.22.4
$ extract-messages -l=messages -o dist -d en './src/components/**/!(*.test).js'
SyntaxError: [React Intl] Message failed to parse. See: https://formatjs.io/docs/icu-syntax
SyntaxError: Expected "#", "'", "\n", "{", argumentElement, double apostrophes, end of input, or tagElement but "<" found. (This is an error on an internal node. Probably an internal error.)
at File.buildCodeFrameError (/project/node_modules/@babel/core/lib/transformation/file/file.js:248:12)
at NodePath.buildCodeFrameError (/project/node_modules/@babel/traverse/lib/path/index.js:144:21)
at getICUMessageValue (/project/node_modules/extract-react-intl-messages/node_modules/babel-plugin-react-intl/dist/index.js:66:27)
at evaluateMessageDescriptor (/project/node_modules/extract-react-intl-messages/node_modules/babel-plugin-react-intl/dist/index.js:113:26)
at processMessageObject (/project/node_modules/extract-react-intl-messages/node_modules/babel-plugin-react-intl/dist/index.js:388:38)
at Array.forEach (<anonymous>)
at PluginPass.CallExpression (/project/node_modules/extract-react-intl-messages/node_modules/babel-plugin-react-intl/dist/index.js:415:38)
at newFn (/project/node_modules/@babel/traverse/lib/visitors.js:179:21)
at NodePath._call (/project/node_modules/@babel/traverse/lib/path/context.js:55:20)
at NodePath.call (/project/node_modules/@babel/traverse/lib/path/context.js:42:17)
error Command failed with exit code 1.
What is the expected behavior?:
Expecting this to be extracted like the other messages.
Suggested solution:
Metadata
Metadata
Assignees
Labels
No labels