Passthru not working

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Passthru not working

willwade
Any reason why imgur embed code (old and new) isn't working when outputting to html?

E.g.

+++
<iframe class="imgur-album" width="100%" height="550" frameborder="0" src="//imgur.com/a/2JDxe/embed"></iframe>
+++

+++
<blockquote class="imgur-embed-pub" lang="en" data-id="a/2JDxe"><a href="//imgur.com/a/2JDxe">DevAlpha - Gallery 1.1</a></blockquote><script async src="//s.imgur.com/min/embed.js" charset="utf-8"></script>
+++

Both are leading to blank spaces.. Any ideas?

Ted
Reply | Threaded
Open this post in threaded view
|

Re: Passthru not working

Ted
Use four (4) plus signs for the block method

++++
<iframe class="imgur-album" width="100%" height="550" frameborder="0" src="//imgur.com/a/2JDxe/embed"></iframe>
++++

NOTE: I could not get the iframe to render.

++++
<blockquote class="imgur-embed-pub" lang="en" data-id="a/2JDxe">DevAlpha - Gallery 1.1</blockquote><script async src="//s.imgur.com/min/embed.js" charset="utf-8"></script>
++++


Or use  [pass]

[pass]
<blockquote class="imgur-embed-pub" lang="en" data-id="a/2JDxe">DevAlpha - Gallery 1.1</blockquote><script async src="//s.imgur.com/min/embed.js" charset="utf-8"></script>



The triple-plus looks like it is only for inline
The markup +++<u>underline me</u>+++ renders as underlined text.

more info: http://asciidoctor.org/docs/user-manual/#passthru


- Ted @TedAtCIS
Reply | Threaded
Open this post in threaded view
|

Re: Passthru not working

mojavelinux
Administrator

On Tue, May 24, 2016 at 9:06 AM, Ted [via Asciidoctor :: Discussion] <[hidden email]> wrote:
The triple-plus looks like it is only for inline
The markup +++<u>underline me</u>+++ renders as underlined text.

Technically, you can use either the inline passthrough (+++) or the block passthrough (++++). However, the inline passthrough assumes the content is inside a paragraph, so you'll get paragraph tags around the content. The block version passes through the content without wrapping it.

I have a feeling the blank output is a secondary issue, depending on where you're viewing it. For example, if you're trying to do this on GitHub, it isn't going to work. GitHub does not allow passing through arbitrary HTML unless it is on the white list (which isn't much).

In general, when you use a passthrough like this, your immediate thought should be to introduce an extension. In the case of the image gallery, it is much better to write:

imgur::2JDxe[]

Then implement a block macro extension for "imgur". Now, your document is semantic and not coupled to the output format.

-Dan

--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen