notepad4 icon indicating copy to clipboard operation
notepad4 copied to clipboard

Text to HTML

Open meteorquake opened this issue 3 years ago • 1 comments

Hopefully the title says it all, it's a very common task which I couldn't spot a menu for (unless I'm mistaken!). Basically, you would highlight some text and this command will -

  1. Convert & < > to &amp; &lt; &gt;
  2. Lines with tabs on should have tabs replaced with </td> <td> and the line extremities appended with <tr> and </tr> ----- the start and end of a block of such lines should have <table> and </table>
  3. Lines without tabs should be surrounded by <p> and </p> or appended <br> according to option chosen
  4. Possibly detect a sequence of starting numbers or letters and treat them as <li> --- useful particularly when the selection is targeting such a block
  5. An option for whether to follow html or xhtml tag rules. The above items 1-4 could be pre-ticked so you can untick them to disable that task; for example the text might be already entitised. I suspect conversion of text to html is quite a common task. There are probably some sophisticated online web sites to do so but usually one is only looking for a really basic conversion of entities and tables and probably sufficiently frequently for any web-coder to merit having a menu command to do so. The result doesn't have to be perfect as obviously one would then tweak it. David

meteorquake avatar Dec 30 '21 08:12 meteorquake

  1. Convert & < > to & < >

This is what Edit -> Special -> Escape HTML/XML Chars does.

SciTE has a full featured (contains code folding script) HTML exporter, which can be ported,

zufuliu avatar Dec 30 '21 13:12 zufuliu

Mark this as duplicate of #592, please comment on that issue.

zufuliu avatar Jan 12 '23 23:01 zufuliu