Muut
May 16, 2017, 1:47pm
1
I am currently trying to solve an issue I have with some markdown HTML.
What I try to achieve is a -block. The code I want to use in the markdown file is as follow:
<a href="#" markdown="1"><div class="left">
## Title 1
![Description](test.png)
</div></a>
Now the problem is that the output of this is really unusable:
<p><a href="#" markdown="1"><div class="left"></p>
<h2>Title 1</h2>
<p><img alt="Description" src="/path/grav-admin/user/pages/03.de/01.home/_home1/test.png" />
</div></a></p>
I tried also other variants using without , but the output is also bad.
How can I get clean code?
Muut
May 16, 2017, 6:23pm
2
Try to put the within the
Muut
May 21, 2017, 10:18am
3
The result is even worse then:
— html
---
Muut
May 22, 2017, 4:49pm
4
what if you try this?
<a href="#"><div class="left" markdown="1">
## Title 1
![Description](test.png)
</div></a>
---
Muut
May 22, 2017, 7:03pm
5
This seems to be the best solution, as I get only one
block which isn’t that much in the way (I hope at least).
— html
---
Muut
May 22, 2017, 7:09pm
6
EDIT:
My answer above is wrong, as I didn’t see that the link will appear 2x.
— html
```
So I can also not use this solution...
Any other ideas?
Muut
May 22, 2017, 8:10pm
7
Hello,
Could you use a span
instead of a div
?
Muut
May 23, 2017, 7:25pm
8
Sorry, I hadn’t seen the h2
wich is also a block element…
Muut
June 3, 2017, 2:54pm
9
I created an issue for this: https://github.com/getgrav/grav-plugin-admin/issues/1126
Also I’m considering using Twig instead of markdown for this specific case. I noticed you can choose.
Muut
June 4, 2017, 8:27pm
10
This is really a limitation of Markdown Extra. it’s not very well supported and doesn’t get updated often (last commit was 2 years ago - https://github.com/erusev/parsedown-extra ), so i suggest not using markdown inside HTML, better to just use pure HTML with some Twig if you want to get the output you desire.