felipeochoa / rjsx-mode

A JSX major mode for Emacs
https://github.com/felipeochoa/rjsx-mode
MIT License
639 stars 32 forks source link

Multiline text #88

Open cosven opened 5 years ago

cosven commented 5 years ago

js2-jsx-mode (multiline): image

rjsx-mode (multiline): image

rjsx-mode (one line): image

vscode (multiline): image

felipeochoa commented 5 years ago

Is multi-line text part of the JSX spec?

cosven commented 5 years ago

I guess it is part of the spec since multiline text works in JSX, but I really don't know much about JSX spec.

ghost commented 5 years ago

Looks like should be supported: https://github.com/RReverser/acorn-jsx/issues/16

Sleepful commented 3 years ago

Hitting this bug right now, how would one go about fixing it?

felipeochoa commented 3 years ago

It would be updating rjsx-parse-single-attr to use a custom string parser for attribute values instead of relying on (js2-match-token js2-STRING) as it currently does.

Sleepful commented 3 years ago

I was trying to look at how js2-mode parses multi-line strings but I couldn't figure it out https://github.com/mooz/js2-mode/blob/master/js2-mode.el#L3761 Found that code for string literals but it's confusing u_u