From: Harsh Donga <harsh-7+aFW328pE6p1wGUEcWPqti2O/JbrIOy@public.gmane.org>
To: pandoc-discuss <pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: Exception handling at writer end
Date: Mon, 12 Sep 2022 03:54:43 -0700 (PDT) [thread overview]
Message-ID: <3d3e093e-01a9-4d79-8ae4-4f402a88d69an@googlegroups.com> (raw)
In-Reply-To: <ACA07D6E-5281-4B5E-A11A-C1FF52F10A11-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 3969 bytes --]
Alright, so having additional logic to check conformity beforehand is the
key!
Thank you so much! Really appreciate the support I get always!
One of the best community!
On Monday, 12 September 2022 at 16:20:14 UTC+5:30 fiddlosopher wrote:
> Pandoc's `-f json` expects a JSON encoding of a Pandoc AST; it must
> conform to the constraints on the AST given by the types.
> If `pandoc -f json -t native` fails, it means that you haven't got a valid
> JSON serialization of a pandoc AST. So, you're not even getting to the
> writers.
>
>
> > On Sep 12, 2022, at 12:40 PM, Harsh Donga <ha...-7+aFW328pE6p1wGUEcWPqti2O/JbrIOy@public.gmane.org>
> wrote:
> >
> > If it's related to that, are there any options in Pandoc to skip or
> resolve it?
> > I believe it might be a reading issue (Since i am talking about ill
> formatted structure)
> >
> > Let's say here i am trying to make a BulletList but insert a heading
> object in between (out of structure) (Please refer first heading object
> inside bulletlist)
> > It does not conform to :
> https://hackage.haskell.org/package/pandoc-types-1.22/docs/Text-Pandoc-Definition.html#t:Block
> (BulletList [[Block]])
> > My intention to ask the question is if i can skip this element and
> process the rest to HTML?
> >
> > PFA : synthetically made Pandoc AST
> >
> > On Monday, 12 September 2022 at 16:02:58 UTC+5:30 fiddlosopher wrote:
> > Also, verify that your issue is not actually with reading the JSON.
> >
> > Try pandoc -f json -t native
> >
> > If this raises an error, then the issue is in how your JSON is
> formatted.
> >
> > On Sep 12, 2022, at 12:24 PM, John MacFarlane <fiddlo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> wrote:
> > >
> > > Generally this shouldn't happen; writers should be able to handle
> arbitrary ASTs.
> > > So let us know the particulars. Give a short example sufficient to
> reproduce the issue you're seeing.
> > >
> > >> On Sep 12, 2022, at 11:28 AM, Harsh Donga <ha...-7+aFW328pE6p1wGUEcWPqti2O/JbrIOy@public.gmane.org>
> wrote:
> > >>
> > >> Hey folks,
> > >>
> > >> Context : I am trying to convert Pandoc AST to HTML
> > >>
> > >> I would like to know if there is any exception handling done if let's
> say a particular block in Pandoc AST is erroneous (wrongly structured or
> placed).
> > >> For now, pandoc command (pandoc -t html pandoc.json -o pandoc.html),
> returns
> > >> err at block[x][y]
> > >> That is the whole conversion fails.
> > >>
> > >> Can that particular element be skipped or something else can be done?
> > >>
> > >>
> > >> Thanks in advance!
> > >> Regards,
> > >> Harsh
> > >>
> > >> --
> > >> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > >> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/ab7b37d0-be67-4e93-8298-31f7069fe2a8n%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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/pandoc-discuss/8e35756c-09ea-4050-9bf2-7c82c46e3e41n%40googlegroups.com
> .
> > <outPandoc.json>
>
>
--
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/3d3e093e-01a9-4d79-8ae4-4f402a88d69an%40googlegroups.com.
[-- Attachment #1.2: Type: text/html, Size: 6386 bytes --]
next prev parent reply other threads:[~2022-09-12 10:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-12 9:28 Harsh Donga
[not found] ` <ab7b37d0-be67-4e93-8298-31f7069fe2a8n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-09-12 10:24 ` John MacFarlane
[not found] ` <F3D0065A-EA1D-469E-8AD5-0CF3AAD84AE2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-09-12 10:32 ` John MacFarlane
[not found] ` <9D045A47-71E6-402F-A420-91F38CCD7EA1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-09-12 10:40 ` Harsh Donga
[not found] ` <8e35756c-09ea-4050-9bf2-7c82c46e3e41n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-09-12 10:50 ` John MacFarlane
[not found] ` <ACA07D6E-5281-4B5E-A11A-C1FF52F10A11-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-09-12 10:54 ` Harsh Donga [this message]
2022-09-12 10:37 ` Harsh Donga
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=3d3e093e-01a9-4d79-8ae4-4f402a88d69an@googlegroups.com \
--to=harsh-7+afw328pe6p1wguecwpqti2o/jbrioy@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).