Solution 1 :

My approach would look something like this. Declare a list with all combinations of names (e.g. musical_note) and their corresponding html entity. Then access the list and use the value. There is no built-in function for that at least not to my knowledge.

const list = {":musical_note:" : "🎵"};
document.getElementById("container").innerHTML = list[":musical_note:"];
<div id="container"></div>

Problem :

I am using github Api to get title and description of my repositories. In description of my repositories i have used some emojis like :musical_note: and :speech_balloon:. But in web browser it is coming as plain text. But i want it to be emojis. Does anyone know solution for this?

Comments

Comment posted by Yatharth Verma

but my code is dynamic not static. I am getting meta data from github api about my repositories, in that some emojis are there. I want them to show as it is in html

Comment posted by Aaron

Then you will have to declare a dictionary with all your wanted / needed emojis, Check my answer

Comment posted by Yatharth Verma

Thanks I will try this

By

Leave a Reply

Your email address will not be published. Required fields are marked *