# Wanneer een "watched-word-link" in een gebruikersveld staat, wordt deze veranderd in een HTML-link (en het ziet er verschrikkelijk uit)

**URL:** https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460
**Category:** Bug
**Tags:** watched-words
**Created:** [29 juli 2022 om 22:01 UTC](https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460 "2022-07-29T22:01:44Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [29 juli 2022 om 22:01 UTC](https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460/1 "2022-07-29T22:01:44Z")

</div>

When a user puts a watched word into a user field, strange things happen.

This is an example using the User Field `Employer(s)`, and having `Te Whatu Ora` as a watched word link.

Baseline:

> ![image](https://global.discourse-cdn.com/meta/original/4X/9/7/3/9731d6435963f3becf80d9f7615200ea89dc2cb5.png)

  

Changed field to `Te Whatu Ora`:

> ![image](https://global.discourse-cdn.com/meta/original/4X/b/8/5/b8541e4318290bbfa83394c7959c83d7dfa4f8ca.png)

It also changed the field itself:

> ![image](https://global.discourse-cdn.com/meta/original/4X/2/0/5/205382f34f1da41742c5860d6ae602d23ea9b26e.png)

### Suggestion

That watched-words-links are modified so that they do not apply to user\_fields.

Not sure about other watched words (didn’t test them).

---

<div class="post-metadata">

### Author: ![jessii](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jessii/32/354015_2.png) [@jessii](https://meta.discourse.org/u/jessii)
#### Post date: [31 juli 2022 om 18:43 UTC](https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460/2 "2022-07-31T18:43:57Z")

</div>

Hey @nathank – I really enjoy your posts, you always give a good amount of details for what you find!

I see something similar when I do this as well. I put ‘cow goes boo’ as a watched-word-link and when I add it to a user field it shows the full link. However, mine is also showing the first letter of the watched word too. Are you seeing that also? I changed the link, removed and added it to the link list again and it still shows ‘c’ in front of the link:

 ![image](https://global.discourse-cdn.com/meta/original/4X/d/a/4/da4bd9efeedd177f1bb780837920a431941a5a49.png)  
 ![image](https://global.discourse-cdn.com/meta/original/4X/8/f/2/8f20236906a8a86f8e304824182d978a5a4f88e8.png)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [31 juli 2022 om 22:49 UTC](https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460/3 "2022-07-31T22:49:28Z")

</div>

@nbianca recently improved the implementation per:

[https://github.com/discourse/discourse/pull/17590](https://github.com/discourse/discourse/pull/17590)

Are you running latest?

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [1 augustus 2022 om 22:08 UTC](https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460/4 "2022-08-01T22:08:30Z")

</div>

> [@jessii](#):
>
> mine is also showing the first letter of the watched word too.

I can replicate this second issue (version: [af912b4b0e](https://github.com/discourse/discourse/commits/af912b4b0efc9a8182c5b70a323f593b14e7ca38)):

- Add eg ‘Meta’ to `/admin/customize/watched_words/action/link` with a link of `https://meta.discourse.org/`
- Create Custom User Field (editable)
- Insert ‘Meta’ into a user’s Custom Field and save
- Refresh page
- ‘Meta’ has been replaced with ‘Mhttps://meta.discourse.org/’

 ![image](https://global.discourse-cdn.com/meta/original/4X/e/0/c/e0c534f18c13ebff928d94a1f0d43d65883c5aa7.png)

 ![image](https://global.discourse-cdn.com/meta/original/4X/6/1/1/61171369ed4d9aaff637e1828bfb3e005e6a0481.png)

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [2 augustus 2022 om 14:04 UTC](https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460/6 "2022-08-02T14:04:20Z")

</div>

> [@sam](#):
>
> Are you running latest?

Yes, running latest (updated after that merge). Seemed to be a new bug to me - maybe related to that code change?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [2 augustus 2022 om 21:50 UTC](https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460/7 "2022-08-02T21:50:14Z")

</div>

@loic any chances you can have a look at this one?

---

<div class="post-metadata">

### Author: ![loic](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/loic/32/105621_2.png) [@loic](https://meta.discourse.org/u/loic)
#### Post date: [3 augustus 2022 om 12:19 UTC](https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460/9 "2022-08-03T12:19:34Z")

</div>

I’ll have a look 👍

---

<div class="post-metadata">

### Author: ![loic](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/loic/32/105621_2.png) [@loic](https://meta.discourse.org/u/loic)
#### Post date: [3 augustus 2022 om 15:49 UTC](https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460/10 "2022-08-03T15:49:48Z")

</div>

I can’t reproduce locally. I think this bug has been fixed by this PR which has been merged yesterday:  
[https://github.com/discourse/discourse/pull/17445](https://github.com/discourse/discourse/pull/17445)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [10 augustus 2022 om 22:50 UTC](https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460/14 "2022-08-10T22:50:13Z")

</div>

Are we good to close this? We have no repro, are you on latest @nathank and able to repro?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [16 augustus 2022 om 21:49 UTC](https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460/15 "2022-08-16T21:49:25Z")

</div>

@nathank assuming this is fixed now, flag to reopen if still an issue.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [16 augustus 2022 om 21:49 UTC](https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460/16 "2022-08-16T21:49:27Z")

</div>



---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [21 augustus 2022 om 05:39 UTC](https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460/17 "2022-08-21T05:39:09Z")

</div>



---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [21 augustus 2022 om 05:54 UTC](https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460/18 "2022-08-21T05:54:37Z")

</div>

Apologies Sam, has been a busy couple of weeks.

I’m afraid that the issue remains. To reproduce it you need the user field set to ☑ `Show on public profile?`. I was able to do this on a nearly vanilla site as well as my busy / laden with plugins normal site.

It occurs regardless of the case-sensitivity setting, and for `Replace` as well as `Link` (and probably the others, but I didn’t test them).

---

<div class="post-metadata">

### Author: ![MarcP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcp/32/160184_2.png) [@MarcP](https://meta.discourse.org/u/MarcP)
#### Post date: [28 november 2022 om 09:48 UTC](https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460/19 "2022-11-28T09:48:36Z")

</div>

I just noticed watched words \> links also work on custom fields.

e.g.  
discourse = [https://meta.discourse.com](https://meta.discourse.com)

Custom profile field X has value: discourse \> it will show the link in the profile field.

I do not think this is expected behavior.

---

<div class="post-metadata">

### Author: ![Ahmed\_Gagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ahmed_gagan/32/161985_2.png) [@Ahmed\_Gagan](https://meta.discourse.org/u/Ahmed_Gagan)
#### Post date: [28 november 2022 om 11:20 UTC](https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460/20 "2022-11-28T11:20:21Z")

</div>

Hi @MarcP  
I am testing this on the latest discourse branch `test-passed` but I am unable to reproduce the issue. Can you share which discourse version are you using?

---

<div class="post-metadata">

### Author: ![MarcP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcp/32/160184_2.png) [@MarcP](https://meta.discourse.org/u/MarcP)
#### Post date: [28 november 2022 om 11:22 UTC](https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460/21 "2022-11-28T11:22:40Z")

</div>

Before reporting this, I ran a rebuild, so I am on: 2.9.0.beta13 ([0cb6d8c8fc](https://github.com/discourse/discourse/commits/0cb6d8c8fc2913b2ce629cdc174f3b7ccdf0c075)).

I noticed this in a user custom field. Whenever I edit the field, and click save, it returns the URL value I specified for the word.

---

<div class="post-metadata">

### Author: ![Ahmed\_Gagan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ahmed_gagan/32/161985_2.png) [@Ahmed\_Gagan](https://meta.discourse.org/u/Ahmed_Gagan)
#### Post date: [28 november 2022 om 11:33 UTC](https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460/22 "2022-11-28T11:33:33Z")

</div>

Yes, I am able to reproduce this issue.

#### Reproducing Steps:

1. Visit **Admin** → **Customize** → **Watched Words** → **Link**
2. Create a watched word link
3. Visit **Admin** → **Customize** → **User Fields**
4. Create a custom field with field type: **Text Field**
5. Navigate **User Profile** → **Preferences** → **Profile**
6. Enter the watched word created in point 2.
7. Save the preferences.
8. Reload the page and you will find the watched word replaced with the URL specified in point 2.

here’s the screen recording:

---

<div class="post-metadata">

### Author: ![MarcP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcp/32/160184_2.png) [@MarcP](https://meta.discourse.org/u/MarcP)
#### Post date: [28 november 2022 om 11:40 UTC](https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460/23 "2022-11-28T11:40:19Z")

</div>

Perfect.

Also notice “Test Custom Field” should have the same header styling as “Web Site”, am I right? The same UI bug is visible on my instance.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [28 november 2022 om 11:57 UTC](https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460/24 "2022-11-28T11:57:02Z")

</div>

~~I think this has been previously mentioned here [When a watched-word-link is in a user field, it is changed to the HTML link (and it looks terrible)](https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460) as well~~

@MarcP Nathan has confirmed this is the same issue and has merged your topics for easier tracking. 👍

---

<div class="post-metadata">

### Author: ![MarcP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcp/32/160184_2.png) [@MarcP](https://meta.discourse.org/u/MarcP)
#### Post date: [30 januari 2023 om 20:39 UTC](https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460/33 "2023-01-30T20:39:01Z")

</div>

Just noticed, that this issue is still a thing.

[Next page](https://meta.discourse.org/t/when-a-watched-word-link-is-in-a-user-field-it-is-changed-to-the-html-link-and-it-looks-terrible/234460.md?page=2)
