From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/11772 Path: news.gmane.org!not-for-mail From: Ranjit Jhala Newsgroups: gmane.text.pandoc Subject: Re: readMarkdown Ignoring Links (in filter) Date: Sat, 17 Jan 2015 13:31:39 -0800 (PST) Message-ID: <0bf810ca-30b1-4a3d-81e3-614b75b427ca@googlegroups.com> References: <50c32618-284b-4990-bcc2-7627e17d3d42@googlegroups.com> <20150117193712.GA73003@localhost.hsd1.ca.comcast.net> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1525_1224255100.1421530299441" X-Trace: ger.gmane.org 1421530302 20075 80.91.229.3 (17 Jan 2015 21:31:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 17 Jan 2015 21:31:42 +0000 (UTC) To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCP7R3MY74LRBPFJ5OSQKGQELOO5D3A-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Jan 17 22:31:41 2015 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-ob0-f187.google.com ([209.85.214.187]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YCay5-0001Sv-Hg for gtp-pandoc-discuss@m.gmane.org; Sat, 17 Jan 2015 22:31:41 +0100 Original-Received: by mail-ob0-f187.google.com with SMTP id wo20sf2344398obc.4 for ; Sat, 17 Jan 2015 13:31:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :content-type:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe; bh=lCVP2AA4Fz8kDougzHQjBv4P0ZQgcsnCD83oj6EZoe8=; b=jkE9EUXB0fJv54GDGiwHy7IseAnm31bSv4f1yXrpv3GltLTi3uPSi4QtrBH24hPjjU C3WvxUqZJ5yqZL5NwQMjGTCMirAf785Q+XpQb93tVPPvWdgPTEFepg6BzBplDSGXcP+d Fb8D+sgVPHzv3vj5LTspbwiNVRpKaTyttGSqWZP2z2rCyvuWJ7NfLXHR5DrQWp3sIr7r VkdW6ocNTPd5NoH9uTgmvAbC1lOAZA6hGbltjnj3cHh2fK87IzwcD2kul2gyw/1X6bes wLgtxA2KJEEUCHwrW3KtGfwBubp27NoGEuSwnV4ovMBLZ3WXp71AGckA5J79KgRnkv2n PHGQ== X-Received: by 10.50.50.142 with SMTP id c14mr149306igo.13.1421530300801; Sat, 17 Jan 2015 13:31:40 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.107.152.80 with SMTP id a77ls1428687ioe.7.gmail; Sat, 17 Jan 2015 13:31:40 -0800 (PST) X-Received: by 10.50.13.2 with SMTP id d2mr151441igc.2.1421530300369; Sat, 17 Jan 2015 13:31:40 -0800 (PST) In-Reply-To: <20150117193712.GA73003-bi+AKbBUZKbivNSvqvJHCtPlBySK3R6THiGdP5j34PU@public.gmane.org> X-Original-Sender: rjhala-fWt/sZ2FBdz2fBVCVOL8/A@public.gmane.org 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:11772 Archived-At: ------=_Part_1525_1224255100.1421530299441 Content-Type: multipart/alternative; boundary="----=_Part_1526_1014643793.1421530299441" ------=_Part_1526_1014643793.1421530299441 Content-Type: text/plain; charset=UTF-8 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...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org . > >To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFFw@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. ------=_Part_1526_1014643793.1421530299441 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
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 rend= ered to the latex as
"\href{foo}{wiki}", while ins= tead
I want it to get rendered to (the equivalent = of "wiki \cite{@foo}").

Instead, what I want is to have

=   "this is [wiki][foo]= "

to= gether with

  "[foo]: http://www.foo.com"=

(el= sewhere in the document) to be converted to a link to www.foo.com.
(Which works just fine in the main document, but not t= he 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 l= atex, and
>getting the odd behavior, reproduced below
>via GHCi:
>
>> Prelude Text.Pandoc.JSON Text.Pandoc> readMarkdown  de= f "this is
>[wiki][foo]"
>
>Pandoc (Meta {unMeta =3D fromList []}) [Para [Str "this",Space,Str = "is",Space,
>Str "[wiki][foo]"]]
>
>
>Namely, the citation `[wiki][foo]` is read as a String, and hence w= hen
>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.
>
>
>--=20
>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, s= end an email to pando= c-discus...@googlegroups.com.
>To post to this group, send email to pandoc-...@googlegroups.com.
>To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/50c32618-284b-4990-bcc2-7627e17d3d42%40goog= legroups.com.
>For more options, visit https://groups.google.com/d/o= ptout.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@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.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_1526_1014643793.1421530299441-- ------=_Part_1525_1224255100.1421530299441--