phoenix_markdown
phoenix_markdown copied to clipboard
Issue rendering images with EEX-generated urls
I am trying to use the phoenix route helpers (specifically the static_path
helper) to display an image from my app's static directory.
Rendering an image manually works (image gets displayed):

But using the eex tag to embed the URL does not. This:
 %>)
Just gets rendered in the document as 
.
I'm not familiar with how the library is put together but I wonder if this might be something similar to https://github.com/boydm/phoenix_markdown/issues/8.
Hi Horace.
I'm trying to replicate this by adding a test specific to image pages. It seems to be working for me.
You can see the test in the branch image_path.
Can you confirm that server-side parsing is turned on for that file by adding something really simple like <%= 11 + 2 %> and see that 13 gets rendered out to the page?
Thanks, --Boyd
Thanks Boyd - I just tested a basic <%= 2 + 2 %>
example and confirmed that it does work.
I also have already been using the route helpers to render links successfully. So a bit of markdown like this:
[Test](<%= Routes.test_path(@conn, :show) %>)
Is working to generate:
<a href="/test">Test</a>
But for some reason when I try the same thing with an image it is not coming through:
%>)
So I have just been entering those paths manually, e.g.

Which works fine, but I think it's nice to use the static_url
helper if you can because you get the digested asset urls that way.
Thanks for looking, let me know if I can give any more info.