mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 15:39:33 +00:00
Fix html tag stripping
This commit is contained in:
parent
419f657619
commit
d90fb8f8a5
2 changed files with 5 additions and 3 deletions
|
|
@ -650,10 +650,13 @@ function noHtml(s)
|
|||
return (gsub( str, '(&(#?x?)([%d%a]+);)', entitySwap ))
|
||||
end
|
||||
|
||||
local cleaned = s:gsub("<[aA].->(.-)</[aA]>","%1")
|
||||
local cleaned = s:gsub("<[aA] .->(.-)</[aA]>","%1")
|
||||
:gsub("<abbr .->(.-)</abbr>","%1")
|
||||
:gsub("<span .->(.-)</span>","%1")
|
||||
:gsub("%s*<[iI].->(.-)</[iI]>","%1")
|
||||
:gsub("<.->(.-)</.->","%1") -- note: this does not handle nested tags
|
||||
:gsub("<.->(.-)</.->","%1") -- note: keep as last as this does not handle nested tags
|
||||
:gsub("^%s*(.-)%s*$", "%1")
|
||||
:gsub(' ', " ")
|
||||
|
||||
return unescape(cleaned)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue