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

FEATURE: add HTML replacements #26883

Merged
merged 1 commit into from May 14, 2024
Merged

Conversation

ZogStriP
Copy link
Member

@ZogStriP ZogStriP commented May 6, 2024

This adds support for Watched Words to allow replacement with HTML content rather than always replacing with text.

Can be useful when automatically replacing with the <abbr> tag for example.

Discussion - https://meta.discourse.org/t/replace-text-with-more-than-just-links/305672

@github-actions github-actions bot added the i18n PRs which update English locale files or i18n related code label May 6, 2024
@discoursebot
Copy link

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/replace-text-with-more-than-just-links/305672/23

@ZogStriP ZogStriP force-pushed the replace-watched-words-with-html branch from 637e926 to b0cedb6 Compare May 6, 2024 14:22
This adds support for Watched Words to allow replacement with HTML content rather than always replacing with text.

Can be useful when automatically replacing with the '<abbr>' tag for example.

Discussion - https://meta.discourse.org/t/replace-text-with-more-than-just-links/305672
@ZogStriP ZogStriP force-pushed the replace-watched-words-with-html branch from b0cedb6 to 7256bb2 Compare May 6, 2024 15:08
Copy link
Contributor

@Drenmi Drenmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation looks fine, but do we need any sort of sanitizing here to prevent adding an XSS attack vector?

@ZogStriP
Copy link
Member Author

ZogStriP commented May 7, 2024

Watched Words can only be added / edited by admins. It sure is a 🔫 though

Copy link
Contributor

@Drenmi Drenmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. I let you decide if/how to handle it. Code looks good. 🙂

@ZogStriP ZogStriP merged commit 1eec8c3 into main May 14, 2024
16 checks passed
@ZogStriP ZogStriP deleted the replace-watched-words-with-html branch May 14, 2024 08:41
@discoursebot
Copy link

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/replacing-watched-words-with-markdown-doesnt-render-the-markdown/272014/3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n PRs which update English locale files or i18n related code
3 participants