Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a9689a78cb4c05b6902ceaa39f6797bba727f136
      
https://github.com/WebKit/WebKit/commit/a9689a78cb4c05b6902ceaa39f6797bba727f136
  Author: Wenson Hsieh <[email protected]>
  Date:   2026-02-02 (Mon, 02 Feb 2026)

  Changed paths:
    M 
LayoutTests/fast/text-extraction/debug-text-extraction-shorten-urls-expected.txt
    M LayoutTests/fast/text-extraction/debug-text-extraction-shorten-urls.html
    M Source/WebKit/Shared/TextExtractionToStringConversion.cpp
    M Source/WebKit/Shared/TextExtractionURLCache.cpp

  Log Message:
  -----------
  [AutoFill Debugging] Markdown output format sometimes fails to include URLs
https://bugs.webkit.org/show_bug.cgi?id=306738
rdar://169298031

Reviewed by Abrar Rahman Protyasha.

Fix a couple of bugs involving URL shortening and extraction:

1.  We currently have logic to filter out redundant URLs from text extractions; 
however, this
    currently doesn't work when the output format is markdown, which only 
extracts visible text
    content. Fix this by pushing this logic for avoiding redundancy into 
`addPartsForText` in the
    markdown case, by replacing `[example.com](example.com)` with 
`[](example.com)`.

2.  Drive-by fix: in the case where shortened URLs don't contain *any* path 
components, shorten the
    URL by adding a new path component instead of just appending the numeric 
suffix. This means that
    instead of `example.com/<UUID>` becoming `example.com2`, it will become 
`example.com/2`.

* 
LayoutTests/fast/text-extraction/debug-text-extraction-shorten-urls-expected.txt:
* LayoutTests/fast/text-extraction/debug-text-extraction-shorten-urls.html:

Rebaseline a layout test to exercise both changes above.

* Source/WebKit/Shared/TextExtractionToStringConversion.cpp:
(WebKit::addTextRepresentationRecursive):
* Source/WebKit/Shared/TextExtractionURLCache.cpp:
(WebKit::TextExtractionURLCache::add):

Canonical link: https://commits.webkit.org/306629@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to