# 改进类别链接的主题映射顶部链接标题

**URL:** <https://meta.discourse.org/t/better-topic-map-top-link-title-for-links-to-categories/66375>\
**Category:** UX\
**Tags:** pr-welcome, topic-map\
**Created:** [2017 年7 月 18 日 10:17 UTC](https://meta.discourse.org/t/better-topic-map-top-link-title-for-links-to-categories/66375 "2017-07-18T10:17:36Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

作者： ![kasiabulat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kasiabulat/32/86402_2.png) [@kasiabulat](https://meta.discourse.org/u/kasiabulat)\
发布日期： [2017 年11 月 20 日 20:29 UTC](https://meta.discourse.org/t/better-topic-map-top-link-title-for-links-to-categories/66375/16 "2017-11-20T20:29:26Z")

</div>

Thanks for the tip. Well, I could change the line 11: `token.attrs = [['class', 'hashtag'], ['href', result[0]]]` (in [https://github.com/discourse/discourse/blob/master/app/assets/javascripts/pretty-text/engines/discourse-markdown/category-hashtag.js.es6](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/pretty-text/engines/discourse-markdown/category-hashtag.js.es6)), so that there is also title added as an argument (I guess that there is a funtion that changes slug to the category name, but I haven’t found it yet). If I do it that way, hashtags to new created categories (not all of them, so I think it doesn’t satisfy us) will look something like: `<a class="hashtag" href="/c/1-category-name" title="Category Name">#<span>category-name</span></a>` in post replies. And then what will be needed is getting this title out of the attributes and showing it the post summary (topic map). But the title from attributes is null for these hashtags in the place I tried to change in my previous pull request ([discourse/app/assets/javascripts/discourse/widgets/topic-map.js.es6 at 3b7128102c12d72d0303c83e4f113aa06c23655c · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/3b7128102c12d72d0303c83e4f113aa06c23655c/app/assets/javascripts/discourse/widgets/topic-map.js.es6), call of the function createWidget creating topic-map-link widget, line 127), so this title is probably changed by some other functions earlier and for now I don’t know how exactly it flows. Should I dig into it and analyze how it all works? And please correct me if I don’t undestand something in what I described.

---

_[View the full topic](https://meta.discourse.org/t/better-topic-map-top-link-title-for-links-to-categories/66375)._
