fb-instant-articles
fb-instant-articles copied to clipboard
Custom Shortcode in Instant Articles
Hi guys,
Steps required to reproduce the problem
I am using a shortcode in my wordpress post something like this [shortcode_name param1=123], this calls an api and returns some dynamic html.
Expected Result
The above shortcode returns something like this:
<div class="native">
<!-- SOME MORE HTML CODE -->
</div>
<style>
.native{color: red;}
</style>
Actual Result
But when i do Toggle debug information, FB parser strips the entire code returned from shortcode. I know I can add custom rule. But there are some problems/questions:
- I will have to add the rule for each elements
- when i add rule for style element, the parser then returns warning for all the code inside style element, how do i add that?
- Ideally this shortcode returns different result on each call, but will FB cache the static html and return same result every time?
Thanks for help.