Link to home
Start Free TrialLog in
Avatar of Chad Morrison
Chad MorrisonFlag for United States of America

asked on

Next to decode HTML so I can see Font Awesome characters.

Hello!

Trying to display some dynamic font-awesome icons on the screen based on status.  Using FullCalendar, Font-awesome and the project has a mess of other jscript libraries. (ko, angular, bootstrap) in it.

Anyway, this line draws the display line for me.  The last <span> data contains something like '<i class='fa fa-asterisk'></i>'

<img src="img/pic.png" class="event-dataProg hide"  /><span class="event-startdate"></span><span class="event-program"></span><span class='event-status_code' ></span></h4>

however, when inspecting in Chrome, I see:
 <span class="event-status_code">&lt;i class='fa fa-asterisk'&gt;&lt;/i&gt;</span>

if I manually swap out the &lt; &gt; etc, it works for me !    How do I get it not to encode the HTML??  I could call a decode routine in jscript, but unsure of the syntax here.

Thanks!

Chad
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

That is normally done by your editor.  Is this a Wordpress site using the built-in editor?  If so, you will probably have to edit in raw HTML mode to do what you want.  In addition, I'm not sure the editing page is going to load the Font-Awesome library.
Avatar of Brandon Lyon
Brandon Lyon

I notice that you mentioned Angular. If that's the case then this sounds like it's happening because of Typescript compilation somewhere.  Beyond that I'm not sure what the solution is offhand except that there's probably an encode or escape method somewhere that you could use.
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial