diff --git a/src/ts/plugins/automark.ts b/src/ts/plugins/automark.ts index a2b1eab9..4ef9c421 100644 --- a/src/ts/plugins/automark.ts +++ b/src/ts/plugins/automark.ts @@ -2,10 +2,14 @@ const excludesDat = ['<','>','{','}','[',']','(',')','-',':',';','…','—','–','_','*','+','/','\\','|','!','?','.',',',' '] const selfClosingTags = [ 'br','hr','img','input','meta','link','base','area','col','command','embed','keygen','param','source','track','wbr', - '!' //for doctype and comment + //self closing tags defined by HTML5 + '!' + //for doctype and comment ] const checkSelfClosingTag = (dat:string) => { + dat = dat.substring(0, 10) //we only need to check the first 10 characters, to avoid checking the whole string + dat = dat.toLowerCase() //we don't care about the case for(const tag of selfClosingTags){ if(dat.startsWith(tag)){ return true