Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to automatically set rel and target on external links #132

Open
wants to merge 1 commit into
base: 0.2
Choose a base branch
from

Conversation

blast007
Copy link
Contributor

Summary

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Fixed issues

Description

  • Added three configuration values under the 'links' section:
    • internalhosts: array of hostnames to ignore when deciding to add rel or target
    • externalrel: value of the rel attribute that should be added to external links
    • externaltarget: value of the target attribute that should be added to external links
  • For Markdown, inline links are processed based on the configuration values
  • For Twig, an 'a' function was added that takes href, text, and an array of attribute values and returns an HTML fragment with the 'a' tag. The configuration values are used to determine if rel or target should be added to external links. Additionally, it is possible to override the configuration by passing rel or target as an attribute, and passing an empty string for either will prevent the attribute from being added at all.

Check List

  • Added appropriate PhpDoc for modifications
  • Added unit test to ensure fix works as intended

* Added three configuration values under the 'links' section:
  - internalhosts: array of hostnames to ignore when deciding to add rel
or target
  - externalrel: value of the rel attribute that should be added to
external links
  - externaltarget: value of the target attribute that should be added
to external links
* For Markdown, inline links are processed based on the configuration
values
* For Twig, an 'a' function was added that takes href, text, and an
array of attribute values and returns an HTML fragment with the 'a' tag.
The configuration values are used to determine if rel or target should
be added to external links. Additionally, it is possible to override the
configuration by passing rel or target as an attribute, and passing an
empty string for either will prevent the attribute from being added at
all.
@allejo allejo self-requested a review September 5, 2023 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant