From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31572 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: BPJ Newsgroups: gmane.text.pandoc Subject: Re: Section and heading id in MediaWiki output Date: Mon, 17 Oct 2022 20:23:20 +0200 Message-ID: References: <926E2AED-D785-4763-8368-A35EAB35B6FC@gmail.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000096ce7205eb3f1257" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5003"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCWMVYEK54FRBJF3W2NAMGQEIIG5AVY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Oct 17 20:23:36 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-vk1-f191.google.com ([209.85.221.191]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1okUlz-00015z-H9 for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 17 Oct 2022 20:23:35 +0200 Original-Received: by mail-vk1-f191.google.com with SMTP id q4-20020a1f2a04000000b003a9ae3acbc1sf1881500vkq.16 for ; Mon, 17 Oct 2022 11:23:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1666031014; cv=pass; d=google.com; s=arc-20160816; b=nMzuSRiLwC4N+OfaJYMP6zoH+Bt+ekqn3ntogxTFz3jfzvRZA8PGQMpDKXbxUavRJk YkrbMeYJW8P9seFf4GOEDXK49d9xCatN7Im+VKD99YEroMuhkrK0SuGVyNFTFeZjAABR j5FrwS+wZrDuAI/lF4fBaLQKiIFb/yHlac7MMZET7ThzL2khB7BaJq2awZG0oKBJYEYZ 8Jc2XugUUQVsUX09k3ghbk57hITeQ1W8u5lNkio93wPTmsWVcy04hvVAAFGp+6KqLwiX 3XQZKIHmlCpFkmuka4WnONQDYAW+uen0fc0O//2ChyGb7zKtMwpyk9JgooTv3J0dZLO0 e/bA== 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:to:subject:message-id:date :from:in-reply-to:references:mime-version:sender:dkim-signature :dkim-signature; bh=+qufqsTnmFg1lfpvRV49/j9b/iH1AQGdpKdaVFv6rPs=; b=BqPbLTFcLgfIsZNpZZWIiWsqZyGA+pBRxqfxy7BlL+kZz+K9R5jttS3pMOQPthVL0O VmoVVu6Q0JsqB5BVlU+56oyR2/PJNzsZR5eoumbveJMJ8ws2CS0qIxJraOXc5iVS7RJU V4C2E+984Bkr96En35wzPO2DFYmcZwsqAvQDYWHNe+oFoFuwz3+nkMhFxLRy7jLTPv0u XJRIz6dP4yaZO0jlvXCGZXzHzunrAVi5YNVpyqOyJt5GYI99N1UlhpsAEJ7Mj6fQIy/m TcExGrkJiEw8XeRstiy2KfR/zkoOEE9MkUF0jVOy0ZfHE5bxOXWYG/xDeKRM9LOILwC3 2vjQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FwmBjVZN; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::b2a as permitted sender) smtp.mailfrom=melroch-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:to:subject :message-id:date:from:in-reply-to:references:mime-version:sender :from:to:cc:subject:date:message-id:reply-to; bh=+qufqsTnmFg1lfpvRV49/j9b/iH1AQGdpKdaVFv6rPs=; b=tP13ByERrkzMmSbwiMfqBVDVVmW5zppfzfYMwJ0qjuCkaKgZ8lCivP770gyuSN7bWP QPEsfkWnSCZlkhqt9ERpt3rD9UDRXc+74Y/NZ3Ed8SWiVjxgPZb7Dy4WfQ2GqZlJYmgs dQOQs+AtrxS3bcyymrbui2qYfsg/XdITAuHJPtcTruadqoptkETSG73AeOpPLhtmbW2B n79umeEbcq1uLd6wfcMpuTVS0sWaB2eHLEzLBOjI3uFJZe4Lp4aceYiA9/cLcEbP+lpI 38WHc8le5jYpIV3CsdzvW4pkfN//Q1kW4haHhNIX9VWwmhORjeqjhSvkBQwDHe+inyPK nNZw== 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:to:subject :message-id:date:from:in-reply-to:references:mime-version:from:to:cc :subject:date:message-id:reply-to; bh=+qufqsTnmFg1lfpvRV49/j9b/iH1AQGdpKdaVFv6rPs=; b=kmnM1ROFJfMwKZmNU1IGZXK9fJ9pc0eVa2+svEbK0aq6HA+V41R97ay/DmKQGU9s9B KbA+WA3be2v4TF51uHWDKUDEhMwjF3Y/qId6Tbx0uFBSYjYpGYxzlIkSHPz1klKZCoeS 8emy4fIgs5qIxST1Vq3NKAzJgeZLjMA+ACBHaqUQbxDFoBmLa6DooLzmPl7gFr5pZJwu 6VVv5+3rm0pey4V3L9MdZQd6dWsWRfCpLeR6Kkffw+Jlk2hrAoidpimZ1UMtRMRuwO5n Bvz/DrIgv7wjpclDGxCerRlnuoHf8CaawT1I9xxjJ2y9LwPy8ECZfZQKbBLt+0txRdUQ Mt0g== 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:to:subject :message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=+qufqsTnmFg1lfpvRV49/j9b/iH1AQGdpKdaVFv6rPs=; b=79HrceuHF/L92qwFqkfXDB3yrvoZJYuwK5zEK0xFoD6tSHlNJC9kMZoZhdjBwN6G8q fKqBrUKUcQPwpoXxqIHqg6Kn2hq2YytMaZMzPyzc42cqSl4l2Cw7Pj+p+p11LfDSop/D vSlr9BXjobe9hh2rJZU4fNz/76wo7UgPXHQoTO3uLakTPbvBK+apUAEQiB/IHQ94YrAR MeaE9/ee/O2N4rq2N6DR5PCjYose4habYEroeXeWFmeG3OXdM9Bz1haE7dRQITSQ6728 fMR+ewRxFOrOu+BeVnRezTVVDeV/g4j1kwUn+QQM+8ayl9 Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ACrzQf3AHiuViWXYCzeczjKD3gl4TUWMG/k1pJzRf1SRbyFTBrG8gWTZ Qtf/QvnPdDGMLjxqR3a6/GM= X-Google-Smtp-Source: AMsMyM5yiqd1lfSpfg3BHTWbhPwoDR8CdBr7Bx19WZ+BsTyQ4L93/c1hAvCHGs/zzmqPuEneRoAu3Q== X-Received: by 2002:a1f:ecc6:0:b0:3aa:a785:5e2f with SMTP id k189-20020a1fecc6000000b003aaa7855e2fmr5020194vkh.6.1666031014463; Mon, 17 Oct 2022 11:23:34 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6130:20e:b0:3ae:855a:9a7f with SMTP id s14-20020a056130020e00b003ae855a9a7fls932322uac.0.-pod-prod-gmail; Mon, 17 Oct 2022 11:23:31 -0700 (PDT) X-Received: by 2002:a05:6130:64c:b0:390:f639:5ac4 with SMTP id bh12-20020a056130064c00b00390f6395ac4mr5368347uab.98.1666031011741; Mon, 17 Oct 2022 11:23:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666031011; cv=none; d=google.com; s=arc-20160816; b=mnIVGXYgEN8K4tkZ1j77uKpuVMCug3wvMPp/kZ4Z2JQL/thnX+hBvEK5xss+nSXsWO vhzBdRacWoJUP3DP0VKlafUDh8njbzKlyPesQteUNOqLWObokLKnvBQVoj5KvvE6v3qr LW+SArPvVvLMKLxRTOG5MAEt5ejYzjvB9PlTidVDpFNcUi6SHd1qngbJnbFSKD+/X3jt cUw+UkgJP54Wfkzp4tPWLIacqP0sDaY1XaCjZNzVT5IzfkIgCk2YRt7+0L+/WdW4g6mp UaGBfoXv5Qe5BaI7a92wAf+/zK5Bpq0yglloR+7ZLX6bEREARDRSUn16QvOp2PxGtS1J YQeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=yLB0x/PFtkXq42tiqwXqAMyGs6puedfb1fm12cgCw6Q=; b=BHFH4ZK3v7pT2W3kovYh6NoEPewyH3Hz3+LTTn32Czon4ah9+VZFSRcoy8oKm9j+G1 psZgXdM9OD5GQP9lP/6EathbPnJffFoXr5c/dPwlzzofCKRajImHdR/ZEkGj5cUYy3Hl 2yF/GhIOFTNUtwTXmnKBL0WOSzmn4fdPTqsNxljCsXo9+Qru8ikra4ro9PO03n6D9ACS sAzWsNUQZdO4QtJeltQZZ1RMtB3vxf3tkc3O/nhAyqC0Mu6RN3MURFRVTBbDOgOaHDK/ vDf3PTMEXCrfmd5X80S5D+bevjy5ns0gj8fBza2Uv/btBiV/39Xe7t1nHPLXvP3B1ttn LXBA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FwmBjVZN; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::b2a as permitted sender) smtp.mailfrom=melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com. [2607:f8b0:4864:20::b2a]) by gmr-mx.google.com with ESMTPS id az24-20020a056130039800b003b38a9f6c6dsi1331480uab.2.2022.10.17.11.23.31 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Oct 2022 11:23:31 -0700 (PDT) Received-SPF: pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::b2a as permitted sender) client-ip=2607:f8b0:4864:20::b2a; Original-Received: by mail-yb1-xb2a.google.com with SMTP id k3so14240493ybk.9 for ; Mon, 17 Oct 2022 11:23:31 -0700 (PDT) X-Received: by 2002:a25:8547:0:b0:672:ca9c:d33f with SMTP id f7-20020a258547000000b00672ca9cd33fmr10717288ybn.270.1666031010891; Mon, 17 Oct 2022 11:23:30 -0700 (PDT) In-Reply-To: <926E2AED-D785-4763-8368-A35EAB35B6FC-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> X-Original-Sender: melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FwmBjVZN; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::b2a as permitted sender) smtp.mailfrom=melroch-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:31572 Archived-At: --00000000000096ce7205eb3f1257 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Den m=C3=A5n 17 okt. 2022 17:56John MacFarlane skr= ev: > Seems like a bug to me. Can you open an issue at our GitHub tracker? > https://github.com/jgm/pandoc/issues https://github.com/jgm/pandoc/issues/8383 > > > On Oct 17, 2022, at 8:04 AM, BPJ wrote: > > > > When converting to mediawiki MW headings are prepended with a span > > ``, evidently to provide an anchor to > > pandoc's original/automatic id so that internal links will still work. > However > > if there is a `
` element[^1] I frequently end up with an > identical id > > tag on the div resulting from the section element and the automatically > > inserted span element, which seems like a bug to me: > > > > ``````html > >
> >

Head 2

> >
> >

Head 3

> >
    > >
  1. Li 1

  2. > >
  3. Li 2

    > >

    Li 2 para 2

  4. > >
  5. Li 3

  6. > >
> >

Text

> >
    > >
  1. Li i
  2. > >
  3. Li ii
  4. > >
> >
> >
> > `````` > > > > ``````mediawiki > >
> > > > > > =3D=3D Head 2 =3D=3D > > > >
> > > > > > =3D=3D=3D Head 3 =3D=3D=3D > > > >
    > >
  1. Li 1

  2. > >
  3. Li 2

    > >

    Li 2 para 2

  4. > >
  5. Li 3

> > > > Text > > > >
    > >
  1. Li i
  2. > >
  3. Li ii
> > > > > >
> > > >
> > `````` > > > > It seems that the only fix currently is to go through the MW source aft= er > > conversion and manually remove any offending spans. > > > > I wish the mediawiki writer were smart enough to not insert the span > above the > > heading if its id would be identical to that of a parent section div. > Would that > > be possible, and is this enough of a bug to submit an issue? > > > > In the actual use case I modify the HTML input with an HTML editing > > script/library before conversion to mediawiki, and as a part of that I > add > > attributes to the section elements which I want to be there on the div = in > > the MW output, so removin > > > > [^1]: In my case inserted by pandoc into the HTML now used as source at > an > > earlier run. > > > > > > -- > > 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/CADAJKhAJARL1rpi2k-j-1jZ= LTGoEFnmhfybH9-F6W-_SaYrXNQ%40mail.gmail.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/926E2AED-D785-4763-8368-= A35EAB35B6FC%40gmail.com > . > --=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/CADAJKhBi-hS-pg0GC3truoB%3DxUGKJYU6LXCtXcSVmFrpk30uiw%40mail= .gmail.com. --00000000000096ce7205eb3f1257 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Den m=C3=A5n 17 okt. 2022 17:56John MacFarlane <fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> skrev= :
Seems like a bug to me. Can you o= pen an issue at our GitHub tracker?
https://github.com/jgm/pandoc/issues
=




> On Oct 17, 2022, at 8:04 AM, BPJ <melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >
> When converting to mediawiki MW headings are prepended with a span
> `<span id=3D"HEADING-ID"></span>`, evidently to = provide an anchor to
> pandoc's original/automatic id so that internal links will still w= ork. However
> if there is a `<section>` element[^1] I frequently end up with a= n identical id
> tag on the div resulting from the section element and the automaticall= y
> inserted span element, which seems like a bug to me:
>
> ``````html
> <section id=3D"head-2" class=3D"level2">
> <h2>Head 2</h2>
> <section id=3D"head-3" class=3D"level3">
> <h3>Head 3</h3>
> <ol type=3D"1">
> <li><p>Li 1</p></li>
> <li><p>Li 2</p>
> <p>Li 2 para 2</p></li>
> <li><p>Li 3</p></li>
> </ol>
> <p>Text</p>
> <ol type=3D"i">
> <li>Li i</li>
> <li>Li ii</li>
> </ol>
> </section>
> </section>
> ``````
>
> ``````mediawiki
> <div id=3D"head-2" class=3D"section level2">=
>
> <span id=3D"head-2"></span>
> =3D=3D Head 2 =3D=3D
>
> <div id=3D"head-3" class=3D"section level3">=
>
> <span id=3D"head-3"></span>
> =3D=3D=3D Head 3 =3D=3D=3D
>
> <ol style=3D"list-style-type: decimal;">
> <li><p>Li 1</p></li>
> <li><p>Li 2</p>
> <p>Li 2 para 2</p></li>
> <li><p>Li 3</p></li></ol>
>
> Text
>
> <ol style=3D"list-style-type: lower-roman;">
> <li>Li i</li>
> <li>Li ii</li></ol>
>
>
> </div>
>
> </div>
> ``````
>
> It seems that the only fix currently is to go through the MW source af= ter
> conversion and manually remove any offending spans.
>
> I wish the mediawiki writer were smart enough to not insert the span a= bove the
> heading if its id would be identical to that of a parent section div. = Would that
> be possible, and is this enough of a bug to submit an issue?
>
> In the actual use case I modify the HTML input with an HTML editing > script/library before conversion to mediawiki, and as a part of that I= add
> attributes to the section elements which I want to be there on the div= in
> the MW output, so removin
>
> [^1]: In my case inserted by pandoc into the HTML now used as source a= t an
> earlier run.
>
>
> --
> You received this message because you are subscribed to the Google Gro= ups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send= an email to pandoc-discuss+unsubscribe@googlegr= oups.com.
> To view this discussion on the web visit h= ttps://groups.google.com/d/msgid/pandoc-discuss/CADAJKhAJARL1rpi2k-j-1jZLTG= oEFnmhfybH9-F6W-_SaYrXNQ%40mail.gmail.com.

--
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 pandoc-discuss+unsubscribe@googlegroups.= com.
To view this discussion on the web visit https://groups.google.com/= d/msgid/pandoc-discuss/926E2AED-D785-4763-8368-A35EAB35B6FC%40gmail.com= .

--
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://group= s.google.com/d/msgid/pandoc-discuss/CADAJKhBi-hS-pg0GC3truoB%3DxUGKJYU6LXCt= XcSVmFrpk30uiw%40mail.gmail.com.
--00000000000096ce7205eb3f1257--