summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJackson Ray Hamilton <jackson@jacksonrayhamilton.com>2019-03-24 09:55:14 -0700
committerJackson Ray Hamilton <jackson@jacksonrayhamilton.com>2019-04-08 22:48:22 -0700
commit8b92719b6b31d26299b5feae0ea92bb80f835e3d (patch)
treec406d203b06a1832de0b7d299f9ed0acad60e0be /test
parentbf37078df2cbea3a44a641ddbe40f11339c135a2 (diff)
downloademacs-8b92719b6b31d26299b5feae0ea92bb80f835e3d.tar.gz
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
</Baz>
</Bar>
</Foo>
+
+// “-” is not allowed in a JSXBoundaryElement’s name.
+<ABC />
+ <A-B-C /> // Weirdly-indented “continued expression.”
+
+// “-” may be used in a JSXAttribute’s name.
+<Foo a-b-c=""
+ x-y-z="" />