# Markdown links not working within a \<div\>

**URL:** https://meta.discourse.org/t/markdown-links-not-working-within-a-div/150145
**Category:** Support
**Created:** [May 2, 2020, 3:09am UTC](https://meta.discourse.org/t/markdown-links-not-working-within-a-div/150145 "2020-05-02T03:09:03Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![Infinite\_Flight\_Sims](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/infinite_flight_sims/32/176828_2.png) [@Infinite\_Flight\_Sims](https://meta.discourse.org/u/Infinite_Flight_Sims)
#### Post date: [May 2, 2020, 3:09am UTC](https://meta.discourse.org/t/markdown-links-not-working-within-a-div/150145/1 "2020-05-02T03:09:03Z")

</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

---

<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: [May 2, 2020, 3:13am UTC](https://meta.discourse.org/t/markdown-links-not-working-within-a-div/150145/2 "2020-05-02T03:13:13Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Infinite\_Flight\_Sims](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/infinite_flight_sims/32/176828_2.png) [@Infinite\_Flight\_Sims](https://meta.discourse.org/u/Infinite_Flight_Sims)
#### Post date: [May 2, 2020, 3:19am UTC](https://meta.discourse.org/t/markdown-links-not-working-within-a-div/150145/3 "2020-05-02T03:19:17Z")

</div>

Basically, hyperlinks are not working on one specific topic. We’ve removed them from this topic as they don’t work, but on [this](https://globalaviators.ca/t/welcome-to-the-global-aviators-community/50) 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

---

<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: [May 2, 2020, 3:37am UTC](https://meta.discourse.org/t/markdown-links-not-working-within-a-div/150145/4 "2020-05-02T03:37:56Z")

</div>

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 😖

---

<div class="post-metadata">

### Author: ![Infinite\_Flight\_Sims](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/infinite_flight_sims/32/176828_2.png) [@Infinite\_Flight\_Sims](https://meta.discourse.org/u/Infinite_Flight_Sims)
#### Post date: [May 2, 2020, 3:59am UTC](https://meta.discourse.org/t/markdown-links-not-working-within-a-div/150145/5 "2020-05-02T03:59:38Z")

</div>

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](https://meta.discourse.org/t/hyperlinks-not-working-with-one-topic/150145), you end up with this:

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

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [May 2, 2020, 5:13am UTC](https://meta.discourse.org/t/markdown-links-not-working-within-a-div/150145/6 "2020-05-02T05:13:12Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Infinite\_Flight\_Sims](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/infinite_flight_sims/32/176828_2.png) [@Infinite\_Flight\_Sims](https://meta.discourse.org/u/Infinite_Flight_Sims)
#### Post date: [May 2, 2020, 4:52pm UTC](https://meta.discourse.org/t/markdown-links-not-working-within-a-div/150145/8 "2020-05-02T16:52:21Z")

</div>

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

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

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [May 2, 2020, 4:57pm UTC](https://meta.discourse.org/t/markdown-links-not-working-within-a-div/150145/10 "2020-05-02T16:57:38Z")

</div>

It’s the div:

```plaintext
<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](https://duckduckgo.com)

---

<div class="post-metadata">

### Author: ![Infinite\_Flight\_Sims](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/infinite_flight_sims/32/176828_2.png) [@Infinite\_Flight\_Sims](https://meta.discourse.org/u/Infinite_Flight_Sims)
#### Post date: [May 2, 2020, 5:03pm UTC](https://meta.discourse.org/t/markdown-links-not-working-within-a-div/150145/11 "2020-05-02T17:03:14Z")

</div>

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

So I should use that to wrap a link?

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [May 2, 2020, 5:04pm UTC](https://meta.discourse.org/t/markdown-links-not-working-within-a-div/150145/12 "2020-05-02T17:04:09Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Infinite\_Flight\_Sims](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/infinite_flight_sims/32/176828_2.png) [@Infinite\_Flight\_Sims](https://meta.discourse.org/u/Infinite_Flight_Sims)
#### Post date: [May 2, 2020, 5:06pm UTC](https://meta.discourse.org/t/markdown-links-not-working-within-a-div/150145/13 "2020-05-02T17:06:13Z")

</div>

It works! Thank You for the help 👍

---

<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: [May 2, 2020, 5:56pm UTC](https://meta.discourse.org/t/markdown-links-not-working-within-a-div/150145/14 "2020-05-02T17:56:22Z")

</div>

Markdown is not supposed to work within HTML blocks..

> <https://stackoverflow.com/questions/29368902/how-can-i-wrap-my-markdown-in-an-html-div>

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [May 4, 2020, 4:29pm UTC](https://meta.discourse.org/t/markdown-links-not-working-within-a-div/150145/15 "2020-05-04T16:29:19Z")

</div>

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:

```plaintext
<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](https://duckduckgo.com)

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

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [June 3, 2020, 4:29pm UTC](https://meta.discourse.org/t/markdown-links-not-working-within-a-div/150145/16 "2020-06-03T16:29:33Z")

</div>

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