Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

293
Visualizações
Convert Ordered and Unordered List to readable text with bullets/numbers on pasting in HTML textarea element

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.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda