summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJackson Ray Hamilton <jackson@jacksonrayhamilton.com>2019-03-25 20:39:48 -0700
committerJackson Ray Hamilton <jackson@jacksonrayhamilton.com>2019-04-08 22:48:23 -0700
commit16669d7c5d5a0dfadf672f8359e431ef81044a23 (patch)
tree55d370ebbabd90345a34f081772a5a1ef81e7021 /test
parent84b1cfbc2d6b9236913a18ed192798fd530911db (diff)
downloademacs-16669d7c5d5a0dfadf672f8359e431ef81044a23.tar.gz
Fix counting of nested self-closing JSXOpeningElements
* lisp/progmodes/js.el (js-jsx--matching-close-tag-pos): Fix bug where self-closing JSXOpeningElements might be missed if one was nested within another. * test/manual/indent/jsx-self-closing.jsx: Add test for bug concerning self-closing JSXOpeningElement counting.
Diffstat (limited to 'test')
-rw-r--r--test/manual/indent/jsx-self-closing.jsx13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/manual/indent/jsx-self-closing.jsx b/test/manual/indent/jsx-self-closing.jsx
new file mode 100644
index 00000000000..f8ea7a138ad
--- /dev/null
+++ b/test/manual/indent/jsx-self-closing.jsx
@@ -0,0 +1,13 @@
+// Local Variables:
+// indent-tabs-mode: nil
+// js-indent-level: 2
+// End:
+
+// The following test goes below any comments to avoid including
+// misindented comments among the erroring lines.
+
+// Properly parse/indent code with a self-closing tag inside the
+// attribute of another self-closing tag.
+<div>
+ <div attr={() => <div attr="" />} />
+</div>