From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32536 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Miguel Newsgroups: gmane.text.pandoc Subject: Re: Header attributes and docx Date: Sat, 6 May 2023 00:18:19 -0700 (PDT) Message-ID: <10bc5af5-5507-4a4e-b620-9d48a9cc4800n@googlegroups.com> References: <87r0ru9ce8.fsf@zeitkraut.de> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_3476_1699743011.1683357499085" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18806"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDGO3MPRREHRBPH626RAMGQEMKC5K5Y-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat May 06 09:18:24 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oa1-f58.google.com ([209.85.160.58]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pvCBT-0004mJ-Db for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 06 May 2023 09:18:23 +0200 Original-Received: by mail-oa1-f58.google.com with SMTP id 586e51a60fabf-1925f269ebdsf1584481fac.3 for ; Sat, 06 May 2023 00:18:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1683357502; x=1685949502; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :sender:from:to:cc:subject:date:message-id:reply-to; bh=XCFhSQyer1cBPmtB9OSvOXHz9zicFzmguPyQiWtcRkM=; b=Jg+omvTavAZ1+8T2Z+ExH6i7s0mn89Gc06TTllv5RDEwtMmG9U7LzW0niw0sIajoS3 5IePu+iv9LTrhmov61HJ3coD/pwpU+cBQ1faj68jwrqZhr0K6RAejxSI/X7ckQ7sYMzV PbsbChXNbit5s1sxbaB3GvXYwpWPjFOP+ID0onvr0eihfepPUb6ptt8ZoDQSNDFUze0e Rd58Px8BuW2prT1EMneruw5AZcnY+GPjOe9RH1BuOBs7R6H00xqqpuoUSUkEwF8xs/po W0N45B3Fuj0kdJqCc5P9o9eaoc4uisfOdszLb8YdUINJ7ORiBtn4Q9n/CY2LmiPtFSht UOQA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683357502; x=1685949502; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=XCFhSQyer1cBPmtB9OSvOXHz9zicFzmguPyQiWtcRkM=; b=L9pMVYVg2k24yZtXDYqZtXtLXoNqvHjnU5dy6039DXSZrF8pGwO3ZrPoGvDGzr31rc lDrrDFKvXrTYwxPtFc/WxmuNsYGgp2me79v2tHNH2BdNFUtGmTdTdQ6jHEvYiqUOT9Un 4ax8WeEISVpky4zsxZJFz+jP0V+tooWyjVEQIW4aJA/CdaUHYchLZbo/5dGFv6RPqAlE cAsH3NCYyzNX/guNoGDv1KVnFRPgIKkCdUteQhI8f3z+O+QL9vZoDYOPyWjzoUFZhZOl EFXM3CqfVdtYhbtvoFVs5DsJucwFJAqesfJHstASkq6h2wQfRdGmP2HPQ3Fiajm6yCmF NkVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683357502; x=1685949502; 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:references:in-reply-to :message-id:to:from:date:x-beenthere:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=XCFhSQyer1cBPmtB9OSvOXHz9zicFzmguPyQiWtcRkM=; b=g+CNYm5Etnyi+PuexlNXt5SDGtTQ3lK8f9z3r1jDYxSwd1v9U4LfwN/ZmmFdXs4FW/ K9otqRYhd+WaNsUmNVCATcsdJrA63uRI4wlKlbU5U2CTmEv3Lp7X07kDLwRn/1M4LnH+ nKLsi10bBsOvQ9XeRJvVZdfQ7fqmLnOI3sLA6oGMkVm9fsJerYeWCKCq0xROwidUJxGz YVmazQyeLVaHkiS5fbl8pUvFEYeVncMWgHO5/Kg+oex5vGzmMvqBIfoCc57KRH0BpluI NH1GmyVfr6FB5BaxgKhSlGqZHVjt7rymFyPFpkRiBVekd38irG Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AC+VfDw5I53kK5NH292MRgSuArFKd1f6ORQo8cfu7U2ksV0hH9G14Ypm DzwWtUhS2bfphtPwHsLjtRs= X-Google-Smtp-Source: ACHHUZ7MrDcdA0jFK/xPqg1ejhzMU89OqUjvsxHHf21emLyTq5XUU0MBuPnvHiqT5B8Kf/fxQ5kIzg== X-Received: by 2002:a05:6871:60e:b0:192:52b0:f11b with SMTP id w14-20020a056871060e00b0019252b0f11bmr1233818oan.6.1683357502266; Sat, 06 May 2023 00:18:22 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6808:1414:b0:38c:6290:a68b with SMTP id w20-20020a056808141400b0038c6290a68bls5849313oiv.0.-pod-prod-gmail; Sat, 06 May 2023 00:18:19 -0700 (PDT) X-Received: by 2002:aca:f357:0:b0:38e:7e0b:a74d with SMTP id r84-20020acaf357000000b0038e7e0ba74dmr719991oih.9.1683357499722; Sat, 06 May 2023 00:18:19 -0700 (PDT) In-Reply-To: <87r0ru9ce8.fsf-9EawChwDxG8hFhg+JK9F0w@public.gmane.org> X-Original-Sender: bagnon-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:32536 Archived-At: ------=_Part_3476_1699743011.1683357499085 Content-Type: multipart/alternative; boundary="----=_Part_3477_493039260.1683357499085" ------=_Part_3477_493039260.1683357499085 Content-Type: text/plain; charset="UTF-8" Thanks Albert. I am not familiar/fluent with the pandoc readers/writers, but it seems that the bookmark is properly transported to the docx, This is a section It is when writing back to md that the heading attribute is not sent back. On Saturday, 6 May 2023 at 08:56:19 UTC+2 Albert Krewinkel wrote: > Conversions are generally lossy; some info cannot be preserved. In this > case here the issue is that the docx reader ignores "bookmark" entries > in the input document. Changing this would require updates to the docx > reader: > https://github.com/jgm/pandoc/blob/main/src/Text/Pandoc/Readers/Docx.hs > > Miguel writes: > > > Say you have the following file: > > > > # This is a section {#section} > > > > Converting this to html/docbook/latex and back to markdown properly > > handles and keeps the header attribute: > > > >> pandoc -t docbook test.md | pandoc -f docbook -t markdown > > > > # This is a section {#section} > > > > But when converting and reversing from docx, the header attribute is > > lost: > > > >> pandoc -t docx test.md | pandoc -f docx -t markdown > > > > # This is a section > > > > How can this be fixed, and convert back from docx without losing the > > given header id? > > > -- > Albert Krewinkel > GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124 > -- 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/10bc5af5-5507-4a4e-b620-9d48a9cc4800n%40googlegroups.com. ------=_Part_3477_493039260.1683357499085 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks Albert.=C2=A0

I am not familiar/fluent with the= pandoc readers/writers, but it seems that the bookmark is properly transpo= rted to the docx,

<= ;?xml version=3D"1.0" encoding=3D"UTF-8"?>
<w:document xmlns:w= =3D"http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:m= =3D"http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:r=3D"= http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:= o=3D"urn:schemas-microsoft-com:office:office" xmlns:v=3D"urn:schemas-micros= oft-com:vml" xmlns:w10=3D"urn:schemas-microsoft-com:office:word" xmlns:a=3D= "http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic=3D"http:/= /schemas.openxmlformats.org/drawingml/2006/picture" xmlns:wp=3D"http://sche= mas.openxmlformats.org/drawingml/2006/wordprocessingDrawing">
=C2= =A0 <w:body>
=C2=A0 =C2=A0 <w:bookmarkStart w:id=3D"20" w:name=3D"section" />
= =C2=A0 =C2=A0 <w:p>
=C2=A0 =C2=A0 =C2=A0 <w:pPr>
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 <w:pStyle w:val=3D"Heading1" />
=C2=A0 = =C2=A0 =C2=A0 </w:pPr>
=C2=A0 =C2=A0 =C2=A0 <w:r>
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 <w:t xml:space=3D"preserve">This is a sectio= n</w:t>
=C2=A0 =C2=A0 =C2=A0 </w:r>
=C2=A0 =C2=A0 <= ;/w:p>
=C2=A0 =C2=A0 <= w:bookmarkEnd w:id=3D"20" />
=C2=A0 =C2=A0 <w:sectPr />= ;
=C2=A0 </w:body>
</w:document>
It is when writing back to md that the heading attribute is n= ot sent back.


--
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/10bc5af5-5507-4a4e-b620-9d48a9cc4800n%40googlegroups.= com.
------=_Part_3477_493039260.1683357499085-- ------=_Part_3476_1699743011.1683357499085--