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

234
Visualizações
  is inserted instead of the white-space for the redactor-js

Why   is inserted instead of the white-space after inserting the second space in the row between two words or numbers, e.g. 1 2. When I click on the HTML button I see 1  2. I think it is correct behavior but I don't understand does this happen because of the browser or there's any flag in the code which turn it on? I didn't find any documentation for the redactor-js.

Please find the source code by link https://github.com/html5cat/redactor-js

Please find the redactor (a new version) by link https://imperavi.com/redactor/

Steps to reproduce:

  1. open the link https://imperavi.com/redactor/
  2. clear the redactor
  3. write 1 2 (two spaces between)
  4. click on the HTML button
  5. check that there's 1  2 instead of 1 2

enter image description here

enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Its because in html when you have multiple spaces the browser will strip them out.

The &nsbp; is a html entity called a non-breaking space that allows programmers to over come this intended functionality.

https://www.w3schools.com/html/html_entities.asp

In this instance as its a WYSIWYG, it will replace multiple [space]'s with the html entity so that it displays as the user intends.

Specifically in this instance its handled by the browser and the "contenteditable" attribute.

https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Editable_content

about 4 years ago · Juan Pablo Isaza Relatório
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