In 0.55 it has broken (I only discovered this now when someone kindly contacted me to let me know)
I’ve got it working again. Either of the following fixes it:
Put {{ $_hugo_config := { "version": 1 } }} on line one of tooltip.html
Move the CSS into a separate .css file
Otherwise, the page doesn’t display anything after the shortcode. Looking in the console, it looks like the closing style tag doesn’t render correctly:
Can you help me understand why the change to % causes <style> tags to break, but not html tags? Does blackfriday not tolerate tags? You can put html in it.
I’m not sure the thread you linked helps - it looks like his issue is unresolved/possibly bug with .Inner
I’m not wild about enabling something that reduces security in any way.
I’m fine with following a rule to not include <style> in my shortcodes (or use the old version) if needed - I’m mainly trying to understand why it trips up on that. Especially as it looks like it starts to render it just fine, then falls over on the closing tag.
Edit to add: Ok interestingly deleting empty lines in the CSS got it rendering(ish), just the CSS not working. It’s . . . odd. But maybe I’m failing to understand something about markdown parsing.
For example, layouts/shortcodes/myshortcode.html will be called with either {{< myshortcode />}} or {{% myshortcode /%}} depending on the type of parameters you choose.
So deleting empty lines and some spaces/indents after } has got it working. So this is an issue with how blackfriday copes with CSS. Makes more sense now.