liquid_feedback_frontend
changeset 157:24e47baf5f9b
strip html from fallback title
if the slot is used for title, make sure the html is stripped from it
if the slot is used for title, make sure the html is stripped from it
author | Daniel Poelzleithner <poelzi@poelzi.org> |
---|---|
date | Fri Oct 08 20:31:09 2010 +0200 (2010-10-08) |
parents | 74f1d4abf19e |
children | 39d49cf933d8 |
files | app/main/_filter_view/36_html_title.lua |
line diff
1.1 --- a/app/main/_filter_view/36_html_title.lua Fri Oct 08 20:06:23 2010 +0200 1.2 +++ b/app/main/_filter_view/36_html_title.lua Fri Oct 08 20:31:09 2010 +0200 1.3 @@ -17,7 +17,8 @@ 1.4 -- but only if it does not contain config.app_title 1.5 -- (otherwise config.app_title would appear twice in title) 1.6 elseif slot.get_content( "title" ) ~= encode.html( config.app_title ) then 1.7 - app.html_title.title = slot.get_content( "title" ) .. " - " 1.8 + -- replace all html from the title first 1.9 + app.html_title.title = string.gsub(slot.get_content( "title" ), "</?[A-Za-z][A-Za-z0-9:_%-]*[^>]*>", ""):gsub("%s+", " ") .. " - " 1.10 end 1.11 1.12 -- add "-" to subtitle