Macro javascript anchor getting converted to link in Fargo editor, preventing rendering

9 views
Skip to first unread message

Rick Cogley

unread,
Nov 28, 2014, 6:50:47 AM11/28/14
to far...@googlegroups.com
Hi - I am trying to add javascript in macro form in my cmsprefs.opml, but the javascript console shows that fargo is getting stuck on the macro section, when I render my outline. 

The macro I am trying to add is here: 

It just collects up social profile URLs and returns HTML with icon links. I am attempting this method, because the Fargo-native social links macro is not working for me (github won't work at all and linkedin does not open to my actual profile, probably because LI has me based in Japan). 

Instead I'm setting attributes like #socialFacebook and referencing those in the macro, and calling the macro from the template. 

After I add the macro, Fargo just shows the "spinner" where it usually shows the number of seconds to render. When I remove the macro, it renders successfully. 

Another observation is, Fargo converts the anchor tags in the macro in #macro in the editor,  into clickable HTML, which seems like a bug. It also means I cannot edit the macro once I paste it in and save. 

Has anyone seen this behavior of trying to render cmsprefs.opml like a regular outline, and would anyone happen to know how I need to enter this javascript to get Fargo to honor it? 

Any advice appreciated. Thank you. 
Regards
Rick 

cmsprefs.opml

Rick Cogley

unread,
Dec 2, 2014, 3:53:12 AM12/2/14
to far...@googlegroups.com
Ok, we tried a few things with this, but, adding anchor tags like "<a href="#">SAMPLE</a>" in both templates and macros was causing Fargo to choke. It was converting the content to actual HTML, and after saving, we could no longer even edit the macros or templates. 

I noticed in the global preferences opml that there were a couple macros with escapes (solidus / backslash) before double quotations in our original macro code. So we tried escaping everything in our original macros, but it did not work either. 

In the end, my developer used javascript "document.createElement('a')" instead, inside the <head> of our custom templates, to generate anchor elements on the resulting html, and this seems to be working fine. 

FYI and regards
Rick 
Reply all
Reply to author
Forward
0 new messages