melmothx / text-amuse

Text::Amuse parser
http://www.amusewiki.org
5 stars 2 forks source link

Improve unmatched tag warnings #56

Closed link2xt closed 5 years ago

link2xt commented 5 years ago

First, do not use sprintf, because $string may contain format string specifiers.

For example, if the document contains <em> -->%2$s<--, the warning reads

Warning: Found open tag em  in <<em> -->em<--

Second, chomp the $string before printing it, so > appears on the same line.

Third, print "without a matching opening tag" when present tag is opening one.

melmothx commented 5 years ago

I'm going to add a test, though.

Btw, the sub ($$) prototype is not really needed and unclear why would you need it. AFAIK current practice is not to use that.

link2xt commented 5 years ago

@melmothx Re: prototype, it can be removed. You are right that they are not recommended now.