Problem/Motivation

This functionality existed in the D7 version of the module, but wasn't properly wired back up in the D8 upgrade.

See #3104574: Remove unused code that comes from the drupal7 version in module

This means the current Text formats disabled for link extraction part of the configuration is currently not functional.

Steps to reproduce

Have a text field utilizing the "Convert URLs into links" filter. The plain text URLs will not be detected by the module.

Proposed resolution

1. Add an option to enable text format processing (enabling backwards-compatibility)
2. Wire up the code so it's possible to stop certain filters from being applied.
3. Since it's not currently wired up, we can rename the current filter_blacklist configuration to a different name, e.g. filter_blocklist as per https://www.drupal.org/node/3524446, reducing the need for ignoring the cspell rules.

Remaining tasks

Provide MR.

User interface changes

New configuration options for enabling text format processing as part of linkchecker.

API changes

N/A

Data model changes

N/A

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

codebymikey created an issue. See original summary.

codebymikey’s picture

Title: Text formats are not taken into account » Text format filters are not taken into account
Assigned: codebymikey » Unassigned
Issue summary: View changes
Status: Active » Needs review
joelpittet’s picture

Crediting @cgoffin and @mdranove a much older issue #3259505: Html filters aren't applied within the HtmlExtractor and closed it in favour of this one.

joelpittet’s picture

Category: Task » Bug report

This is a bug, re-categorizing

joelpittet’s picture

Thanks @codebymikey — this is a very well-thought-out fix. Keeping the extractor plugin API unchanged, making the behaviour opt-in, validating plugin IDs during the post_update rename, and ensuring HTML restrictors always run all look right. The test coverage also made this easy to review.

I pushed a small follow-up on top:

  • Process items with a NULL text format using the fallback format, as core does. The existing process() branch for this was unreachable.
  • Normalize the migrated D6/D7 blocklist, which still contained the old checkbox 0 values, and add settings-migration coverage. The D7 fixture did not list Link Checker as an enabled source module, so that migration was not previously exercised.
  • Make the new LinkExtractorService constructor argument optional and deprecated for backwards compatibility with service overrides.
  • Log a missing or disabled text format once per request rather than once per field item.

joelpittet’s picture

Status: Needs review » Fixed

Closing out as fixed and ready for 2.2.0. See roadmap #3624551: [meta] 2.2.0 stable release roadmap

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.