liquid_feedback_frontend
annotate env/format/text_with_links.lua @ 1725:4a5a79a37db1
Render links in unit and area description, updated layout of unit and area box
| author | bsw | 
|---|---|
| date | Tue Sep 28 09:43:58 2021 +0200 (2021-09-28) | 
| parents | |
| children | c06c22e8ee35 | 
| rev | line source | 
|---|---|
| bsw@1725 | 1 function format.text_with_links(value) | 
| bsw@1725 | 2 value = encode.html(value) | 
| bsw@1725 | 3 value = string.gsub(value, "http[^%s:]*://[^%s]+", function(match) | 
| bsw@1725 | 4 return "<a href=\"" .. match .. "\">" .. match .. "</a>" | 
| bsw@1725 | 5 end) | 
| bsw@1725 | 6 return value | 
| bsw@1725 | 7 end |