Markdown links not working within a <div>

Hello,

I recently installed Discourse (hosting with Digital Ocean) and we’ve encountered a problem: hyper links are not working

Now me and the staff team is quite confused, as hyperlinks are working with all posts/topics, other from one. So I’m wondering, why is this only happening to one topic?

Thanks & Good Day

1 个赞

Sorry, I don’t understand what you have written? Can you provide example links to explain?

1 个赞

Basically, hyperlinks are not working on one specific topic. We’ve removed them from this topic as they don’t work, but on this topic, hyperlinks would show up like this:

[this](https://globalaviators.ca/t/welcome-to-the-global-aviators-community/50)

Normally typing that would lead to a normal link, but that’s how it shows in the finished topic

Sorry, I don’t understand. So links placed in the topic do not work (any links? I’m not following), or links to that topic don’t work from other places?

Or are you saying markdown does not work in a topic somehow? I am super confused :confounded:

2 个赞

Sorry for the confusion. I’ll try to refrase it. When you go to this topic that is having issues and press the hyperlink insert button and fill out the url and text, it does not show up as a link when I hit save edit. Instead of getting a link like this, you end up with this:

[this](https://meta.discourse.org/t/hyperlinks-not-working-with-one-topic/150145?u=infinite_flight_sims)

2 个赞

That topic includes working oneboxes and tags, can you throw a link back in for us to see the output?

3 个赞

On the right side you can see the finished product, look at the text with red underline, that’s how the links look in the finished topic

2 个赞

It’s the div:

<div>a div link to [DDG](https://duckduckgo.com)</div>

a link to [DDG](https://duckduckgo.com)

Results in:

a div link to [DDG](https://duckduckgo.com)

a link to DDG

3 个赞

So I should use that to wrap a link?

No, you should remove the div tags and see if it then works.

4 个赞

It works! Thank You for the help :+1:

1 个赞

Markdown is not supposed to work within HTML blocks…

2 个赞

Additonally (info pulled from the link) if you need to use a div or other block element, since we use CommonMark you can use blank lines to trigger Markdown parsing as follows:

<div>a div link to [DDG](https://duckduckgo.com)</div>

a link to [DDG](https://duckduckgo.com)

<div>

a div link with blank lines to [DDG](https://duckduckgo.com)

</div>

Results in:

a div link to [DDG](https://duckduckgo.com)

a link to DDG

a div link with blank lines to DDG

5 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.