Strip `<p>` tags from headers in revealjs slides
When the template renders a revealjs page, the slides look something like this (truncated for brevity)
<section>
<h2>
<p>Slide Title</p>
</h2>
<!-- slide content -->
</section>
This is valid HTML, but it makes styling slides a bit difficult. @gus asked for help styling slide text, and the selector ended up being .reveal section > p, .reveal section > div
because the usual .reveal p
also styled headers. A quick jinja macro to strip the tags might be something like the following:
{% macro strip_p_tag(text) %}
{{- text[3:-4] }}
{% endmacro -%}