FangYX Posted April 15, 2022 Share Posted April 15, 2022 I want to change Quote <span style="style_1">Text</span><br/><span style="style_1_italic">ItalicText</span> To Quote Text <i>ItalicText</i> How to do it? Link to comment Share on other sites More sharing options...
FangYX Posted April 15, 2022 Author Share Posted April 15, 2022 I've found it Quote Text='<span style="style_1">Text</span><br/><span style="style_1_italic">ItalicText</span>'; while(true) do NormalText = string.match(Text, '<span%sstyle="style_.">.-</span>'); ItalicText = string.match(Text, '<span%sstyle="style_._italic">.-</span>'); if NormalText ~= nil then Text = string.gsub(string.gsub(string.gsub(Text, string.gsub(string.gsub(string.gsub(string.gsub(string.gsub(string.gsub(string.gsub(string.gsub(string.gsub(string.gsub(NormalText, "%(", "%%("), "%)", "%%)"), "%%", "%%%"), "%+", "%%+"), "%-", "%%-"), "%*", "%%*"), "%?", "%%?"), "%[", "%%["), "%^", "%%^"), "%$", "%%$"), string.match(Text, '<span%sstyle="style_.">(.-)</span>')), "<br/>","\n"),"amp;",""); elseif ItalicText ~= nil then Text = string.gsub(string.gsub(string.gsub(Text, string.gsub(string.gsub(string.gsub(string.gsub(string.gsub(string.gsub(string.gsub(string.gsub(string.gsub(string.gsub(ItalicText, "%(", "%%("), "%)", "%%)"), "%%", "%%%"), "%+", "%%+"), "%-", "%%-"), "%*", "%%*"), "%?", "%%?"), "%[", "%%["), "%^", "%%^"), "%$", "%%$"), "<i>"..string.match(Text, '<span%sstyle="style_._italic">(.-)</span>').."</i>"), "<br/>","\n"), "amp;",""); else break; end end print(Text); Link to comment Share on other sites More sharing options...
Question
FangYX
I want to change
To
How to do it?
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.