# Auto-complete with hashtag doesn't activate when hashtag is first character on a new line

**URL:** https://meta.discourse.org/t/auto-complete-with-hashtag-doesnt-activate-when-hashtag-is-first-character-on-a-new-line/131676
**Category:** Feature
**Created:** [23 oktober 2019 om 02:07 UTC](https://meta.discourse.org/t/auto-complete-with-hashtag-doesnt-activate-when-hashtag-is-first-character-on-a-new-line/131676 "2019-10-23T02:07:29Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Heather\_Dudley](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heather_dudley/32/151925_2.png) [@Heather\_Dudley](https://meta.discourse.org/u/Heather_Dudley)
#### Post date: [23 oktober 2019 om 02:07 UTC](https://meta.discourse.org/t/auto-complete-with-hashtag-doesnt-activate-when-hashtag-is-first-character-on-a-new-line/131676/1 "2019-10-23T02:07:29Z")

</div>

When you start a hashtag to refer to another category or tag, if you start it as the _first thing on a new line_ it does not bring up the autocomplete box. This is happening on my site, confirmed here on meta through screenshots below. This means that when I want to list categories one on each line, I have to first compose them on one line, then I hit enter.

They appropriately render, mind you:

#Development

But if I don’t know the path for a subcategory or a tag, I have to guess or compose on a previous line to get the correct path.

Example here, with other characters first:

 ![image](https://global.discourse-cdn.com/meta/original/3X/1/2/125ae06d74f4844921f297f67cf80db40a5c54dc.png)

Newline, hashtag first:

 ![image](https://global.discourse-cdn.com/meta/original/3X/c/b/cbf311d48c313d7d8443882d19460bbfd57dc8ca.png)

---

<div class="post-metadata">

### Author: ![Remah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/remah/32/70590_2.png) [@Remah](https://meta.discourse.org/u/Remah)
#### Post date: [23 oktober 2019 om 04:00 UTC](https://meta.discourse.org/t/auto-complete-with-hashtag-doesnt-activate-when-hashtag-is-first-character-on-a-new-line/131676/2 "2019-10-23T04:00:28Z")

</div>

I expect that occurs because the normal use of hash at the start of a line is for a heading …

# … like this one

In markdown `#text` is a heading. Commonmark has a stricter specification of `# text` so it is possible that this is to maintain compatibility with older markdown.

To avoid the problem, which is not very common, I just put a space before the hash so autocomplete works.

If I mistakenly, out of habit, put the space before a heading then the heading will still work, e.g.:

# hash prefixed by space

# heading

---

<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: [23 oktober 2019 om 05:43 UTC](https://meta.discourse.org/t/auto-complete-with-hashtag-doesnt-activate-when-hashtag-is-first-character-on-a-new-line/131676/3 "2019-10-23T05:43:26Z")

</div>

Yeah this is a quirk we should sort out but it is a bit tricky

```plaintext
# this is a header

```

# this is a header

So if we are to show autocomplete we need to only show it after the second key press so we don’t show it for `#` space, fixing this means we add another corner case.
