I'm trying to find a solution to convert ordered and unordered list from a webpage when copy-pasted to a textarea should be converted to readable list.
Please check following fiddle for better explanation:
https://jsfiddle.net/bodmwghj/2/
<textarea id="final"></textarea>
If we copy paste list from webpage to our input textarea field it loses the "bullets" / "numbers"
Instead if we can prepend the list items with atleast a bullet • symbol and a space that would make more sense and would keep text still readable without having to allow HTML or using tinyMCE editors.
I feel this would be more tricky but if we can append incremental numbers to ordered list, nothing like it, but I am okay to bring bullets there as well if numbers can't be generated on the fly.
So far I could find addEventListener for "paste" event, but I am confused how I can reach the desired solution.
Please let me know if I can explain any further. Hope I can find a solution to this. Any help / possible pointers to solutions is appreciated.
EDIT: Copied text may include formatted HTML and other text. Requirement is only to convert lists. JS Fiddle URL updated.