From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31366 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Exception handling at writer end Date: Mon, 12 Sep 2022 12:50:06 +0200 Message-ID: References: <9D045A47-71E6-402F-A420-91F38CCD7EA1@gmail.com> <8e35756c-09ea-4050-9bf2-7c82c46e3e41n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21233"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDW7ZIEHTIIBBYU57SMAMGQETJC76NQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Sep 12 12:50:15 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lf1-f55.google.com ([209.85.167.55]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oXh15-0005J1-4B for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 12 Sep 2022 12:50:15 +0200 Original-Received: by mail-lf1-f55.google.com with SMTP id u3-20020a056512094300b00497a14e7589sf2732852lft.12 for ; Mon, 12 Sep 2022 03:50:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1662979814; cv=pass; d=google.com; s=arc-20160816; b=y1Xw70yeHaGqQrDIkwpvssBiQbqZWBym6khKZZWwL3tCiYjBwWoXM0/ilxHOUmUQKh E1GKw7p91xcm6V4ZWyLIp+AouVtHccAk//fEifkcoxy55QYgm9o4AOzaDTiz+sDLpJaG Q+CTRKpcgXKoK1Eeo57kc3GxKrJMjN9J9lBiaWES+rs+eyU7UWzL65uSlvC/ESRhzQEN XCGOuttzowPXVib/8zT9fx+9D7KZE4XxxMByEcV/bfppGOOMQSyQLdSK6yBI1xyuAVpp 0abpCQ9PRSMBZWV5uGi2RKP37l3BAmqPf+yStU1q0Ai+8Ude1bVXXFLYcuSHkVpVZBo3 LkDw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:message-id:in-reply-to:to :references:date:subject:mime-version:from:sender:dkim-signature :dkim-signature; bh=U9dohV6E+uJGF4drhdd73d66csTfl4rmjP2tLKJ9t0c=; b=sOMgUBncbX/ZDeJ2Y09WwOo39m/c4SV4nTWqCO6jwZ0dmRns0M//S7ws0CqEyNlkXK 9lLdyjngDBqfZ3Wx2/c8UAGSGZfVmRcU3r9LFF3wsk2Ek5cFxR56rcOuKpf3obUz02tN USVmYt/7GvHkRW0hGPCUSt42+5JL0bwUIRN6OCjFob+vC4jIIra4FZhmwoXXxI8dW97K UbO53148QuYq0ayLUAI+dYVnp3o/Cuv84zymdPZ1uncdhW3ePUa0k4DwRs9ayFZ90sK7 ++TQkQWhGtul7dO4tiyqYDSuqm0pie/tVWvHpVoijXXy+faql13XRLnOOvtOOyAGehDW 3eWA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KXyz3qPo; spf=pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::42b as permitted sender) smtp.mailfrom=fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:message-id :in-reply-to:to:references:date:subject:mime-version:from:sender :from:to:cc:subject:date; bh=U9dohV6E+uJGF4drhdd73d66csTfl4rmjP2tLKJ9t0c=; b=AIR/EPwAyMauVPhwfHoInuy4qq4iMbf1TzwMnvx6y3z41cboARiGRhVzt4tWqyAYMv eYBoupoksdipLX88MOOJIVHLiZZEjFtvLLDx6R/vr6fWU6CxnafVcSBr+dQfluQ0R7Qq Tz1GJwoumNZOFNkuO+iVj+6ojFAxUtURzV/2NvxDyPcBT7qr0DuC/7P8clhuFGT+Lyoa S/zwBqu2Os4bREVUs4drjwHqi1vcxatmELBcbseipXjQ8bJKTnUXaAZsP/473EKXyyEf YiYB82nGsbaUiUM5Wirobn5I0nD0NmbwoikvREDLAUjePg0ZEW7fLzHTbXoIBRgejk+S Xwow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:message-id :in-reply-to:to:references:date:subject:mime-version:from:from:to:cc :subject:date; bh=U9dohV6E+uJGF4drhdd73d66csTfl4rmjP2tLKJ9t0c=; b=QLcr6DfC7vr59uLUW8ANARVP+xjo8mPeRiLL/SQ+P2tC3/6A/sbUzKckaoVSgZE7pv oJ6gniYILFrTTgVAtulpLX3xZvcBI71qPxJqkOwyxNuv640Opjkt9fOhyO6ToOAc62SK GCsRcmLBAWrEvCEnNhoEYNnaB/Nzmcx+xMDt/AZv7LRotHz6jgY6dpkPaLPWbUlJGdkn 6p1fW7g6uCDFglsc7vTjBIk93dWPKTN6CFv2ojzNwvtndIHXpM0cK8fyUsYFHeB14T1B J8I9NVQRn0mWsDhnvVenJ+zY5/Xoyui1c2SGU2OaYldczjb1zezYAJXJ4eH1NebegDYg It/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:message-id :in-reply-to:to:references:date:subject:mime-version:from :x-gm-message-state:sender:from:to:cc:subject:date; bh=U9dohV6E+uJGF4drhdd73d66csTfl4rmjP2tLKJ9t0c=; b=dqgSvaB/O3p/P91YM9MuM+DmOy4bKmdlhcpzFxEi7jYN15ghLwdX+E685XvryM1iS9 ecEkvoHBaN0Om+JkAqwpDalq+wIv9AyXJBYgOUz8uoElXGSMiiQyuNUcmQESXPmMlO1+ qC34tBmceyMFvZH/Xmrf8d3WZg7Pq7PA0qZcrJt+Oa8umh8QcqCLA1Gu25wOZ0mg3ZEL 24sOEePmxR8sxVNrHYOGWrEHUB6crvRGKGd0UXu2SQIkC6X3OsynFhxCepojY0ZnbDMJ AuviLHm2o1f4R3jtV7TmIesDvYYbdbvJ/P5uNYYKSwyM3mUYLw6xf+KH5L0bq3UmqLn7 Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ACgBeo3/Y1JUch4AU0/NdsXAn3t2oEKiFEJycqE3KasomnOARu7ntPEE yVt/JrKk5DWkMmBrNHu7hTQ= X-Google-Smtp-Source: AA6agR5XTSEbLDepbdRGkjRAo7gGx3jh/7Efh2zCr27UWPUGeaG9V9/fQA5nV/QrZaQm3gG1J7BFHw== X-Received: by 2002:a05:6512:32c9:b0:492:f53d:9c1 with SMTP id f9-20020a05651232c900b00492f53d09c1mr8412929lfg.127.1662979814467; Mon, 12 Sep 2022 03:50:14 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:ac2:5e24:0:b0:49a:b814:856d with SMTP id o4-20020ac25e24000000b0049ab814856dls167599lfg.1.-pod-prod-gmail; Mon, 12 Sep 2022 03:50:09 -0700 (PDT) X-Received: by 2002:a05:6512:2987:b0:496:ae22:9147 with SMTP id du7-20020a056512298700b00496ae229147mr8272043lfb.97.1662979809534; Mon, 12 Sep 2022 03:50:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662979809; cv=none; d=google.com; s=arc-20160816; b=kAvFgbnYv3wgapKJbyd8kMdUw87XQiJ1BUaDotiwkFMsXbGb9A0hdl1DB8omKUBpnq HErIrWRbqaTybGqJe23ljs3A2MvHKCALXm2pPbHIsG1rDp0b1RVPsWU47n1JPOu+wzrc iNqxEGIKSBGE6276aYA15GwtSRgirPfvKFmhPEgWmmgEFGc0sXSqOU3/rFJDiu7kKu/w GTUQ4YKveV05fT499WimeYfoCp8anTZIPRrS5cAyLJkmEOlQfJaX5W97guzmCf8koW/7 YmcaU4r/gzCpiKvSQdqq1j1ASDxse1TdDRdipzX9gjO5iyEYy+TcJNQ609u1bQI2h+dB z1Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:dkim-signature; bh=8k/KGWGTex1oD7AK+Loh/I9Ycy0KgWPwvZpbioGKMtM=; b=rBI7z8ukS8VpXXBxV2KxbKk1QloS6Cs1BKbgCqnAyR4TVP33g9bTrHJWSeKBZTyHH+ 7HV6tIOpAwDZwDnLlAJ9qbprA9edoo2E1pwEmHVN8zEkNlxEhNosGHVWFYdPICzg3o6A P6hJJff0byg1WtP1/SIbPHAg1YLboAkuDCmgjuTup+mYTwF1Z6dA+rAg7lI+DtbtnlxW Oj74l29zB8S5Cmo/ruM1lk+BBaz62Kcj/+6hqcgb7/3mOycYimng7Qundgo13J70NySf U6yMTX0f2W80ViMDSWk+M765J1aq7E8eXHDf9ACa/8LBxVLnlFdJT2XIQTwWLWIbU4MJ UlqQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KXyz3qPo; spf=pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::42b as permitted sender) smtp.mailfrom=fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com. [2a00:1450:4864:20::42b]) by gmr-mx.google.com with ESMTPS id z13-20020a056512370d00b00498fd423cbdsi186272lfr.7.2022.09.12.03.50.09 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Sep 2022 03:50:09 -0700 (PDT) Received-SPF: pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::42b as permitted sender) client-ip=2a00:1450:4864:20::42b; Original-Received: by mail-wr1-x42b.google.com with SMTP id b5so14661876wrr.5 for ; Mon, 12 Sep 2022 03:50:09 -0700 (PDT) X-Received: by 2002:a5d:5a89:0:b0:228:639b:642f with SMTP id bp9-20020a5d5a89000000b00228639b642fmr14495678wrb.503.1662979808584; Mon, 12 Sep 2022 03:50:08 -0700 (PDT) Original-Received: from smtpclient.apple ([83.135.33.170]) by smtp.gmail.com with ESMTPSA id w10-20020a05600c474a00b003b482fbd93bsm4628063wmo.24.2022.09.12.03.50.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Sep 2022 03:50:07 -0700 (PDT) In-Reply-To: <8e35756c-09ea-4050-9bf2-7c82c46e3e41n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Original-Sender: fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KXyz3qPo; spf=pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4864:20::42b as permitted sender) smtp.mailfrom=fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:31366 Archived-At: 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 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 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 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-discuss+unsubscribe-/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. >