# Can emoji be rendered with absolute URLs?

**URL:** https://meta.discourse.org/t/can-emoji-be-rendered-with-absolute-urls/47250
**Category:** Bug
**Created:** [7월 13, 2016, 9:11오후 UTC](https://meta.discourse.org/t/can-emoji-be-rendered-with-absolute-urls/47250 "2016-07-13T21:11:02Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![jboutros](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jboutros/32/121650_2.png) [@jboutros](https://meta.discourse.org/u/jboutros)
#### Post date: [7월 13, 2016, 9:11오후 UTC](https://meta.discourse.org/t/can-emoji-be-rendered-with-absolute-urls/47250/1 "2016-07-13T21:11:02Z")

</div>

We’re using the API to get topic and post content and display it on a different site. Emoji are being rendered as images with relative links, which are obviously not loading from the other site.

I read through a topic about the wordpress plugin where it seems like a change was made to make emoji URLs absolute.

Do we need to set some sort of base URL in the settings?

`<img src="/images/emoji/emoji_one/slight_smile.png?v=2" title=":slight_smile:" class="emoji" alt=":slight_smile:">`

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [7월 14, 2016, 3:45오전 UTC](https://meta.discourse.org/t/can-emoji-be-rendered-with-absolute-urls/47250/2 "2016-07-14T03:45:40Z")

</div>

This is a problem for the wp-discourse plugin as well. The wp-discourse plugin attempts to fix relative urls with a regular expression, but that has a few problems.

I think the relevant code is here. I’d send a PR, but I don’t know how to properly get a forum’s absolute url from the front end.

[https://github.com/discourse/discourse/blob/master/app/assets/javascripts/pretty-text/emoji.js.es6#L60](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/pretty-text/emoji.js.es6#L60)

---

<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: [7월 14, 2016, 10:36오전 UTC](https://meta.discourse.org/t/can-emoji-be-rendered-with-absolute-urls/47250/3 "2016-07-14T10:36:32Z")

</div>

☹ yeah `frowning2` should definitely be a fully qualified URL in `cooked` as are all the rest of the images. Also it is a bug it is not using the CDN.

@zogstrip maybe have a look at this, recently you played around in this area?

---

<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: [7월 14, 2016, 10:37오전 UTC](https://meta.discourse.org/t/can-emoji-be-rendered-with-absolute-urls/47250/4 "2016-07-14T10:37:44Z")

</div>

Recategorizing this a bug, albeit minor. We should be using CDN for our emojis in cooked.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [7월 15, 2016, 4:38오후 UTC](https://meta.discourse.org/t/can-emoji-be-rendered-with-absolute-urls/47250/5 "2016-07-15T16:38:20Z")

</div>

This should fix it 🍌

[https://github.com/discourse/discourse/commit/caa1aea995be62236af2421bc61b2e85455a22b3](https://github.com/discourse/discourse/commit/caa1aea995be62236af2421bc61b2e85455a22b3)

_NOTE: requires a rebake for existing posts_

---

<div class="post-metadata">

### Author: ![jboutros](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jboutros/32/121650_2.png) [@jboutros](https://meta.discourse.org/u/jboutros)
#### Post date: [7월 15, 2016, 5:34오후 UTC](https://meta.discourse.org/t/can-emoji-be-rendered-with-absolute-urls/47250/6 "2016-07-15T17:34:32Z")

</div>

Interestingly, we seem to get absolute URLs on our dev instance:

`<div class="cooked"><p>This is kinda crazy <img src="https://cdn-standard.discourse.org/images/emoji/emoji_one/slight_smile.png?v=2" title=":slight_smile:" class="emoji" alt=":slight_smile:"></p></div>`

---

<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: [7월 15, 2016, 8:04오후 UTC](https://meta.discourse.org/t/can-emoji-be-rendered-with-absolute-urls/47250/7 "2016-07-15T20:04:44Z")

</div>


