From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31523 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "szho...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" Newsgroups: gmane.text.pandoc Subject: =?UTF-8?Q?pandoc_2.19_"flattens"_text_in_table_of?= =?UTF-8?Q?_contents,_no_more__=E2=80=94_workaround=3F?= Date: Tue, 11 Oct 2022 11:55:52 -0700 (PDT) Message-ID: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_38_762347484.1665514552536" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14174"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCG5XQVJVUJBBOPYS2NAMGQEMV7OVTY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Oct 11 20:55:57 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oi1-f184.google.com ([209.85.167.184]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oiKQ1-0003Rm-8V for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 11 Oct 2022 20:55:57 +0200 Original-Received: by mail-oi1-f184.google.com with SMTP id z10-20020a056808028a00b00354b8b0ff15sf1434954oic.13 for ; Tue, 11 Oct 2022 11:55:57 -0700 (PDT) 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-sender :mime-version:subject:message-id:to:from:date:sender:from:to:cc :subject:date:message-id:reply-to; bh=RhK7KH35q/sT9rpp8L6ov24cv2uSB52/mONsAXYogng=; b=rWsO67KDHgM02fshX8J54revSG6u+QzwSzoS2840xLXP8f3inwXYrYlxP0PmkQ6jPX uKNb08HrmQ63sSJt7opSpoxFUt4MCpSYe83ORdJs1sY9kttwNY0SWjAhzhNsPq2BPRWS 2fhHsdzTysz0P5ELhk99Ut0fqsHEPtkrOgSn/7aw9dz9e1SbDE+QDH4kw1mxh33adiQ5 Jgtr5EQcX3WF3hjZ1D8ZFPDGLqNFJEwBTXYvIiH/hahYs+SXRsyWn40GB76qw6JVAJNR pq5Um1hXSAo3eyzSc/O0jS/WdfDiT9vltGM5uyJVA3epeiPXkEwAxvM/jk4ajcPBSu+M Ht0g== 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-sender :mime-version:subject:message-id:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=RhK7KH35q/sT9rpp8L6ov24cv2uSB52/mONsAXYogng=; b=W47EQ5yPBfOmhzi3LU8g6M5ijC04pOq6msa2JQbRVZuQX9GvdRM7Odt6xcqKsKudzv dU93QbWoX1WM6dU+U+Eh/Z082tXZ4e3hokUoZ2hmsFFFiHx4wfFqzIcjktmWskdRJ0nz UVe8NbHsxA/rdPe3F7Uus0F+HwjGyV2RqkKNZ4J5d5rETX2mNCZfrBo1SY7T1r0k/fzE A7InjzAmzbk5sBT9sMZDi59Dw12sZiYIRK60rBkc6YESuQRmf7wbU2I4XpWbXgzLsT17 zljDuI9T4+8HyWmkcfmVQRuU4Kx8ylrpojMVNAzYUinQ3WZxD6CRQ8ItEe4Hv8Q5S5kU H7bw== 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-sender:mime-version:subject:message-id:to:from:date :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=RhK7KH35q/sT9rpp8L6ov24cv2uSB52/mONsAXYogng=; b=MVGgiDVN4yNL3pS2/BE3GsDJvuXlAugLv+ndswbZaw3rCGxcWJNlyL+H/ZwheDqVtQ 9WP/9s/Fx4CbIWM4/F2yad/CWX7e280Qj79+X2oQjRWlCTxdVFs8cQBNJ09pf0N5/R8N vMWuRYs+GOG6DaBzufjC8/uBoNIOXv8ex5SPvFgfq3/cHm7YuP5GNz73Dd+W4YhEmv1r GzMYrJ7GrcVWBTwm5cZT6T8kJZdKLgGIwGeR3chRzLBgMTq90XR9xJ118EuDJxCsi+uv 9VZMrvWvF+mlyJ2TyW1Z7ijqdbkObLbgYK2aOHovOG4M2hXocm7W/J/8mVV+L+PojAFo P3Ag== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ACrzQf1o3HSoDve884VZsYNm1beAuV7pxOVWAhU9za2jfAeiLpDEn6Kw etcp0z1pRflWM4vrTcu+rPs= X-Google-Smtp-Source: AMsMyM4Kc79Gg/LUPvOwNRKev7Gi1NL1HF/cTRlsQ8jW22UMrpVMmIQQuvjhb01dxO0lmtrXpOBVjw== X-Received: by 2002:a05:6808:10d4:b0:350:9a8d:d411 with SMTP id s20-20020a05680810d400b003509a8dd411mr277812ois.221.1665514555998; Tue, 11 Oct 2022 11:55:55 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a54:4f18:0:b0:34f:7989:33d with SMTP id e24-20020a544f18000000b0034f7989033dls4372288oiy.6.-pod-prod-gmail; Tue, 11 Oct 2022 11:55:53 -0700 (PDT) X-Received: by 2002:a05:6808:1b2a:b0:350:e5c0:59f9 with SMTP id bx42-20020a0568081b2a00b00350e5c059f9mr272335oib.189.1665514553281; Tue, 11 Oct 2022 11:55:53 -0700 (PDT) X-Original-Sender: szhorvat-Re5JQEeQqe8AvxtiuMwx3w@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:31523 Archived-At: ------=_Part_38_762347484.1665514552536 Content-Type: multipart/alternative; boundary="----=_Part_39_1570958666.1665514552536" ------=_Part_39_1570958666.1665514552536 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dear Pandoc users, I had a small Pandoc filter that extended each subheading with a link back= =20 to its parent heading. However, this changes the heading text (by adding=20 the link text), which showed up in the table of contents. I did not want=20 this, and since I use HTML output, I could use some CSS to hide the extra= =20 text. This was possible because the extra text was in a element. However, since pandoc 2.19, the extra text is just appended, without a=20 . Thus I cannot hide it the same way. Is there a workaround? To give a concrete example, consider this simple markdown: # My Title ## Chapter 1 Foo ## Chapter 2 Bar This is a simplified version of my filter: local function head_add_backlink (head)=20 head.content:extend( { pandoc.Link( "=E2=96=B4", "#my-title", "", pandoc.Attr("", {'link-back'}) ) } ) return head end return {=20 { Header =3D head_add_backlink } } I am running this with pandoc --toc --lua-filter=3Dmy_filter.lua -t html -s= =20 test.md=20 With pandoc 2.18, the table of contents looked like this:
  • Chapter 1=E2=96=B4
  • With 2.9 it looks like this
  • Chapter 1=E2=96=B4
  • Notice that there is no more that I can use to hide the "=E2=96=B4"= =20 character. Is there a simple way to achieve my goal with 2.19, i.e. have backlinks in= =20 each header yet not show these backlinks in the table of contents? Thanks for any help in advance, Szabolcs --=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, send an e= mail 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/a9663214-8b54-4f70-8dcf-8b726ac9b121n%40googlegroups.com. ------=_Part_39_1570958666.1665514552536 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dear Pandoc users,

    I had a small Pandoc filter that extended each su= bheading with a link back to its parent heading. However, this changes the = heading text (by adding the link text), which showed up in the table of con= tents. I did not want this, and since I use HTML output, I could use some C= SS to hide the extra text. This was possible because the extra text was in = a <span> element.

    However, since pandoc 2.19, the extra text i= s just appended, without a <span>. Thus I cannot hide it the same way= . Is there a workaround?

    To give a concrete example, consider this s= imple markdown:

    # My Title=

    ## Chapter 1

    Foo

    ## Chapter 2

    Bar
    This is a simplified version of my filter:

    =
    local functi= on head_add_backlink (h= ead)
    head.content:extend(
      {
        pandoc.Link= (
         "=E2=96=B4",
       &nb= sp; "#my-title",
         "",<= /span>
     &nb= sp;   pandoc.Attr("", {'link-back'})=
      &nb= sp; )
     &nbs= p; }
    )<= /div>
    return head
    end
    return {
      { Header =3D head_add_backlink }
    }

    I am running this with pandoc --to= c --lua-filter=3Dmy_filter.lua -t html -s test.md

    =
    With pandoc 2.18, the table of contents looked like this:
    <li><a= href=3D"#chapter-1" id=3D"toc-chapter-1">Chapter 1<span&= gt;=E2=96=B4</span&g= t;</a></li>=

    With 2.9 it looks like = this

    <li><a href=3D"#cha= pter-1" id=3D"toc-chapt= er-1">Chapter 1=E2=96=B4</a></li>

    Notice that there is no more <span> that I can use to= hide the "=E2=96=B4" character.

    Is there a si= mple way to achieve my goal with 2.19, i.e. have backlinks in each header y= et not show these backlinks in the table of contents?

    Thanks for any help in = advance,
    Szabolcs

    --
    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 view this discussion on the web visit https://groups.google.com/d= /msgid/pandoc-discuss/a9663214-8b54-4f70-8dcf-8b726ac9b121n%40googlegroups.= com.
    ------=_Part_39_1570958666.1665514552536-- ------=_Part_38_762347484.1665514552536--