Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 53cbe28

Browse files
Minor fixes after review
1 parent f50e376 commit 53cbe28

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/language/HTMLUtils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,12 +400,12 @@ define(function (require, exports, module) {
400400
return createTagInfo();
401401
}
402402

403-
// Check to see if this is the closing of a tag (either the start or end) self closing tag
403+
// Check to see if this is the closing of a start tag or a self closing tag
404404
if (ctx.token.string === ">" || ctx.token.string === "/>") {
405405
return createTagInfo();
406406
}
407407

408-
// Check to see if this is the closing of a tag (either the start or end) closing tag
408+
// Check to see if this is a closing tag
409409
if (ctx.token.string.charAt(0) === "<" && ctx.token.string.charAt(1) === "/") {
410410
return createTagInfo(CLOSING_TAG, offset - 2, ctx.token.string.slice(2));
411411
}

test/spec/CodeHintUtils-test.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -186,16 +186,6 @@ define(function (require, exports, module) {
186186
expect(tag).toEqual(HTMLUtils.createTagInfo(HTMLUtils.TAG_NAME));
187187
});
188188

189-
it("should not hint anything inside a closing tag", function () {
190-
var pos = {"ch": 0, "line": 0};
191-
setContentAndUpdatePos(pos,
192-
["<html>", "<body>", "<div id='test' class='foo'></div>"],
193-
"</body></ht", "ml>");
194-
195-
var tag = HTMLUtils.getTagInfo(myEditor, pos);
196-
expect(tag).toEqual(HTMLUtils.createTagInfo(HTMLUtils.CLOSING_TAG, 2, "html"));
197-
});
198-
199189
it("should find the tagname of the current tag if two tags are right next to each other", function () {
200190
var pos = {"ch": 0, "line": 0};
201191
setContentAndUpdatePos(pos,
@@ -247,6 +237,16 @@ define(function (require, exports, module) {
247237
expect(tag).toEqual(HTMLUtils.createTagInfo());
248238
});
249239

240+
it("should not hint anything inside a closing tag", function () {
241+
var pos = {"ch": 0, "line": 0};
242+
setContentAndUpdatePos(pos,
243+
["<html>", "<body>", "<div id='test' class='foo'></div>"],
244+
"</body></ht", "ml>");
245+
246+
var tag = HTMLUtils.getTagInfo(myEditor, pos);
247+
expect(tag).toEqual(HTMLUtils.createTagInfo(HTMLUtils.CLOSING_TAG, 2, "html"));
248+
});
249+
250250
it("should not find attributes in an empty editor", function () {
251251
var pos = {"ch": 0, "line": 0};
252252
var attrs = HTMLUtils.getTagAttributes(myEditor, pos);

0 commit comments

Comments
 (0)