public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
From: Patrick Kenny <ptmkenny-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: How to convert from OPML to Markdown without escaping the Markdown
Date: Fri, 12 Apr 2019 02:41:47 -0700 (PDT)	[thread overview]
Message-ID: <1cc15235-38f9-49f9-a89b-bd37bf331ccb@googlegroups.com> (raw)
In-Reply-To: <yh480kef68xffn.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>


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

Ok, thanks, that's helpful.

The problem may stem from the OPML spec being vague and OPML having two 
rather different use cases: cataloging RSS feeds and storing outlines of 
books, task lists, and things in outlining software.

That said, the OPML spec <http://dev.opml.org/spec2.html> says this about 
the <outline> element:

*Text attribute  <http://dev.opml.org/spec2.html#textAttribute>*
> Every outline element must have at least a *text* attribute, which is 
> what is displayed when an outliner 
> <http://support.opml.org/basicOutlining> opens the OPML file. To omit the 
> text attribute would render the outline useless in an outliner. This is 
> what the user would see 
> <http://images.scripting.com/archiveScriptingCom/2005/10/14/badopml2.gif> -- 
> clearly an unacceptable user experience. Part of the purpose of producing 
> OPML is to give users the power to accumulate and organize related 
> information in an outliner. This is as important a use for OPML as data 
> interchange. 
> A missing text attribute in any outline element is an error. 
> Text attributes may contain encoded HTML markup.

So HTML tags should be allowed.  If HTML tags are allowed, then Markdown 
should be allowed as well, since it's basically a shorthand for HTML.

Upon further investigation, it's not just the * lists that get escaped.

Ordered lists 1. 2. 3. etc. are also escaped as 1\. 2\., and headers are 
escaped as \#\#\#\#.

So it seems to me that OPML is not handled correctly during conversion.

I can write a shell script to get around this, but maybe there's a better 
way?

On Friday, April 12, 2019 at 8:58:36 AM UTC+9, John MacFarlane wrote:
>
>
> The way the OPML reader and writer work is: 
>
> - <outline> elements correspond to section headings 
>   The text attribute is the heading text 
> - The contents of the _note attribute, if present, are 
>   parsed as Markdown and treated as text under the 
>   heading. 
>
> I have never used OPML myself, so I don't have a good 
> sense why it's this way; maybe someone else does. 
>
>
> Patrick Kenny <ptmk...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>> writes: 
>
> > I'm relatively new to Pandoc and hoping someone can point me in the 
> right 
> > direction. 
> > 
> > 
> > I created an outline in some software that exports to OPML.  This 
> outline 
> > contains HTML tags and Markdown (for example, lists made of *). 
> > 
> > 
> > So, when I export the outline to OPML, it looks like this: 
> > 
> > 
> >  <outline text="List title"> 
> > 
> >    <outline text="* Item 1" /> 
> > 
> >    <outline text="* Item 2" /> 
> > 
> >   <outline text="* Item 3" /> 
> > 
> > 
> > I converted from OPML to Markdown like this: 
> > 
> > 
> > pandoc -o -s myfile.md myfile.opml --from=opml --to=commonmark 
> > 
> > However, this results in the markdown being escaped: 
> > 
> > 
> > List title 
> > 
> > \* Item 1 
> > 
> > \* Item 2 
> > 
> > \* Item 3 
> > 
> > 
> > HTML tags are escaped similarly. 
> > 
> > 
> > How can I turn this escaping off? I want the markdown in the OPML file 
> to 
> > be preserved (treated as markdown) upon conversion to markdown. 
> > 
> > 
> > -- 
> > 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-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>. 
> > To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 
> <javascript:>. 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pandoc-discuss/7dd34cfd-e19f-47b2-a20c-0e62f3901ba4%40googlegroups.com. 
>
> > 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/1cc15235-38f9-49f9-a89b-bd37bf331ccb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

  parent reply	other threads:[~2019-04-12  9:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11 17:39 Patrick Kenny
     [not found] ` <7dd34cfd-e19f-47b2-a20c-0e62f3901ba4-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-04-11 23:58   ` John MacFarlane
     [not found]     ` <yh480kef68xffn.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2019-04-12  9:41       ` Patrick Kenny [this message]
     [not found]         ` <1cc15235-38f9-49f9-a89b-bd37bf331ccb-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2019-04-12 15:06           ` John MacFarlane
     [not found]             ` <m2mukvb6va.fsf-pgq/RBwaQ+zq8tPRBa0AtqxOck334EZe@public.gmane.org>
2019-04-12 16:26               ` Patrick Kenny
     [not found]                 ` <CAE3gDhw7PXHZPKu8SQH__ZV6xB2xv89ZOEx0B3Gd8pZ=-sB7pg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-04-12 19:35                   ` BP Jonsson
2019-04-13 10:38               ` BP Jonsson
     [not found]                 ` <bdf2bba3-35f6-4358-8340-550b9f2b6cac-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-04-13 10:59                   ` Benct Philip Jonsson
2019-04-13 11:17                   ` Benct Philip Jonsson
     [not found]                     ` <0605902c-ffad-1916-b5af-bf96041dc266-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-04-17 11:21                       ` Patrick Kenny
2019-04-12  8:41   ` 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=1cc15235-38f9-49f9-a89b-bd37bf331ccb@googlegroups.com \
    --to=ptmkenny-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).