convert list of lines to <li>