gadicc / meteor-messageformat

MessageFormat i18n support for Meteor, with reactive templates
54 stars 22 forks source link

[V2] extract's JSX handler should allow newlines inside the MF tag #220

Closed Sabst closed 8 years ago

Sabst commented 8 years ago

Cannot extract MF information with attributes on different lines .

This works: <MF KEY="keyName">My text...</MF>

But this fails:

<MF
  KEY="keyName">My text...</MF>

This can be useful to split the line when there are many attributes:

<MF
  KEY="keyName"
  ATTR1="attr1"
  ATTR2="attr2"
  ATTR2="attr3">My text...</MF>
gadicc commented 8 years ago

Right you are! Fixed with meteor update :)

Sabst commented 8 years ago

That was fast, thanks! Looks like this is ok with one new line only.

Here are more tests:

<MF KEY='testKey1' ONE={1} TWO={2} THREE={3}>{`Test 1: {ONE} {TWO} {THREE}`}</MF>
<MF
  KEY='testKey2' ONE={1} TWO={2} THREE={3}>{`Test 2: {ONE} {TWO} {THREE}`}</MF>
<MF
  KEY='testKey3'
  ONE={1} TWO={2} THREE={3}>{`Test 3: {ONE} {TWO} {THREE}`}</MF>
<MF
  KEY='testKey4'
  ONE={1}
  TWO={2} THREE={3}>{`Test 4: {ONE} {TWO} {THREE}`}</MF>
<MF
  KEY='testKey5'
  ONE={1}
  TWO={2}
  THREE={3}>{`Test 5: {ONE} {TWO} {THREE}`}</MF>

I only see the items 1 and 2.

gadicc commented 8 years ago

Sorry... rushed this one out before going away for the long weekend :/ Latest release should finally close this I hope, please confirm.

Sabst commented 8 years ago

Just perfect! Thanks a lot!

gadicc commented 8 years ago

Great stuff! Thanks for reporting back.