fb-instant-articles icon indicating copy to clipboard operation
fb-instant-articles copied to clipboard

Custom Shortcode in Instant Articles

Open Neha3011 opened this issue 7 years ago • 0 comments

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:

  1. I will have to add the rule for each elements
  2. when i add rule for style element, the parser then returns warning for all the code inside style element, how do i add that?
  3. 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.

Neha3011 avatar Sep 11 '18 20:09 Neha3011