# Discourse does not show the Real Name on a topic page then it (wrongly) assumes it is the same as the Username

**URL:** https://meta.discourse.org/t/discourse-does-not-show-the-real-name-on-a-topic-page-then-it-wrongly-assumes-it-is-the-same-as-the-username/29399
**Category:** Feature
**Created:** [29 Maio , 2015 01:27 UTC](https://meta.discourse.org/t/discourse-does-not-show-the-real-name-on-a-topic-page-then-it-wrongly-assumes-it-is-the-same-as-the-username/29399 "2015-05-29T01:27:48Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![dmitry\_fedyuk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dmitry_fedyuk/32/293153_2.png) [@dmitry\_fedyuk](https://meta.discourse.org/u/dmitry_fedyuk)
#### Post date: [29 Maio , 2015 01:27 UTC](https://meta.discourse.org/t/discourse-does-not-show-the-real-name-on-a-topic-page-then-it-wrongly-assumes-it-is-the-same-as-the-username/29399/1 "2015-05-29T01:27:48Z")

</div>

User has set the Real Name:  
 ![](https://global.discourse-cdn.com/meta/original/3X/f/9/f947559785b60c37f1cf82b58425cc546888d7c2.png)

But Discourse does not show the Real Name because it assumes it too similar to the Username  
 ![](https://global.discourse-cdn.com/meta/original/3X/e/6/e69319aa0f5c63cb74d8de5cf5c2ff089b381d12.png)

The problem code is [https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/components/poster-name.js.es6#L40](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/components/poster-name.js.es6#L40)

```ruby
if (name && this.get('displayNameOnPosts') && (this.sanitizeName(name) !== this.sanitizeName(username))) {

```

And `sanitize` method is defined as: [https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/components/poster-name.js.es6#L7](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/components/poster-name.js.es6#L7)

```javascript
  // sanitize name for comparison
  sanitizeName(name){
    return name.toLowerCase().replace(/[\s_-]/g,'');
  },

```

I think it could be better the one of:

- have possibility to disable such sanitation
- recode `sanitize` method as

```javascript
  // sanitize name for comparison
  sanitizeName(name){
    return name.toLowerCase().trim();
  },

```

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [29 Maio , 2015 01:29 UTC](https://meta.discourse.org/t/discourse-does-not-show-the-real-name-on-a-topic-page-then-it-wrongly-assumes-it-is-the-same-as-the-username/29399/2 "2015-05-29T01:29:22Z")

</div>

This is correct and as designed.

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [29 Maio , 2015 01:34 UTC](https://meta.discourse.org/t/discourse-does-not-show-the-real-name-on-a-topic-page-then-it-wrongly-assumes-it-is-the-same-as-the-username/29399/3 "2015-05-29T01:34:02Z")

</div>

> [@dmitry\_fedyuk](#):
>
> Discourse does not show the Real Name because it assumes it too similar to the Username

Agreed; this is a horrible design and nobody likes it. 😛

See previous discussion:

> [@Allow site operators to control full name suppression on posts](https://meta.discourse.org/t/full-name-isnt-shown-on-post-when-it-matches-username/25378):
>
> Continuing the discussion from [Is user ID + real name redundant?](https://meta.discourse.org/t/is-user-id-real-name-redundant/15306): … well, not quite. It appears that if the user ID is the same as the full name (minus the capitalization and spaces), only the user name displays. In other words, one would see only michaeldowney next to my avatar image instead of “michaeldowney Michael Downey”. While this is indeed redundant, it makes one wonder why that person “doesn’t have a name”. It’s also inconsistent with the user card and user profile page.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [29 Maio , 2015 01:38 UTC](https://meta.discourse.org/t/discourse-does-not-show-the-real-name-on-a-topic-page-then-it-wrongly-assumes-it-is-the-same-as-the-username/29399/4 "2015-05-29T01:38:51Z")

</div>


