<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>229819</bug_id>
          
          <creation_ts>2021-09-02 11:23:49 -0700</creation_ts>
          <short_desc>Add automatic IDs for all headings on pages and posts</short_desc>
          <delta_ts>2022-03-10 16:47:44 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit Website</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jon Davis">jond</reporter>
          <assigned_to name="Jon Davis">jond</assigned_to>
          <cc>jond</cc>
    
    <cc>ntim</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1789796</commentid>
    <comment_count>0</comment_count>
    <who name="Jon Davis">jond</who>
    <bug_when>2021-09-02 11:23:49 -0700</bug_when>
    <thetext>Automatically generate navigation ids for all headings in WordPress pages and posts.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1789797</commentid>
    <comment_count>1</comment_count>
      <attachid>437173</attachid>
    <who name="Jon Davis">jond</who>
    <bug_when>2021-09-02 11:27:20 -0700</bug_when>
    <thetext>Created attachment 437173
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1792002</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-09-09 11:24:18 -0700</bug_when>
    <thetext>&lt;rdar://problem/82935497&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1837089</commentid>
    <comment_count>3</comment_count>
      <attachid>437173</attachid>
    <who name="Tim Nguyen (:ntim)">ntim</who>
    <bug_when>2022-02-03 13:41:06 -0800</bug_when>
    <thetext>Comment on attachment 437173
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=437173&amp;action=review

&gt; Websites/webkit.org/wp-content/themes/webkit/functions.php:140
&gt; +add_filter(&apos;the_content&apos;, function($content) {
&gt; +    return preg_replace_callback(&apos;/&lt;h([1-6]{1})&gt;([^&lt;\/h]+)/&apos;, function ($matches) {
&gt; +        return &apos;&lt;h&apos;.$matches[1].&apos; id=&quot;&apos;.sanitize_title_with_dashes($matches[2]).&apos;&quot;&gt;&apos;.$matches[2];
&gt; +    }, $content);
&gt; +});

Does this avoid conflicts with other IDs on the page? (and do we need to?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1850322</commentid>
    <comment_count>4</comment_count>
    <who name="Jon Davis">jond</who>
    <bug_when>2022-03-10 16:43:38 -0800</bug_when>
    <thetext>No it does not avoid conflicts with other IDs on the page. The likelihood is very low given the only sane IDs that could have a conflict are #logo, and #header. It would require a content author to specify a heading with those exact terms (e.g. &lt;h2&gt;Logo&lt;/h2&gt; or &lt;h2&gt;Header&lt;/h2&gt;). Other IDs are generated from WordPress machinery that has almost no chance of being used in content headings (e.g. #site-nav, #menu-main-menu-container, #menu-item-6091).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1850324</commentid>
    <comment_count>5</comment_count>
    <who name="Jon Davis">jond</who>
    <bug_when>2022-03-10 16:47:44 -0800</bug_when>
    <thetext>We could more easily avoid conflicts with the use of a prefix (e.g. #toc-...) or a suffix (e.g. #...-section). It still isn&apos;t foolproof, but adds a measure of extra safety.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>437173</attachid>
            <date>2021-09-02 11:27:20 -0700</date>
            <delta_ts>2021-09-02 11:27:20 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-229819-20210902112719.patch</filename>
            <type>text/plain</type>
            <size>1516</size>
            <attacher name="Jon Davis">jond</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjgxOTM3CmRpZmYgLS1naXQgYS9XZWJzaXRlcy93ZWJraXQu
b3JnL0NoYW5nZUxvZyBiL1dlYnNpdGVzL3dlYmtpdC5vcmcvQ2hhbmdlTG9nCmluZGV4IDQ0OTdi
ZDE3MDkxODMxMGU0ZWFhYTY2NTZjMmZhYTZjOTY2YTUxMmIuLjdiYjE2OTkwYmM0MDM0YTNhM2Fl
ZjkxZDk3ZjY5ZTI2MzU2NTQ2ZDcgMTAwNjQ0Ci0tLSBhL1dlYnNpdGVzL3dlYmtpdC5vcmcvQ2hh
bmdlTG9nCisrKyBiL1dlYnNpdGVzL3dlYmtpdC5vcmcvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTIg
QEAKKzIwMjEtMDktMDIgIEpvbiBEYXZpcyAgPGpvbmRAYXBwbGUuY29tPgorCisgICAgICAgIEdl
bmVyYXRlIGlkIGF0dHJpYnV0ZXMgZm9yIGFsbCBoZWFkaW5ncy4KKyAgICAgICAgaHR0cHM6Ly9i
dWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTIyOTgxOQorCisgICAgICAgIFJldmlld2Vk
IGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgICogd3AtY29udGVudC90aGVtZXMvd2Via2l0
L2Z1bmN0aW9ucy5waHA6CisKIDIwMjEtMDktMDIgIEpvbmF0aGFuIEJlZGFyZCAgPGpiZWRhcmRA
YXBwbGUuY29tPgogCiAgICAgICAgIFtjb250cmlidXRvcnMuanNvbl0gUmVsb2NhdGlvbiAoUGFy
dCAzKQpkaWZ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
bHV0ZQogYWRkX2ZpbHRlcigndGhlX2NvbnRlbnQnLCBmdW5jdGlvbigkY29udGVudCkgewogICAg
IGlmICghaXNfZmVlZCgpKSByZXR1cm4gJGNvbnRlbnQ7Cg==
</data>
<flag name="review"
          id="460295"
          type_id="1"
          status="?"
          setter="jond"
    />
    <flag name="commit-queue"
          id="460296"
          type_id="3"
          status="?"
          setter="jond"
    />
          </attachment>
      

    </bug>

</bugzilla>