From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/25155 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: code block translation from latex to html Date: Thu, 07 May 2020 21:45:14 -0700 Message-ID: References: <49108dd7-3ee5-41b5-9b8c-92c558ff46b5@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="109467"; mail-complaints-to="usenet@ciao.gmane.io" To: Umut Acar , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBZ6H2P2QKGQES4UIEVI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri May 08 06:45:30 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ua1-f60.google.com ([209.85.222.60]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jWut8-000SNG-5o for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 08 May 2020 06:45:30 +0200 Original-Received: by mail-ua1-f60.google.com with SMTP id r11sf199147ual.5 for ; Thu, 07 May 2020 21:45:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1588913129; cv=pass; d=google.com; s=arc-20160816; b=HiZiPzAYrw8Yp/xiZG1FwBotMOCjHZJ2lotN8nunJF0kP08cRvWU28hCfTBfrxlm6M 7MxjPtS60ERJMpBk2EsZynfO7065V9yjgoXFjGcABMKu1W5idpgwMXxTxHLfxVYay0iY 3odbVYBJU5Fc3Ktl9z7tbGOt1Tf6kJDzjRINx5i651E9UPj3HegfeiMrLOOkMSMSg/cJ WA3F4QFoe8/PnvpiV3XCa94HwCa8EKX10nee8iC0ci8HAnTp6xZgudJ7t7gkMI/HEeCL c1N/Uwz6r24DAtvzugT/G/htfcQnjclnf60j0tQuTijgL9Hn/sFRjrTstjceVv0wrnIK 7Ukg== 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:mime-version:message-id :date:references:in-reply-to:subject:to:from:sender:dkim-signature; bh=KqsLEtKIZEiU3NonfjCRnFmRSXjdm6AnZvuHbeCX+mo=; b=lnSDOFkUlIBzmaqIljC24HwgrcXnoNj3isx9JVOUddSH9VPgc8qtdTgW3/zudk+Coi SLuW5qgPmHEEf+UJEF4EnLAH5fh1aSoroxD1YGW7xVDA1juzfTSwG/YlKGpCLAqMPZtO C7oh0FsLB+GdI1N/mJsDWSi0BfyV5JqigLOwnLrTEtg86O8uTTaQAzIbVxYzJ0HpjqJ0 tprbrHRQspMT0JcxbI9HGTSj4fXu8qUtOK8oZM54FbmIB7oMqOhf4ahi1S4675uVuET2 QjG/QxjBzXeAwzvuFvnCVkprZTNSaXb9HOjOR3euYDvzSxU1TmQdpNz9C1B2TwNslFrj 5nDQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=0pmz0UNS; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::532 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=KqsLEtKIZEiU3NonfjCRnFmRSXjdm6AnZvuHbeCX+mo=; b=gAvdAlaPipIv4Wxe/AO1vQfKYgzAarrCSNs9dIARWT89GfgmA6Hk3y4MmpyyfDoAqP 3eDixnNXY+C9Aazp6SZYWW4TNMKUy6w+cRsx+kmY377EneXegWtQCKC7fUEdvUiAsZFV 7lMZVYx77z+2vCbUV2wWuhxS+1aUgTCZ7NtACB36PW3NeqXHoMeF6iB7ZKyLvwL0ML8+ e7Z0y60Utso9Pd0XacOPZ7JbxLYrbZPHIWfB48EJ0L/NpMfvIVN85Kpw4cczGJ1mzHNn SVj9RIm7r2z/x6QELW3nVFuwU0oJKN7yevECX5Bp3y5K4ZEkFR2hRBEgun+xDjSkU6Yl MpKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:subject:in-reply-to:references :date:message-id:mime-version:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=KqsLEtKIZEiU3NonfjCRnFmRSXjdm6AnZvuHbeCX+mo=; b=av2iGpJpYG2MHuyfT20Eu7Sg9lh32W/L7TJuNsoDHH2f8BmP3p/bRQ5TRlGkpoXnD3 iuzVWTQJkc1tmja05kjc1wNfHRqO9++m2uWb5h4uQdNZFepNl0uSZbtezY7cX9EqCgTW 0cOOkuVyQ4Wpoef6qY6mBRaIjuexiWNaP3jQjQ+0W6h8i7Zib3mtgUjJCTles6rxKkfV y+n3HnKKEvu1zEx5/BAI65j6sHe0gid4j0khdKh80TgJ3sTlyDJEqSOOq1y9PxZbwJxX rmTNnFaO+w2rP5AkDd4jxS+IHSqvUA/W03+I5Fyh3uuJ6oz6wEQW/qGXI/lX/pubqUIM ilvQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AGi0PuajUZToXUOtoiUMUXvPVFrH6SoaQC8bG2K+brp0oBUHEy0VnJZR a0j/cw1KL+l2MBEnHKO2D3Y= X-Google-Smtp-Source: APiQypLgqJtH0pdxWyT/Vs3MOwOn8tdIT8moGYiXKCGHAA7rZaV9XsoItN4sMeRxKgG8LL7PKjD3zA== X-Received: by 2002:a67:f597:: with SMTP id i23mr455803vso.137.1588913129259; Thu, 07 May 2020 21:45:29 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a1f:3fc2:: with SMTP id m185ls13705vka.7.gmail; Thu, 07 May 2020 21:45:27 -0700 (PDT) X-Received: by 2002:a1f:2245:: with SMTP id i66mr388306vki.61.1588913127542; Thu, 07 May 2020 21:45:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588913127; cv=none; d=google.com; s=arc-20160816; b=aIpHNd3criHgewuDz1M0ofEfirBoRlvd6Be3K7OVkUNLLbw4RgTCLmIay91VQPg4dD WVoTWS2BRBrSlV0t0sUNF/RkCJP1gMMgmwrDHLJFs2XcG2HKgnIGujpSAM/Y9K35MT2q MLxx1nAPrLRi5HG5ag2utjr6nOnzVn7Tbs6XVxfU1NjXqTcMxbqeCV7T2TQ+XHCUSD/3 z84dot8fZgxUS19/D2HGT0DjEgpwZtx3mVzUX+6Fo2t/P2nPMzNY37Lwe27iZlOGDNbS 0z2941btpltP5i4qqZQIZLdJ40aKiqvBms4QOBXz63dosUuWxghzOHFUkF7RzQjYae9S YeHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :dkim-signature; bh=3SXiuLHQ5vGsLfb2o3LKuz4foP0YFktaphBydumoCIk=; b=m8e5ewQdHmHpzrxAyVKfEhFH4PGW9wVyNEpZ1y6ejDe38qY5FBv7lpAFX0nWX/dheX 8gfa+b+9+hCjgFTcJmmxK2bnQemGgvc1+8rdkdzSKDyeXaEiVxisROvaup/zD9dTV4ow a4nDugrnTVobQBkflGTaL18j1KPbYAxNvlCHHwWfzO/y/2mPrALgJMDzWkuH/n4A8QZ7 hdw4q1UQMX/iIoGDQpNOIqoiNzo/wiHRSrOMQHkYM5acrAHKxsQSihvApdPjMEC9OVmc hAt1uYfJ67+iBaJ+1rK9f66dAQ+C/Oljux1NaxUeZntj775VcLmcm5dlRkh9fz87BdVV 3bMg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=0pmz0UNS; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::532 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com. [2607:f8b0:4864:20::532]) by gmr-mx.google.com with ESMTPS id a205si45885vsd.2.2020.05.07.21.45.27 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 May 2020 21:45:27 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::532 as permitted sender) client-ip=2607:f8b0:4864:20::532; Original-Received: by mail-pg1-x532.google.com with SMTP id b8so294438pgi.11 for ; Thu, 07 May 2020 21:45:27 -0700 (PDT) X-Received: by 2002:a63:6a82:: with SMTP id f124mr587287pgc.378.1588913126414; Thu, 07 May 2020 21:45:26 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id f10sm1223810pju.34.2020.05.07.21.45.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2020 21:45:25 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id 883FAA256; Fri, 8 May 2020 00:45:14 -0400 (EDT) In-Reply-To: <49108dd7-3ee5-41b5-9b8c-92c558ff46b5-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=0pmz0UNS; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::532 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/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.io gmane.text.pandoc:25155 Archived-At: You need to provide us with more to go on. By itself this input wouldn't produce highlighted code at all (no language is specified). Try this markdown sample: ~~~~~~ One: ``` {.haskell .numberLines} let x = tail y in x <> y ``` Two: ``` {.haskell .numberLines} x >>= y >>= z ``` ~~~~~~ This works fine. Line numbers are generated. The line numbers are links to the line (very useful!). The two snippets generate separate ids with links to separat elines. Without the 'numberLines' class you don't get the line numbers, and the lines are NOT links to themselves. When converting from LaTeX/listings, you'll need to add the numbers=left option to get numbering. In your output 2 (int) the line is not a link to itself (tested on browser just to make sure); there is an element but its content is empty since you don't have a line number. Umut Acar writes: > At some point after pandoc version 2.7.2, pandoc started translating code > blocks to html from LaTeX sources somewhat differently. > > For example, the code block > > ``` > \begin{lstlisting} > ... > 2 (int) > \end{lstlisting} > ``` > used to produce the following html > ``` > 2 ( class="dt">int) > ``` > It now produces the following > ``` > 2 ( class="dt">int) > ``` > > On a browser, the latter renders the code "int" as a html link to itself; > the code line is rendered as a link (to itself). > > Also, because the code anchor id's such as `cb2-4` are not unique (multiple > code blocks generate the same id's), clicking on a code line sends the > browser to the first instance of that id, usually somewhere up the page. > > The new translation is also dropping the code line numbers. > > Any thoughts about what might be going on and suggestions about how this > could be fixed? I would be happy with the prior behavior code lines were > not assigned anchor tags and were numbered serially. > > > > > -- > 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/49108dd7-3ee5-41b5-9b8c-92c558ff46b5%40googlegroups.com.