Skip to content

Commit c90dc5d

Browse files
committed
Fixing crash on check for duplicate opening brackets
1 parent 3dfb030 commit c90dc5d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Source/String.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ internal extension String {
102102
newString += "<"
103103
break
104104
}
105-
105+
106106
//This will check for consecutive '<' characters (i.e. <underline> < </underline>)
107-
if(String(self[self.index(self.startIndex, offsetBy: scanner.scanLocation)]) == "<") {
107+
if scanner.scanLocation < self.count, String(self[self.index(self.startIndex, offsetBy: scanner.scanLocation)]) == "<" {
108108
//The next loop will catch the next '<'
109109
newString += "<" + tagString
110110
continue

0 commit comments

Comments
 (0)