lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi list,

probably a trivial question to some of you, but I am stuck on this...
I'd like to replace the endings of lines from a HTML-formatted string,
using string.gsub(), according to the following criterion:

Each line ending on "\n" only, but not on "<br>\n", shall be modified
to end on "<br>\n"
Or in words: All lines should end on "<br>\n", but some lack the
"<br>", and if the "<br>" does not exist yet, generate it.

Anyone can assist me with the pattern to use please?

strung.gsub(strInput, ????, "<br>\n")

Thank you!
Daniel