I am trying to send data from Phoenix to Javascript in a template and have this code in the template:
var render_asciidoc = function() {
var content = "<%= Phoenix.HTML.raw @document.rendered_content %>";
However, JS is not interpreting the string = value of @document.rendered_content
as I would like it to – see this console message which comes from the resulting error:
var render_asciidoc = function() {
var content = "----
>>> Test
----
$a^2 + b^2 = c^2$
";
NOTE. the string @document.rendered_content
is
----
>>> Test
----
$a^2 + b^2 = c^2$