[wp-trac] [WordPress Trac] #61301: HTML API: Tag bookmark length is incorrect

WordPress Trac noreply at wordpress.org
Wed May 29 11:40:34 UTC 2024


#61301: HTML API: Tag bookmark length is incorrect
-------------------------------------------------+-------------------------
 Reporter:  jonsurrell                           |       Owner:  dmsnell
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  6.6
Component:  HTML API                             |     Version:  6.5
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests needs-dev-  |     Focuses:
  note                                           |
-------------------------------------------------+-------------------------
Changes (by dmsnell):

 * owner:  (none) => dmsnell
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"58233" 58233]:
 {{{
 #!CommitTicketReference repository="" revision="58233"
 HTML API: Fix token length bug in Tag Processor.

 The Tag Processor stores the byte-offsets into its HTML document where
 the current token starts and ends, and also for every bookmark. In some
 cases for tags, the end offset has been off by one.

 In this patch the offset is fixed so that a bookmark always properly
 refers to the full span of the token it's bookmarking. Also the current
 token byte offsets are properly recorded.

 While this is a defect in the Tag Processor, it hasn't been exposed
 through the public interface and has not affected any of the working
 of the processor. Only subclasses which rely on the length of a bookmark
 have been potentially affected, and these are not supported environments
 in the ongoing work.

 This fix is important for future work and for ensuring that subclasses
 performing custom behaviors remain as reliable as the public interface.

 Developed in https://github.com/WordPress/wordpress-develop/pull/6625
 Discussed in https://core.trac.wordpress.org/ticket/61301

 Props dmsnell, gziolo, jonsurrell, westonruter.
 Fixes #61301.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61301#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list