Skip to content

[FEATURE] Striptags hrefs in brackets #1060

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tgrigoryan234
Copy link

…02651

Allow `<a>` tag href links to be appended in square brackets next to link text when `hrefsInBrackets` is enabled. Updated tests and documentation to reflect the new functionality.
Replace anonymous function with static function for better performance. Simplify array handling and validation logic for readability and maintainability. Ensure consistent behavior when processing invalid or empty links.
Modified the callback to sanitize link text using allowed tags and ensure URL validation is combined with non-empty text checks. Improves clarity and safety in the handling of <a> tags.
@tgrigoryan234 tgrigoryan234 changed the title Striptags hrefs in brackets [FEATURE] Striptags hrefs in brackets May 1, 2025
@mbrodala
Copy link
Contributor

mbrodala commented May 2, 2025

This looks confusing but slightly like a conversion from HTML to markdown. IMO something for a separate 3rd party package.

@s2b
Copy link
Contributor

s2b commented May 2, 2025

I would say that this conversion should happen before stripTags(), not during. So this should be a separate ViewHelper.

I'm not sure if it's generic enough to be part of Fluid Standalone though. In my opinion, it's too opinionated in contrast to other ViewHelpers. But I'm open to other opinions about that.

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.

3 participants