Closed xiaoxin01 closed 7 years ago
Hey @xiaoxin01. What does your faq content look like exactly?
Is it all on one big page btw? Or multiple pages?
Hi @gregjacobs,
FAQ Content is HTML Based and each faq has it's separate page, eg. http://labs.mediatek.com/zh-cn/faq/FAQ19879
Ok, I don't think autolinker will be able to help you then. It wouldn't know that faqs are supposed to be linked, and it also wouldn't know which faqs exist within your system.
You could always do a simple text replacement though, either server side or client side. Something like this might work client side (although it doesn't take into account if a given faq id exists or not):
htmlOfPage = htmlOfPage.replace( /faq(\d+)/, function( match, faqId ) {
var url = 'http://mySite.com/faq/' + faqId;
return '<a href="' + url + '">' + match + '</a>';
} );
Not sure if that helps or not but hope it does!
@gregjacobs I will try this, thank you~
I have a faq library. Each of faq has a id like faqxxxxx. Any of them may reference of each other.
What I want is that if an faq id exist in the faq content, it would become to a link with the site url prefix. It means if my site url is http://a.com, the faq id will change to
Is this possible?