Using # to make title bold makes it a link

AI-generated summary

The discussion title “Using # to make title bold makes it a link” revolves around the issue of using # in front of a word making it a link in Discourse. Thomas_G initially raises this point, mentioning that it used to make a word/sentence a header. ondrej confirms that this is an intentional change.

Thomas_G asks if there’s a way to make a header without it becoming a link, which pfaffman thinks is a minor issue. However, Thomas_G persists, explaining that the anchor icon is undesirable in their project.

awesomerobot provides a solution by suggesting the use of HTML heading tags (h1, h2, h3), which Thomas_G finds helpful. Thomas_G then asks about using a heading tag with a word that works as a link, which awesomerobot confirms is possible.

Jagster expresses concern that using HTML tags breaks the idea of Markdown and asks for a CSS trick to hide the anchor icon. awesomerobot provides a CSS solution to hide the anchor icon.

Hello!

Recently, I found out that using # in front of a word makes it work as a link. AFAIK, what it did was to make the word / sentence a header. If that’s intentional, is there any way to make a header similar to the following one without making it a link?

Hello!

Hey again.

Hi Thomas

That will be because of this feature here - this an intentional change :grinning:

https://github.com/discourse/discourse/commit/2ad9b3f432e85e23627e794a6ee7c37be661d387

I see. Is there any way though to make a header without having it work as a link?

What is it hurting? It seems pretty subtle to me (and I’m excited to see it’s working this way!)

Just for something I am working on. I don’t really like the anchor icon to appear every so often.

Does anyone have any ideas on how to achieve that? It’s frustrating to see an anchor icon when you don’t need it.

Trying hard to get around to it but no luck. Ideas anyone?

I think you can use HTML heading tags (h1, h2, h3), like this:

<h3>Unlinked header</h3>

Unlinked header

Of course, how did I miss that? Thank you so much! :heart:

By the way, is it possible to use a heading tag while having a word work as a link?

Yes it is

<h2> <a href="https://meta.discourse.org">Yes</a> it is</h2> 

but if you’re using HTML to create your headings, you’ll also need to use HTML to create the link

I see. Thanks again! :love_you_gesture:

Somehow using html-tags breaks idea of markdown, IMO.

Is there a CSS-trick or something else to hide anchor icon? Link itself isn’t a problem, but that icon.

There’s always a CSS trick :wink:, this should do it:

.cooked, .d-editor-preview {
	h1, h2, h3, h4, h5, h6 {
		&:hover {
			a.anchor {
				&::before {
					display: none;
				}
			}
		}
	}
}