Skip to content

Commit

Permalink
Correctly handle typed "<tag>"
Browse files Browse the repository at this point in the history
  • Loading branch information
Infocatcher committed Apr 4, 2014
1 parent 35d44a0 commit d745419
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion insertTag.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,11 @@ function insertTag() {

if(tagTyped) {
var first = tag.charAt(0);
if(first == "<" || first == "[") {
if(first == "<" || first == "[") { // [tag -> tag
useBBCode = first == "[";
tag = tag.substr(1);
if(tag.charAt(tag.length - 1) == (useBBCode ? "]" : ">")) // tag] -> tag
tag = tag.slice(0, -1);
}
}

Expand Down

0 comments on commit d745419

Please sign in to comment.