liquid_feedback_frontend
view env/util/wysihtml_preproc.lua @ 1792:fe28be5403e2
Better handling of combined sentence on suggestion rating
| author | bsw | 
|---|---|
| date | Wed Oct 20 16:21:32 2021 +0200 (2021-10-20) | 
| parents | 32cc544d5a5b | 
| children | 
 line source
     1 local function normalize_whitespace(str)
     2   str = string.gsub(str, "\194\160", " ")
     3   str = string.gsub(str, " ", " ")
     4   return str
     5 end
     7 function util.wysihtml_preproc(str)
     8   str = string.gsub(str, "<a>(.-)</a>", "%1")
     9   str = string.gsub(str, "<[ou]l>[^<>]*", normalize_whitespace)
    10   str = string.gsub(str, "</li>[^<>]*", normalize_whitespace)
    11   return str
    12 end
