It appears I have an issue passing a URL from markdown via a shortcode. File snippets as follows.
home.md:
{{< video >}} https://player.vimeo.com/video/146022717 {{< /video >}}
video.html:
<div class="resp-container"><iframe class="resp-iframe" src="{{ .Inner | markdownify }}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>
as rendered (index.html):
<iframe class="resp-iframe" src="#ZgotmplZ" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" frameborder="0"></iframe>
Any help appreciated!
maiki
2
The error is explained at https://golang.org/pkg/html/template/#ErrorCode.
To solve it, you probably want to pass it to safeURL
before or instead of markdownify
.
Thanks Maiki!
This is now resolved. Two revisions:
-
no spaces around the URL in home.md:
{{< video >}}https://player.vimeo.com/video/146022717{{< /video >}}
-
“markdownify” replaced by “safeURL”:
<div class="resp-container"><iframe class="resp-iframe" src="{{ .Inner | safeURL }}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>
system
Closed
4
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.