acornjs / acorn-jsx

Alternative, faster React.js JSX parser
MIT License
646 stars 72 forks source link

Improper whitespace truncation #4

Closed sebmck closed 9 years ago

sebmck commented 9 years ago
require("acorn-jsx").parse('<p>foo <a href="test">bar</a> baz</p>;').body[0].expression.children[2];

results in

{ type: 'Literal',
  value: 'baz',
  raw: 'baz'

when it should be:

{ type: 'Literal',
  value: ' baz',
  raw: ' baz'
sebmck commented 9 years ago

Wow, awesome! Thank you!

RReverser commented 9 years ago

@sebmck Thanks, fixed.