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

262
Visualizações
How do I format a string from python to javascript to HTML mantaining python format character

I am trying to reformat a string that come form python pass to Javascript and end in html.

String: = "Hi how \n are you"

I am using the following command in Javascript

HTML.textContent = String.text

HTML is the name of the tag where the the String.txt will be rendered. The problem is that the "\n" syntax present in python to "go newline" is not maintained

I am trying the following command to reformat

my_content = myquestion.text.replace("\n","NL")

where the \n shoul be replace with NL that should indicate new line. I mean that \n should be replace by "< b r >" in html

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