# Unable to mention category as first text on line

**URL:** https://meta.discourse.org/t/unable-to-mention-category-as-first-text-on-line/37458
**Category:** Bug
**Tags:** markdown-it-review
**Created:** [5 يناير 2016، 12:53ص UTC](https://meta.discourse.org/t/unable-to-mention-category-as-first-text-on-line/37458 "2016-01-05T00:53:53Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [5 يناير 2016، 12:53ص UTC](https://meta.discourse.org/t/unable-to-mention-category-as-first-text-on-line/37458/1 "2016-01-05T00:53:53Z")

</div>

Continuing the discussion from [Mentioning Categories instead of Groups?](https://meta.discourse.org/t/mentioning-categories-instead-of-groups/14697/16):

**Summary:**

Unable to mention a category when the hashtag is the first text on a line.

**Steps to reproduce:**

1. Create topic or post
2. Add category preceeded by hashtag as first text on a line

**Expected Results:**

Editor offers to autocomplete category name and create mention

**Actual Results:**

Level 1 header is created

**Notes:**

Understand that this conflicts with Markdown spec, so not sure how this could be solved.

**Attachments:**

This is what happens with a category mention on its own line:  
#howto

**Versions and Mods:**

Discourse 1.5.0.beta7 ([meta.discourse.org](https://meta.discourse.org))

**System Information:**

Windows 10 Pro, Chrome Stable 47

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [5 يناير 2016، 1:40ص UTC](https://meta.discourse.org/t/unable-to-mention-category-as-first-text-on-line/37458/2 "2016-01-05T01:40:21Z")

</div>

This isn’t a bug, I added rules to make sure this does not conflict with Markdown’s ATX-style headers.

```plaintext
#This is a h1 header
# This is also a h1 header

```

---

<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: [5 يناير 2016، 1:56ص UTC](https://meta.discourse.org/t/unable-to-mention-category-as-first-text-on-line/37458/3 "2016-01-05T01:56:07Z")

</div>

In commonmark the space is required so I think you can safely ignore that.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [5 يناير 2016، 1:59ص UTC](https://meta.discourse.org/t/unable-to-mention-category-as-first-text-on-line/37458/4 "2016-01-05T01:59:20Z")

</div>

Until we port over to commonmark, the headers are going to conflict with the autocomplete which doesn’t look good to me UX wise. :philosoraptor:

---

<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: [5 يناير 2016، 1:59ص UTC](https://meta.discourse.org/t/unable-to-mention-category-as-first-text-on-line/37458/5 "2016-01-05T01:59:42Z")

</div>


