From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31570 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: BPJ Newsgroups: gmane.text.pandoc Subject: Section and heading id in MediaWiki output Date: Mon, 17 Oct 2022 17:04:53 +0200 Message-ID: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000d2f90205eb3c4c3f" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31871"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCWMVYEK54FRBJG6WWNAMGQEW7SFNIY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Oct 17 17:05:12 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-il1-f189.google.com ([209.85.166.189]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1okRg0-00081t-FM for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 17 Oct 2022 17:05:12 +0200 Original-Received: by mail-il1-f189.google.com with SMTP id l5-20020a056e0212e500b002fa8ea32922sf9254168iln.15 for ; Mon, 17 Oct 2022 08:05:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1666019111; cv=pass; d=google.com; s=arc-20160816; b=SgpOReBgDbJ/x3OY59cc5B3zGDvaJPz6/wGBB7MCJ5GWgf4rDxNFpU0PRTN76CbYQR C9zniu5Cnnhb5OAt/gMLUcYe3BEKgPfvuycG8jPfg5b7oPmUk9RA9WIwgHFJocs0HCKy 2eUCZQny30tF/9Zsm5PP/ndAnxjywXxcWIuipW8ad6ia6gGupcGnYUJi66mFqwSEVU4L ZYxFlmhCZniVkPf0PXu5NcqW59aFnHL1thRR9R36VHVV/VCUZnBpCI9J2mz5cICYBl+q PiE/VmFq3WOkkur6KNtNQXdNgTIGYyJIHgt5Sa3XkYHpu5zMlr6vyDrtcKCrKnpeaiY1 jRJQ== 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:mime-version:sender:dkim-signature:dkim-signature; bh=7+T/5rmL6s4UXBiSPI+3EWWr9t8SNf7ZraE+ts+B+HE=; b=YYkWpyJIgfFM80jmHm54xyRRvj+3/XxJGT9CGJwBjqRTN31Ken5RhApe4+T8SisNmo 4Y7XwYKnx7Cg4By4Rlp3Es5YQgSj1m3VhKLxqJs4AfKqEHoOcw5bF3H75iX3uTtY0Hbh bfhdOUqBtP/SEF0i6NhWUaRkOwMRgNQhG+MQogNmitUdrfJSlGN11tHdZgOs6tKv0X0Z OVkGj/UnjsSYMnHTYyn+iIRJHzCi2v45k6pQenBUwBHziqDO77wUT0Ci/kW+5AOXwotj GNq4MRVsyBC2Ct1OYXe6mZhGyGOMo87z3FLGkVZAU64QZ2kqwGZoDgDSKY6fq7rS6rUd WJAQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=prDLigxS; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::b34 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:mime-version:sender:from:to:cc:subject:date :message-id:reply-to; bh=7+T/5rmL6s4UXBiSPI+3EWWr9t8SNf7ZraE+ts+B+HE=; b=aCe8wg9aWsbBasr2gYf9MR8cXSrGp5WzkhT+quFdMjJa7XWbKG9yw9GMIBzpvBPLln qMqPVH6l5JOQUKAGRBBjjjpzMwSU6UHZDryU9lKdMqU8hsxSVYZA3eO3GoVs8ysm/kdS MK2wUpBPk4NhJXZOxOacOk27xrG+Yv88TEJNf3l1qvoKy+vyLSpMiokd8FRE6AhxFjTR l4JBCsW0Us1b5PXtXbkrzgGJYqdUw2sQMC+3M6wFqCqN7vPXSxDpyGBBuXDsrKAhwst1 5htz9aO64sxHKm1/Y2A3ZeoQb6O/aCIkzokgjkX7nObH/ATuizuZGJ5rKxbi6qPLeqVe 1J9w== 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:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7+T/5rmL6s4UXBiSPI+3EWWr9t8SNf7ZraE+ts+B+HE=; b=WIMjtlqXgmRnlsrEkc+n686vKRiuQgRSith/fdIf7GfgXH2qyTgKlKuhyaoHu7wFJD kR+PTxNsg0XNmg794jCeFUBDz9eMf1nR22mX3GC1onM74xAkHOlsB1LvIhEWsssDbdcY s8t6rz70OpnEdMSutMFy7oBdrQ0h+gWa+1EbjC7M+kGxRagsiL1RgA7o+tT2CFoNj2TQ B2n4//KaaV95mv4S0Ge5k3lkLhRvFTdlyNlI0/wJCYquI0tR+d7hdISmXW28Zlp4UudO 3w5xNsb/XIBiRpoM08HdJxBy0HuneApSWkL7aT9o+3b5oNSypr3Q4KEjbGWj4cfKXHWd K4cQ== 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:mime-version:x-gm-message-state:sender:from:to :cc:subject:date:message-id:reply-to; bh=7+T/5rmL6s4UXBiSPI+3EWWr9t8SNf7ZraE+ts+B+HE=; b=YTNtf5Oj4qa1pIMm9b26xgYFso75GosLtWt+Z74dyNzvdzExDll9XhBee2+R+zGHgK dHVub0egHSxhc6omIVOqglQqG5MQQehWbGrxmr85zpI//VAwS+erY0v9rjc3ILvncO4n yDs1Z8sDLHi95QECnOVyp1F6H0J1limVuRgfjljpivrcDhD/yalxxxzAr6j5Ww4h+icT xk79/5VZeTj3j3O84MCwnxv9Jnb1wGwgUsu6hvGHYQ5qkV3pYRpQSUp2ScmUU6m8zcYk W8J4eZDOPbLBudaJ85I4yYKwqoYWIXvOnt1Tji8B2cLAG1AG2vHZmG6SXFwc5ppiMI5J e Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ACrzQf1NVCv33ec/lZkvyndOHlhetN2J4BVqNrF50/W3BrUquPY1GCXp 6s1USxb7EWpenm30eojg38o= X-Google-Smtp-Source: AMsMyM7rifvcnqqlJ43/wZwrhk8kYlUXG0+jhzuvjFtgFXLoOEFUFdgYgff801kfbu3PuwpvW45gjw== X-Received: by 2002:a5e:c815:0:b0:6bb:dd42:ad4e with SMTP id y21-20020a5ec815000000b006bbdd42ad4emr4558100iol.215.1666019111277; Mon, 17 Oct 2022 08:05:11 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a6b:1503:0:b0:6bc:6044:840e with SMTP id 3-20020a6b1503000000b006bc6044840els1502492iov.0.-pod-prod-gmail; Mon, 17 Oct 2022 08:05:08 -0700 (PDT) X-Received: by 2002:a05:6602:3410:b0:6bc:c4b2:3577 with SMTP id n16-20020a056602341000b006bcc4b23577mr4556477ioz.52.1666019107960; Mon, 17 Oct 2022 08:05:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666019107; cv=none; d=google.com; s=arc-20160816; b=xnQMVs5tja9Yz4DFoo4XzkYKamRMEMpYUtu+SksWBGXGWZgcjxtX6Vnl9e9eUxCj51 /0WBKlPMW/Jdvyl4KqPUP6WjsN3Ea43x+2z+UoTKp8rIVzapYKkWO7Wl1x/ZMx9QBHL2 AZ5QUPF8ax0um5ibNMJ5PpkwsWkddgkYJQ1lQQt1kLhAbDSvauV8aycSEUb4vD2Z+yxI 0YIIjG9yjujuaigR50fDbkmgIlopP8/2u3F7Xvw13wr3av7Vw32IYA2pfOCYkrBzXUQF X6hsbTx0PBnXp5Kzq72cWO4x1/k2muUiJsk9XJvgdZ+/fo8Fd3KAyAr0DR+DdHMLsFTZ nkZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:mime-version:dkim-signature; bh=q4dT24vqtMNn+PlJZOh+MdgUOQ/sEFJ5K9EN/h4sgGc=; b=mM07K07ZMjr56Gk/3WNnrD6OyuVWVp3T/RzJvr/KNzz2KErWrnYcQIVpS9YolzXGFq cd0LHfL3/sHxLHh5b7nhA0ZjNPspXucKo1lB5qiqbzE0qcj3/4IZJF4a3NmxCb6Wd+m3 9BH9MhRMY3/1NHSGjUvgEMxN8u2+Ew8IlYgsmg8VEsyT2SoJS8dFgNK0rEflpYOdyVMq vUhBRco5p8Dqp21MXFf9U9rit3lKh6vGz4CXy65w42poqQZY84NyE4hAxK6VEleYDs4O uM5cIThKOjmLEjaDVt0EsOfbBcyyHulTkOlkadAbSu6SN7DmAerkF0TNHnd2KUUkOOp6 K7Dg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=prDLigxS; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::b34 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-xb34.google.com (mail-yb1-xb34.google.com. [2607:f8b0:4864:20::b34]) by gmr-mx.google.com with ESMTPS id e143-20020a6bb595000000b006a128dbb6efsi447115iof.0.2022.10.17.08.05.07 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Oct 2022 08:05:07 -0700 (PDT) Received-SPF: pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::b34 as permitted sender) client-ip=2607:f8b0:4864:20::b34; Original-Received: by mail-yb1-xb34.google.com with SMTP id e62so13607737yba.6 for ; Mon, 17 Oct 2022 08:05:07 -0700 (PDT) X-Received: by 2002:a25:9c01:0:b0:6af:4a89:26b3 with SMTP id c1-20020a259c01000000b006af4a8926b3mr10260825ybo.190.1666019103004; Mon, 17 Oct 2022 08:05:03 -0700 (PDT) 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=prDLigxS; spf=pass (google.com: domain of melroch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::b34 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:31570 Archived-At: --000000000000d2f90205eb3c4c3f Content-Type: text/plain; charset="UTF-8" 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. Li 2

    Li 2 para 2

  3. Li 3

Text

  1. Li i
  2. Li ii
`````` ``````mediawiki
== Head 2 ==
=== Head 3 ===
  1. Li 1

  2. Li 2

    Li 2 para 2

  3. Li 3

Text
  1. Li i
  2. Li ii
`````` It seems that the only fix currently is to go through the MW source after 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-1jZLTGoEFnmhfybH9-F6W-_SaYrXNQ%40mail.gmail.com. --000000000000d2f90205eb3c4c3f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
When converting to mediawiki MW heading= s are prepended with a span
`<span id=3D"HEA= DING-ID"></span>`, evidently to provide an anchor to
pandoc's original/automatic id so that internal links wi= ll still work. However
if there is a `<section>= ;` 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
<section id=3D"head-2" class=3D"level2"&= gt;
<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"hea= d-2"></span>
=3D=3D Head 2 =3D=3D

<div id=3D"head-3&qu= ot; class=3D"section level3">

<span id=3D"head-3"></span>
<= div dir=3D"auto">=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 i= i</li></ol>

=
</div>

<= div dir=3D"auto"></div>
``````

It seems that the only fix currently = is to go through the MW source after
conversion and = manually remove any offending spans.

I wish the mediawiki writer were smart enough to not insert th= e span above the
heading if its id would be identica= l to that of a parent section div. Would that
be pos= sible, and is this enough of a bug to submit an issue?

In the actual use case I modify the HTML inp= ut with an HTML editing
script/library before conver= sion to mediawiki, and as a part of that I add
attri= butes to the section elements which I want to be there on the div in
<= div dir=3D"auto">the MW output, so removin

[^1]: In my case inserted by pandoc into the HTML now us= ed as source at an
earlier run.

--
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/CADAJKhAJARL1rpi2k-j-1jZLTGoEFnmhfybH9-F6= W-_SaYrXNQ%40mail.gmail.com.
--000000000000d2f90205eb3c4c3f--