Chad Morrison
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"></sp an><span class='event-status_code' ></span></h4>
however, when inspecting in Chrome, I see:
<span class="event-status_code"> <i class='fa fa-asterisk'></i> </span>
if I manually swap out the < > 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
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"></
however, when inspecting in Chrome, I see:
<span class="event-status_code">
if I manually swap out the < > 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
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.