mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Do not replace hashtag-cooked text with WatchedWords (#19279)
Adds the .hashtag-cooked as an exception for watched words to not auto-link the text of the hashtag.
This commit is contained in:
@@ -1690,7 +1690,7 @@ HTML
|
||||
SiteSetting.watched_words_regular_expressions = true
|
||||
|
||||
Fabricate(:user, username: "test")
|
||||
category = Fabricate(:category, slug: "test")
|
||||
category = Fabricate(:category, slug: "test", name: "test")
|
||||
Fabricate(:watched_word, action: WatchedWord.actions[:replace], word: "es", replacement: "discourse")
|
||||
|
||||
expect(PrettyText.cook("@test #test test")).to match_html(<<~HTML)
|
||||
@@ -1700,6 +1700,15 @@ HTML
|
||||
tdiscourset
|
||||
</p>
|
||||
HTML
|
||||
|
||||
SiteSetting.enable_experimental_hashtag_autocomplete = true
|
||||
expect(PrettyText.cook("@test #test test")).to match_html(<<~HTML)
|
||||
<p>
|
||||
<a class="mention" href="/u/test">@test</a>
|
||||
<a class="hashtag-cooked" href="#{category.url}" data-type="category" data-slug="test"><svg class="fa d-icon d-icon-folder svg-icon svg-node"><use href="#folder"></use></svg><span>test</span></a>
|
||||
tdiscourset
|
||||
</p>
|
||||
HTML
|
||||
end
|
||||
|
||||
it "supports overlapping words" do
|
||||
|
||||
Reference in New Issue
Block a user