liquid_feedback_frontend
annotate env/format/text_with_links.lua @ 1806:1899c603abf2
Fixed layout of checkbox label in survey
| author | bsw | 
|---|---|
| date | Thu Nov 18 14:53:16 2021 +0100 (2021-11-18) | 
| parents | c06c22e8ee35 | 
| children | 
| rev | line source | 
|---|---|
| bsw@1725 | 1 function format.text_with_links(value) | 
| bsw@1725 | 2 value = encode.html(value) | 
| bsw@1728 | 3 value = encode.html_newlines(value) | 
| bsw@1725 | 4 value = string.gsub(value, "http[^%s:]*://[^%s]+", function(match) | 
| bsw@1725 | 5 return "<a href=\"" .. match .. "\">" .. match .. "</a>" | 
| bsw@1725 | 6 end) | 
| bsw@1725 | 7 return value | 
| bsw@1725 | 8 end |