grav-plugin-mediaembed icon indicating copy to clipboard operation
grav-plugin-mediaembed copied to clipboard

Run mediaembed after Twig

Open ItsShadowCone opened this issue 9 years ago • 0 comments

I have a simple loop in Twig inside my page that iterates over an array and outputs code for mediaembed like the following

{% for video in videos %}
    ![]({{video}})
{% endfor %}

The problem is, that in the first hook, onPageContentRaw, mediaembed is called with the raw twig code (before twig) whereas in the second hook (onPageContentProcessed) it is called where the twig code is already substituted (after markdown). I would like to have mediaembed called between twig and markdown.

From what i found, wouldn't it be better if mediaembed is called within onMarkdownInitialized instead of or additinally to the other two hooks? see this example: https://github.com/getgrav/grav/pull/747#issuecomment-206821370`

ItsShadowCone avatar Dec 18 '16 15:12 ItsShadowCone