Skip to content

Commit 9e917be

Browse files
committed
[closetag addon] Fix behavior when typing > after /
Closes codemirror#6038
1 parent ba80e30 commit 9e917be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

addon/edit/closetag.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
if (!tagName ||
7575
tok.type == "string" && (tok.end != pos.ch || !/[\"\']/.test(tok.string.charAt(tok.string.length - 1)) || tok.string.length == 1) ||
7676
tok.type == "tag" && tagInfo.close ||
77-
tok.string.indexOf("/") == (tok.string.length - 1) || // match something like <someTagName />
77+
tok.string.indexOf("/") == (pos.ch - tok.start - 1) || // match something like <someTagName />
7878
dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1 ||
7979
closingTagExists(cm, inner.mode.xmlCurrentContext && inner.mode.xmlCurrentContext(state) || [], tagName, pos, true))
8080
return CodeMirror.Pass;

0 commit comments

Comments
 (0)