FEATURE: add HTML replacements

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
This commit is contained in:
Régis Hanol
2024-05-06 17:08:34 +02:00
parent 9b70cbf4bb
commit 1eec8c3fa6
13 changed files with 65 additions and 22 deletions

View File

@@ -4766,7 +4766,7 @@ en:
clear_filter: "Clear filter"
no_results:
title: "No results"
description: "We couldnt find anything matching %{filter}.<br><br>Did you want to <a class=\"sidebar-additional-filter-settings\" href=\"%{settings_filter_url}\">search site settings</a> or the <a class=\"sidebar-additional-filter-users\" href=\"%{user_list_filter_url}\">admin user list?</a>"
description: 'We couldnt find anything matching %{filter}.<br><br>Did you want to <a class="sidebar-additional-filter-settings" href="%{settings_filter_url}">search site settings</a> or the <a class="sidebar-additional-filter-users" href="%{user_list_filter_url}">admin user list?</a>'
welcome_topic_banner:
title: "Create your Welcome Topic"
@@ -6102,6 +6102,7 @@ en:
one: "show %{count} word"
other: "show %{count} words"
case_sensitive: "(case-sensitive)"
html: "(html)"
download: Download
clear_all: Clear All
clear_all_confirm: "Are you sure you want to clear all watched words for the %{action} action?"
@@ -6141,6 +6142,8 @@ en:
upload_successful: "Upload successful. Words have been added."
case_sensitivity_label: "Is case-sensitive"
case_sensitivity_description: "Only words with matching character casing"
html_label: "HTML"
html_description: "Outputs HTML in the replacement"
words_or_phrases: "words or phrases"
test:
button_label: "Test"

View File

@@ -800,6 +800,7 @@ en:
base:
invalid_url: "Replacement URL is invalid"
invalid_tag_list: "Replacement tag list is invalid"
invalid_html: "HTML can only be used for replacement"
sidebar_section_link:
attributes:
linkable_type: