public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* How to preserve inline HTML when converting .md to .adoc?
@ 2019-10-29  9:06 Jakub Holý
       [not found] ` <9a1d9050-0882-4dbe-8892-865d205c00fd-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Holý @ 2019-10-29  9:06 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1145 bytes --]

When I convert my Markdown to Asciidoctor, an inline image gets removed:

Input:

---
> title: Cats
> --- 

**Subpages: [Tigers](/cats/tigers/)**
>
> <img style="margin:5px; float: left;" 
> src="https://placekitten.com/96/139"/>Cats are animals.


Pandoc command:

pandoc --verbose -s -f markdown+yaml_metadata_block -t asciidoctor page.md

Output:

= Cats
>
> *Subpages: link:/cats/tigers/[Tigers]*
>
> Cats are animals.
>

How do I get the image (and other inline HTML such as `<sup>`, 
`<aside>...`) preserved in some form? Is there some flag/filter/extension I 
can pass to Pandoc to keep those? 
If Pandoc at least printed the file name and line, fixing those manually 
would be easier...

Thank you for any tips!

Cheers, Jakub

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/9a1d9050-0882-4dbe-8892-865d205c00fd%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 2189 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to preserve inline HTML when converting .md to .adoc?
       [not found] ` <9a1d9050-0882-4dbe-8892-865d205c00fd-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2019-10-31  4:53   ` John MacFarlane
  0 siblings, 0 replies; 2+ messages in thread
From: John MacFarlane @ 2019-10-31  4:53 UTC (permalink / raw)
  To: Jakub Holý, pandoc-discuss


These  bits are raw HTML, and currently the asciidoc writer
omits any raw blocks and inlines except those marked "asciidoc".

That's because asciidoc(tor) doesn't have a dedicated syntax
for raw HTML.  There's a "passthrough" syntax, but this just
passes things through regardless of the output format; it
wouldn't be appropriate to pass through raw HTML to non-HTML
formats, so we didn't use this.

You can use a filter to convert raw inline HTML  to this
passthrough format.  Untested: run with
pandoc --lua-filter passthrough.lua my.md -o my.adoc

-- passthrough.lua
function RawInline(el)
  return pandoc.RawInline('asciidoc', '+++' .. el.text .. '+++')
end

Jakub Holý <jakubholy.net-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> When I convert my Markdown to Asciidoctor, an inline image gets removed:
>
> Input:
>
> ---
>> title: Cats
>> --- 
>
> **Subpages: [Tigers](/cats/tigers/)**
>>
>> <img style="margin:5px; float: left;" 
>> src="https://placekitten.com/96/139"/>Cats are animals.
>
>
> Pandoc command:
>
> pandoc --verbose -s -f markdown+yaml_metadata_block -t asciidoctor page.md
>
> Output:
>
> = Cats
>>
>> *Subpages: link:/cats/tigers/[Tigers]*
>>
>> Cats are animals.
>>
>
> How do I get the image (and other inline HTML such as `<sup>`, 
> `<aside>...`) preserved in some form? Is there some flag/filter/extension I 
> can pass to Pandoc to keep those? 
> If Pandoc at least printed the file name and line, fixing those manually 
> would be easier...
>
> Thank you for any tips!
>
> Cheers, Jakub
>
> -- 
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/9a1d9050-0882-4dbe-8892-865d205c00fd%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/m2v9s54itp.fsf%40johnmacfarlane.net.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-31  4:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-29  9:06 How to preserve inline HTML when converting .md to .adoc? Jakub Holý
     [not found] ` <9a1d9050-0882-4dbe-8892-865d205c00fd-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-10-31  4:53   ` John MacFarlane

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).