From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id AJ3VKPwwVmO5VQEAbAwnHQ (envelope-from ) for ; Mon, 24 Oct 2022 08:30:20 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id +H78J/wwVmPe2AAAG6o9tA (envelope-from ) for ; Mon, 24 Oct 2022 08:30:20 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1366B3B640 for ; Mon, 24 Oct 2022 08:30:20 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ompOy-0002Pf-9h; Mon, 24 Oct 2022 00:49:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omCVj-0000kl-8g for emacs-orgmode@gnu.org; Sat, 22 Oct 2022 07:17:51 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1omCVh-0004Qc-RV for emacs-orgmode@gnu.org; Sat, 22 Oct 2022 07:17:51 -0400 Received: by mail-pf1-x42a.google.com with SMTP id p14so4971204pfq.5 for ; Sat, 22 Oct 2022 04:17:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=ErHPbpXe00ilnsKSvoSlSf7AJohH3dn/2ekHMPGG6c0=; b=Ww0gjEqDI6y7FVNkIpqgUXL2fwTprO8y91L4x4JdpEEIdfg0BIxjxm/yEOrpdq1aXX fTrC/L2UqBVOnhPWBrykJh9UEV9RdsRCEQFNomvSzi3iOr6x7VOF8Cqh/eKaXvUs4f51 HHTW2JIMKgxTxWY3l2crlcNvfpBqYjqD/urBfmy/hcmRePaMaIRiWWKzLTpVn6tqxNGM drS0Xrr8tQgNLZDQPp6tUO1T990QxnwNrsvrnHHXoFF44pkMaC2omgqayW1YJ74Y7Qjp O/Iu1QTKZ0qQB/ahV0iERzAd8zxWDZT8RlY2IMEhhgEEsyl/p1dflePrLol2UAExQwSD fv9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ErHPbpXe00ilnsKSvoSlSf7AJohH3dn/2ekHMPGG6c0=; b=dqwYT8N2KDpAxNu9+N1csuGSzcAPaJ9Tzeg1yCQ6EyVHV6IeasznB4QGy0XALlRJlJ xG1+KA/7uObHsxjzvRABKUvf43T9tuAtB7tJkUSmamiunbKLLErfs5xiVqoenof55zfn J/KYFsYOTpHCtIHosyIUORS36Naea+fX2mnDuf/oKK/aoNMuk7VEyTJi5wLc+31/HDOj oYXchGYa/zCDvn+HzGQrUz8TRKk2PbwL32/+NDF0l0x+NSEe1EL9WA4L1vd2JALedL5L asP/GZDsWZAiTLBXxkNSRu2e996fqJ3ILwjIJkoja9EtoQ5R+v7YqHtEITN6nTW2U0gz MqeA== X-Gm-Message-State: ACrzQf1lB7Py71Aijhp0D39hOmxmm6wGG9GcxI5W2VD8YYBCOzuYg290 wZUwivgiaAecl2/2BilD7eKQxwjjEs13xU9CehTzHoYNQt3mMA== X-Google-Smtp-Source: AMsMyM7i1g7KJV17V1GISd9oFNIdWviSe8IbkVGra1Xj2+Fe4AH5a3IW0L1AljksfwyPWc7WSAHx7/n5MrPeOQbo8aY= X-Received: by 2002:a63:2c0b:0:b0:434:ebb6:7594 with SMTP id s11-20020a632c0b000000b00434ebb67594mr19719643pgs.245.1666437467538; Sat, 22 Oct 2022 04:17:47 -0700 (PDT) MIME-Version: 1.0 From: Feraidoon Mehri Date: Sat, 22 Oct 2022 14:47:10 +0330 Message-ID: Subject: [PATCH] ox.el: Refactor variable org-html--id-attr-prefix, ox-html.el: Add support for the ID property to org-html--reference To: emacs-orgmode@gnu.org Content-Type: multipart/mixed; boundary="0000000000004bc7ad05eb9db534" Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=feraidoonmehri@gmail.com; helo=mail-pf1-x42a.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 24 Oct 2022 00:49:25 -0400 X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Emacs-orgmode" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1666593020; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=ErHPbpXe00ilnsKSvoSlSf7AJohH3dn/2ekHMPGG6c0=; b=floXx2bKYb2uNV8tlFsbzrcih3D+aTAK+gydDcmgRZKeIafy+J+8Lc07WGnpgQ+REVA75o ZRw5WTHJl1vGcbjc++8JWlWq7QveZQhYZQOZv6X03z1emH3VNbGrFZcmU+8by35ZqhcDBG abbyhrG9okSoMe6pkAo1WjSqf0/MwhAe0SkDNhC73AsTNdmfWgt1KM836b6Y/mSMwUiFTT VFgTzpFyauiTF47NyxO9JGKNVJZIeaZLdw0DVC/+3stLJ828xXuWvQXAj+ot6hVFaYN8Pu kXYe1CDgrMZtGWRbOHhF3N0eusjq7ak8uAQhmjTdTuDU79w8KKh+52F6gtz7vg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1666593020; a=rsa-sha256; cv=none; b=WOMzwS+poX/LdjcX5L50d5B57qKvYgslANFATf4DYcir+SDzm0QXHQSP+n2ufNEPO5n1Sh vkwxh51R4vLSnO8Omvme7+NwRIxlOryz/XjSAO7gRUk3BvCZ4dp1q2rVvBxgrHEzy3uZoB CnY2/wf2789n9XAEMc75roRaiklgjfu7zBoP6qX1kkrB5L0ePH3r7ZnxvE7yld9jnc+P8G /DEdg36vGXQZ8u9kRTfFGJlyVN316mqP55Sf3O7iqiyqTTsSv2fHszB/3DHDyxot4K9PNU 2tYMzgypQ+Ea7Pdn/Kcr43Rjm0i+DRvTQ92NWOxhC/k/ryxGQkHtcgnbu88LFg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Ww0gjEqD; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.90 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Ww0gjEqD; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 1366B3B640 X-Spam-Score: -4.90 X-Migadu-Scanner: scn0.migadu.com X-TUID: 1YMoSS2GQK1f --0000000000004bc7ad05eb9db534 Content-Type: text/plain; charset="UTF-8" I have already signed the copyright assignment. (Though I used my other email rudiwillalwaysloveyou@gmail.com when signing it.) I have manually tested the changes with a custom value for `org-html--id-attr-prefix', and everything works. I did not change the behavior of `org-html-prefer-user-labels'; the ID property will not be used if `org-html-prefer-user-labels' is nil. IMO this behavior should be changed, and it should be always used, just like CUSTOM_ID. Changelog: * org/ox.el (org-html--id-attr-prefix): Refactor hardcoded "ID-" as a new private variable. * org/ox-html.el (org-html--reference): Add support for the ID property (previously only supported CUSTOM_ID) These changes make crossfile ID links work in the exported HTML when `org-html-prefer-user-labels' is not-nil. --0000000000004bc7ad05eb9db534 Content-Type: application/octet-stream; name="0001-ox.el-Refactor-variable-org-html-id-attr-prefix-ox-h.patch" Content-Disposition: attachment; filename="0001-ox.el-Refactor-variable-org-html-id-attr-prefix-ox-h.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_l9jttdw30 RnJvbSA2YmM4ZTgzOTVlNTdjMmJkNjQwZWRjZmM2MDNjYjg5ZGRkNGI1Nzc0IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBGZXJhaWRvb24gTWVocmkgPGZlcmFpZG9vbm1laHJpQGdtYWls LmNvbT4KRGF0ZTogU2F0LCAyMiBPY3QgMjAyMiAxNDoxOToyNCArMDMzMApTdWJqZWN0OiBbUEFU Q0hdIG94LmVsOiBSZWZhY3RvciB2YXJpYWJsZSBvcmctaHRtbC0taWQtYXR0ci1wcmVmaXgsCiBv eC1odG1sLmVsOiBBZGQgc3VwcG9ydCBmb3IgdGhlIElEIHByb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dGFza3MsIHJhZGlv CiB0YXJnZXRzIGFuZCB0YXJnZXRzLiIKICAgKGxldCogKCh0eXBlIChvcmctZWxlbWVudC10eXBl IGRhdHVtKSkKLQkgKHVzZXItbGFiZWwKLQkgIChvcmctZWxlbWVudC1wcm9wZXJ0eQotCSAgIChw Y2FzZSB0eXBlCi0JICAgICAoKG9yIGBoZWFkbGluZSBgaW5saW5ldGFzaykgOkNVU1RPTV9JRCkK LQkgICAgICgob3IgYHJhZGlvLXRhcmdldCBgdGFyZ2V0KSA6dmFsdWUpCi0JICAgICAoXyA6bmFt ZSkpCi0JICAgZGF0dW0pKSkKKyAgICAgICAgIChjdXN0b20taWQtcCBuaWwpCisgICAgICAgICAo dXNlci1sYWJlbAorICAgICAgICAgIChvcgorICAgICAgICAgICAob3JnLWVsZW1lbnQtcHJvcGVy dHkKKyAgICAgICAgICAgIChwY2FzZSB0eXBlCisgICAgICAgICAgICAgICgob3IgYGhlYWRsaW5l IGBpbmxpbmV0YXNrKQorICAgICAgICAgICAgICAgKHByb2duCisgICAgICAgICAgICAgICAgIChz ZXRxIGN1c3RvbS1pZC1wIHQpCisgICAgICAgICAgICAgICAgIDpDVVNUT01fSUQpKQorICAgICAg ICAgICAgICAoKG9yIGByYWRpby10YXJnZXQgYHRhcmdldCkgOnZhbHVlKQorICAgICAgICAgICAg ICAoXyA6bmFtZSkpCisgICAgICAgICAgICBkYXR1bSkKKyAgICAgICAgICAgKGlmLWxldAorICAg ICAgICAgICAgICAgKChpZC1wcm9wZXJ0eSAob3JnLWVsZW1lbnQtcHJvcGVydHkKKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDpJRAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ZGF0dW0pKSkKKyAgICAgICAgICAgICAgIChwcm9nbgorICAgICAgICAgICAgICAgICAoc2V0cSBj dXN0b20taWQtcCBuaWwpCisgICAgICAgICAgICAgICAgIChjb25jYXQgb3JnLWh0bWwtLWlkLWF0 dHItcHJlZml4IGlkLXByb3BlcnR5KSkpKSkpCisKICAgICAoY29uZAogICAgICAoKGFuZCB1c2Vy LWxhYmVsCi0JICAgKG9yIChwbGlzdC1nZXQgaW5mbyA6aHRtbC1wcmVmZXItdXNlci1sYWJlbHMp Ci0JICAgICAgIDs7IFVzZWQgQ1VTVE9NX0lEIHByb3BlcnR5IHVuY29uZGl0aW9uYWxseS4KLQkg ICAgICAgKG1lbXEgdHlwZSAnKGhlYWRsaW5lIGlubGluZXRhc2spKSkpCisgICAgICAgICAgIChv ciAocGxpc3QtZ2V0IGluZm8gOmh0bWwtcHJlZmVyLXVzZXItbGFiZWxzKQorICAgICAgICAgICAg ICAgOzsgVXNlZCBDVVNUT01fSUQgcHJvcGVydHkgdW5jb25kaXRpb25hbGx5LgorICAgICAgICAg ICAgICAgY3VzdG9tLWlkLXApKQogICAgICAgdXNlci1sYWJlbCkKICAgICAgKChhbmQgbmFtZWQt b25seQotCSAgIChub3QgKG1lbXEgdHlwZSAnKGhlYWRsaW5lIGlubGluZXRhc2sgcmFkaW8tdGFy Z2V0IHRhcmdldCkpKQotCSAgIChub3QgdXNlci1sYWJlbCkpCisgICAgICAgICAgIChub3QgKG1l bXEgdHlwZSAnKGhlYWRsaW5lIGlubGluZXRhc2sgcmFkaW8tdGFyZ2V0IHRhcmdldCkpKQorICAg ICAgICAgICAobm90IHVzZXItbGFiZWwpKQogICAgICAgbmlsKQogICAgICAodAogICAgICAgKG9y Zy1leHBvcnQtZ2V0LXJlZmVyZW5jZSBkYXR1bSBpbmZvKSkpKSkKQEAgLTMxNDksNyArMzE2Miw3 IEBAIElORk8gaXMgYSBwbGlzdCBob2xkaW5nIGNvbnRleHR1YWwgaW5mb3JtYXRpb24uICBTZWUK IAkocGNhc2UgKG9yZy1lbGVtZW50LXR5cGUgZGVzdGluYXRpb24pCiAJICA7OyBJRCBsaW5rIHBv aW50cyB0byBhbiBleHRlcm5hbCBmaWxlLgogCSAgKGBwbGFpbi10ZXh0Ci0JICAgKGxldCAoK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