JavaScript escaping backslash \ as I do not let this happen!

1

Good morning, I have a problem, I wanted some help from you. Something is causing the content passed in the function to escape the control bar \, I need them not to escape because this function renders a diagram where all of them are part of rendering.

    // escrevanatela('$$\gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt\,.$$');

    function escrevanatela(conteudo) {
      console.log(conteudo);
    // nesse momento meu parâmetro já mostra sem as \
      // '$$gamma(z) = int_0^infty t^{z-1}e^{-t}dt,.$$'
      document.getElementById("wm

d-input").value = conteudo;
  document.getElementById("wmd-button-bar").innerHTML = "";
    var converter = Markdown.getSanitizingConverter();
    Markdown.Extra.init(converter, {
      extensions: "all",
      highlighter: "prettify"
    });
    var editor = new Markdown.Editor(converter);
    editor.hooks.chain("onPreviewRefresh", prettyPrint);
    editor.run();
};

I already know how to solve or even propose solutions I thank D + !! hugs.

    
asked by anonymous 23.05.2017 / 14:57

1 answer

4

Try to use double bars for each bar you want to use effectively.

Something like:

escrevanatela('$$\gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt\,.$$');

function escrevanatela(conteudo) {
  console.log(conteudo);
}

Embrace

    
23.05.2017 / 15:16