From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/11773 Path: news.gmane.org!not-for-mail From: Matthew Pickering Newsgroups: gmane.text.pandoc Subject: Re: readMarkdown Ignoring Links (in filter) Date: Sat, 17 Jan 2015 22:58:46 +0000 Message-ID: References: <50c32618-284b-4990-bcc2-7627e17d3d42@googlegroups.com> <20150117193712.GA73003@localhost.hsd1.ca.comcast.net> <0bf810ca-30b1-4a3d-81e3-614b75b427ca@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1421535530 29770 80.91.229.3 (17 Jan 2015 22:58:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 17 Jan 2015 22:58:50 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCO2LGEC4AIBBJ6S5OSQKGQECW2C6GA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Jan 17 23:58:50 2015 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-la0-f56.google.com ([209.85.215.56]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YCcKO-0001cF-MH for gtp-pandoc-discuss@m.gmane.org; Sat, 17 Jan 2015 23:58:48 +0100 Original-Received: by mail-la0-f56.google.com with SMTP id q1sf791720lam.1 for ; Sat, 17 Jan 2015 14:58:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:sender:list-subscribe:list-unsubscribe; bh=8iPf1HvYVG7o7ZygI7sKmFp6N5kuhNBv/y6jJRO27FY=; b=YdSJieHFTMF3f/aV8+Q7RmUvWgvGOiAg+bOzPnhUYV+tl9Re09hN8mfwgI0VQADxNq OU75UClRKuHSlv8hNlKITvcOn+DapEhbWI7R7RcrncAht7TqjOKYi/V2AuGIkYGr4OMV kN6xBz3brioorA4LVA7bfN1bXZ7FbW8xjA5lx5K/yGM1o/DFIaXaUHdyP7+HlWm/beCG A3dzmuGN8OHcJVZ7QFoHDzVcIEf+AeiGfPiztobDM2VEM2tRL/l+KdU9dpIYKF/SsbdR n+TkvL+WoEtcg8jbN5e4yIJJEFphFlzZmFUQSfTjwYlepC/ajN++QKocEH3uUqGnG7FH UxUQ== X-Received: by 10.180.24.40 with SMTP id r8mr68101wif.3.1421535528350; Sat, 17 Jan 2015 14:58:48 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.180.81.7 with SMTP id v7ls540490wix.3.canary; Sat, 17 Jan 2015 14:58:47 -0800 (PST) X-Received: by 10.180.108.165 with SMTP id hl5mr1183451wib.7.1421535527093; Sat, 17 Jan 2015 14:58:47 -0800 (PST) Original-Received: from mail-la0-x236.google.com (mail-la0-x236.google.com. [2a00:1450:4010:c03::236]) by gmr-mx.google.com with ESMTPS id oi7si584657lbb.1.2015.01.17.14.58.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 17 Jan 2015 14:58:47 -0800 (PST) Received-SPF: pass (google.com: domain of matthewtpickering-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4010:c03::236 as permitted sender) client-ip=2a00:1450:4010:c03::236; Original-Received: by mail-la0-f54.google.com with SMTP id pv20so23789471lab.13 for ; Sat, 17 Jan 2015 14:58:47 -0800 (PST) X-Received: by 10.152.23.38 with SMTP id j6mr22492047laf.81.1421535526956; Sat, 17 Jan 2015 14:58:46 -0800 (PST) Original-Received: by 10.114.91.136 with HTTP; Sat, 17 Jan 2015 14:58:46 -0800 (PST) In-Reply-To: <0bf810ca-30b1-4a3d-81e3-614b75b427ca-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: matthewtpickering-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of matthewtpickering-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2a00:1450:4010:c03::236 as permitted sender) smtp.mail=matthewtpickering-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dkim=pass header.i=@gmail.com; dmarc=pass (p=NONE 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.org gmane.text.pandoc:11773 Archived-At: This is the limitation of the approach I suggested. The parsing happens in a completely separate environment to that of the original document. On Sat, Jan 17, 2015 at 9:31 PM, Ranjit Jhala wrote: > Yes, when I try [wiki](foo) then I get an href to "foo.pdf" which is not > what I want. > > That is, "[wiki](foo)" is parsed nicely but gets rendered to the latex as > "\href{foo}{wiki}", while instead > I want it to get rendered to (the equivalent of "wiki \cite{@foo}"). > > Instead, what I want is to have > > "this is [wiki][foo]" > > together with > > "[foo]: http://www.foo.com" > > (elsewhere in the document) to be converted to a link to www.foo.com. > > (Which works just fine in the main document, but not the bits that are > going through my filter... > > > On Saturday, January 17, 2015 at 11:37:27 AM UTC-8, John MacFarlane wrote: >> >> Are you sure you don't mean `[wiki](foo)`? >> >> `[wiki][foo]` will only be a Markdown link if the reference `foo` is >> defined elsewhere in the document. >> >> +++ Ranjit Jhala [Jan 17 15 06:03 ]: >> >Hi, >> > >> >I am writing a small filter for converting from markdown to latex, and >> >getting the odd behavior, reproduced below >> >via GHCi: >> > >> >> Prelude Text.Pandoc.JSON Text.Pandoc> readMarkdown def "this is >> >[wiki][foo]" >> > >> >Pandoc (Meta {unMeta = fromList []}) [Para [Str "this",Space,Str >> > "is",Space, >> >Str "[wiki][foo]"]] >> > >> > >> >Namely, the citation `[wiki][foo]` is read as a String, and hence when >> >converted >> >to LaTeX rendered the wrong way (i.e. without the HREF). >> > >> >I suspect I have the wrong `ReaderOptions` in `def` -- but I don't know >> >which flags to add. >> > >> >I am writing this filter following the suggestion from here: >> > >> > https://groups.google.com/d/msg/pandoc-discuss/Kd1L4Rg0dx0/NZvgcMcz9NQJ >> > >> > the above only happens inside the filtered blocks -- citations of the >> >above form work just fine when inside the "regular" >> > unfiltered document. >> > >> >Any suggestions would be most welcome! >> > >> >Ranjit. >> > >> > >> >-- >> >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 post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> >To view this discussion on the web visit >> > https://groups.google.com/d/msgid/pandoc-discuss/50c32618-284b-4990-bcc2-7627e17d3d42%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/0bf810ca-30b1-4a3d-81e3-614b75b427ca%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout.