File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 *
1616 * @access private
1717 * @since 6.2.0
18- * @since {WP_VERSION} Replaced `end` with `length` to more closely match `substr()`.
18+ * @since 6.5.0 Replaced `end` with `length` to more closely match `substr()`.
1919 *
2020 * @see WP_HTML_Tag_Processor
2121 */
@@ -57,7 +57,10 @@ class WP_HTML_Attribute_Token {
5757 public $ start ;
5858
5959 /**
60- * Byte length of the entire attribute name or name and value pair expression.
60+ * Byte length of text spanning the attribute inside a tag.
61+ *
62+ * This span starts at the first character of the attribute name
63+ * and it ends
6164 *
6265 * Example:
6366 *
@@ -70,7 +73,7 @@ class WP_HTML_Attribute_Token {
7073 * <a rel=noopener>
7174 * ------------ length is 11
7275 *
73- * @since {WP_VERSION}
76+ * @since 6.5.0 Replaced `end` with `length` to more closely match `substr()`.
7477 *
7578 * @var int
7679 */
@@ -89,6 +92,7 @@ class WP_HTML_Attribute_Token {
8992 * Constructor.
9093 *
9194 * @since 6.2.0
95+ * @since 6.5.0 Replaced `end` with `length` to more closely match `substr()`.
9296 *
9397 * @param string $name Attribute name.
9498 * @param int $value_start Attribute value.
Original file line number Diff line number Diff line change 1818 *
1919 * @access private
2020 * @since 6.2.0
21- * @since {WP_VERSION} Replaced `end` with `length` to more closely align with `substr()`.
21+ * @since 6.5.0 Replaced `end` with `length` to more closely align with `substr()`.
2222 *
2323 * @see WP_HTML_Tag_Processor
2424 */
@@ -27,14 +27,16 @@ class WP_HTML_Span {
2727 * Byte offset into document where span begins.
2828 *
2929 * @since 6.2.0
30+ *
3031 * @var int
3132 */
3233 public $ start ;
3334
3435 /**
3536 * Byte length of span.
3637 *
37- * @since {WP_VERSION}
38+ * @since 6.5.0
39+ *
3840 * @var int
3941 */
4042 public $ length ;
Original file line number Diff line number Diff line change @@ -337,7 +337,7 @@ class WP_HTML_Tag_Processor {
337337 * 01234
338338 * - token starts at 0
339339 *
340- * @since {WP_VERSION}
340+ * @since 6.5.0
341341 *
342342 * @var int|null
343343 */
@@ -356,7 +356,7 @@ class WP_HTML_Tag_Processor {
356356 * 0123456789 123456789 123456789
357357 * - token length is 17 - 2 = 15
358358 *
359- * @since {WP_VERSION}
359+ * @since 6.5.0
360360 *
361361 * @var int|null
362362 */
@@ -372,6 +372,7 @@ class WP_HTML_Tag_Processor {
372372 * - tag name starts at 1
373373 *
374374 * @since 6.2.0
375+ *
375376 * @var int|null
376377 */
377378 private $ tag_name_starts_at ;
@@ -386,6 +387,7 @@ class WP_HTML_Tag_Processor {
386387 * --- tag name length is 3
387388 *
388389 * @since 6.2.0
390+ *
389391 * @var int|null
390392 */
391393 private $ tag_name_length ;
@@ -1995,6 +1997,14 @@ public function has_self_closing_flag() {
19951997 return false ;
19961998 }
19971999
2000+ /*
2001+ * The self-closing flag is the solidus at the _end_ of the tag, not the beginning.
2002+ *
2003+ * Example:
2004+ *
2005+ * <figure />
2006+ * ^ this appears one character before the end of the closing ">".
2007+ */
19982008 return '/ ' === $ this ->html [ $ this ->token_starts_at + $ this ->token_length - 1 ];
19992009 }
20002010
You can’t perform that action at this time.
0 commit comments