aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJackson Ray Hamilton2019-03-24 09:55:14 -0700
committerJackson Ray Hamilton2019-04-08 22:48:22 -0700
commit8b92719b6b31d26299b5feae0ea92bb80f835e3d (patch)
treec406d203b06a1832de0b7d299f9ed0acad60e0be /test
parentbf37078df2cbea3a44a641ddbe40f11339c135a2 (diff)
downloademacs-8b92719b6b31d26299b5feae0ea92bb80f835e3d.tar.gz
emacs-8b92719b6b31d26299b5feae0ea92bb80f835e3d.zip
Improve JSX syntax propertization
* lisp/progmodes/js.el (js-jsx--attribute-name-re): New variable. (js-jsx--syntax-propertize-tag): Allow “-” in JSXAttribute names. Fix “out of range” error when typing at the end of a buffer. Fix/improve future propertization of unfinished JSXBoundaryElements. * test/manual/indent/js-jsx-unclosed-2.js: Add tests for allowed characters in JSX.
Diffstat (limited to 'test')
-rw-r--r--test/manual/indent/js-jsx-unclosed-2.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/manual/indent/js-jsx-unclosed-2.js b/test/manual/indent/js-jsx-unclosed-2.js
index 8b6f33325d7..843ef9b6a88 100644
--- a/test/manual/indent/js-jsx-unclosed-2.js
+++ b/test/manual/indent/js-jsx-unclosed-2.js
@@ -29,3 +29,11 @@ while (await foo > bar) void 0
29 </Baz> 29 </Baz>
30 </Bar> 30 </Bar>
31</Foo> 31</Foo>
32
33// “-” is not allowed in a JSXBoundaryElement’s name.
34<ABC />
35 <A-B-C /> // Weirdly-indented “continued expression.”
36
37// “-” may be used in a JSXAttribute’s name.
38<Foo a-b-c=""
39 x-y-z="" />