shahryarjb

shahryarjb

How to use Phoenix html tag and support Safe html in markdown

Hello, I want to use Markdown-it in my phoenix, but I have a problem with Phoenix Tag, supposing that I don’t use phoenix tag and write normal html like this:

I have no problem until I want to use normal html , as you see this code works like this forums markdown editor .

but I have a problem when I use phoenix tag like this:

and now my code doesn’t work like original html , please see the pic:

it shows me a text but I need it to show me the markdown demo like the first code.
if I write the original html, it will work but now it is blow pic:

how can I fix this textarea‍‍‍ and show the demo of markdown? in the meantime I need much security in this!!

thanks

Marked As Solved

NobbZ

NobbZ

I told you, that in the original version you are using a div in the original and a textarea in the phoenix version, you told me that doesn’t matter, so I asked you, if I understand you correctly that it works with a handcrafted version that uses textarea, and now you tell me that you do not know?

Just stick to a div as a target for the rendered HTML, textareas are an input element, nothing you display rendered HTML with.

As I said already, div != textarea. Unless you have proven that a textarea works in handcrafted HTML, I will assume that this is the culprit.

And diff is a commandline tool in unixes that compares files and shows the actual differences, line by line.

Also Liked

NobbZ

NobbZ

It would have been easier if you had posted code rather than screenshots.

But for now on a quick glance it seems as if you create a textarea in the second example where you have a div in the first.

I’m wondering why you want that one handled by dynamic phoenix stuff at all, it looks as if all you need there is just an empty div.

NobbZ

NobbZ

So if you use a textarea in manually crafted HTML, it works as you expect it, while a textarea created by phoenix formhelpers does not?

Have you diffed the created Vs. The crafted HTML to be able to see the difference? Have you handcrafted a full form already or only standalone textarea?

NobbZ

NobbZ

It’s not that bad, misunderstandings happen, especially when both of us are not native speakers/writers.

Where Next?

Popular in Questions Top

aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

Other popular topics Top

Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement