public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Output-Format Plain removes Markdown-Hyperlinks []()
Date: Sat, 15 Jan 2022 15:41:43 +0100	[thread overview]
Message-ID: <c26e9460-27b6-ed81-2701-e1f3dcbac293@gmail.com> (raw)
In-Reply-To: <f3cf23c8-71a0-4825-812d-652b8d1ccc71n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>

Here with pandoc 2.16.2 `[TEXT](URL)` is automatically turned into `TEXT 
<URL>` in plain output, being smart enough to do the right thing if the 
URL appears in the link text or if it was `<URL>` already.

Anyway attached is a Lua filter which I use to get the same effect in 
other output formats.  Unless you are running a very old version of 
pandoc it should do what you want unless pandoc does it already.

On 2022-01-14 12:20, Peter Mueller wrote:
> Hello together.
> 
> I'm working on a project where we use one input markdown file to create
> HTML but also TXT files.
> The problem I have is with markdown hyperlinks in the form of []().
> 
> While for the output format html they are kept:
> *$ echo "prefix [this is a link](www.google.de) suffix" | pandoc -f
> markdown -t html*
> *<p>prefix <a href="www.google.de">this is a link</a> suffix</p>*
> 
> the url is completely removed for plain output:
> *$ echo "prefix [this is a link](www.google.de) suffix" | pandoc -f
> markdown -t plain*
> *prefix this is a link suffix*
> 
> Is there a way/plugin to keep the url within the plain output?
> (e.g.  by keeping the markdown  [this is a link](www.google.de) as it is,
> but handling all other markdown as usual?)
> 
> Thank you
> Peter
> 


  parent reply	other threads:[~2022-01-15 14:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-14 11:20 Peter Mueller
     [not found] ` <f3cf23c8-71a0-4825-812d-652b8d1ccc71n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-01-15 14:41   ` BPJ [this message]
     [not found]     ` <c26e9460-27b6-ed81-2701-e1f3dcbac293-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-01-15 14:44       ` BPJ

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c26e9460-27b6-ed81-2701-e1f3dcbac293@gmail.com \
    --to=melroch-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).