Antonius Posted July 9, 2018 Share Posted July 9, 2018 Hi guys Can anybody help me to create workflow for wrapping plain text to HTML? I'd like to wrap this list item1 item2 item3 into <ul> <li>item1</li> <li>item2</li> <li>item3</li> </ul> The same question is for tables, I guess it's the similar to lists Link to comment
vitor Posted July 9, 2018 Share Posted July 9, 2018 (edited) Welcome @Antonius, There you go. Quick and dirty ruby: puts '<ul>' puts ARGV[0].split("\n").reject(&:empty?).map { |line| '<li>' + line + '</li>' } puts '</ul>' Select the text, press the shortcut, and it’ll be replaced. Edited July 9, 2018 by vitor Updated Workflow link Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now