public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: BP Jonsson <bpjonsson-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: ultra clean conversion from html to org mode
Date: Thu, 31 Aug 2017 07:29:15 +0200	[thread overview]
Message-ID: <CAFC_yuTLQ3aj-j6CHgQekOPt-1oZgxp52QWR6X2rRjXunB7K5A@mail.gmail.com> (raw)
In-Reply-To: <877exkx2zw.fsf-YB6e1s5WF/He5aOfsHch1g@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2297 bytes --]

Piping pandoc's output through a simple text filter using Perl's text
match/line range operator should do the trick by not printing lines on and
between the begin/end HTML markers.

````perl
#!/usr/bin/env perl

use 5.010001;
use strict;
use warnings;
use utf8;
use open qw[ :utf8 :std ];

while(<>) {  # loop on STDIN
    if ( /^\#\+BEGIN_HTML/ .. /^\#\+END_HTML/ ) {
        # skip if on/between the fences
    }
    else {
        print $_;
    }
}

__END__
````

Den 30 aug 2017 21:36 skrev "Uwe Brauer" <oub-YB6e1s5WF/He5aOfsHch1g@public.gmane.org>:

>
> Hi
>
> I just converted
> https://www.theguardian.com/politics/2017/aug/30/may-to-
> press-japan-on-its-eu-trade-deal-in-hopes-of-a-model-for-uk
> To org mode using pandoc (pandoc 1.19 in Kubuntu 14.04)
>
> But the file containts lines such as
>
> #+BEGIN_HTML
>   <div itemprop="publisher" itemtype="https://schema.org/Organization">
> #+END_HTML
>
> #+BEGIN_HTML
>   <div itemprop="logo" itemtype="https://schema.org/ImageObject">
> #+END_HTML
>
>
> Couldn't they just be ignored in the conversion process since they don't
> provide much help for org
> mode.
>
> Thanks
>
> Uwe Brauer
>
> --
> 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/pandoc-discuss/877exkx2zw.fsf%40mat.ucm.es.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAFC_yuTLQ3aj-j6CHgQekOPt-1oZgxp52QWR6X2rRjXunB7K5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #2: Type: text/html, Size: 4328 bytes --]

  parent reply	other threads:[~2017-08-31  5:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30 19:35 Uwe Brauer
     [not found] ` <877exkx2zw.fsf-YB6e1s5WF/He5aOfsHch1g@public.gmane.org>
2017-08-31  0:04   ` John MacFarlane
2017-08-31 19:13     ` Uwe Brauer
2017-08-31  5:29   ` BP Jonsson [this message]
2017-08-31  7:43   ` Albert Krewinkel

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=CAFC_yuTLQ3aj-j6CHgQekOPt-1oZgxp52QWR6X2rRjXunB7K5A@mail.gmail.com \
    --to=bpjonsson-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).