joshed-io / reveal-hugo

📽️ Create rich HTML-based presentations with Hugo and Reveal.js
https://reveal-hugo.dzello.com/
MIT License
691 stars 146 forks source link

shortcode HTML seems to be filtered out #76

Open hartzell opened 4 years ago

hartzell commented 4 years ago

I'm having trouble making the notes and fragments shortcodes work.

When I use the note shortcode, I end up with this in the output (via dev window or w/in the public directory):

<h4 id="i-believe-in-multicloud">I believe in multi-cloud.</h4>
<!-- raw HTML omitted -->
</section><section>

When I use the fragment shortcode, the end up with dangerous characters being escape, so there are things like

&lt; span> ....

Am I missing a configuration setting somewhere?

joshed-io commented 4 years ago

Can you share how you're using the note shortcode?

There are examples of using most of the reveal-hugo features, including sections and notes, here in these files:

https://github.com/dzello/reveal-hugo/blob/master/exampleSite/content/_index.md https://github.com/dzello/reveal-hugo/tree/master/exampleSite/content/home

I'd recommend taking a look there and doing a diff against what you have to see if anything jumps out.

hartzell commented 4 years ago

If I cd exampleSite and running hugo server, then navigate to the page that goes with content/home/shortcodes/other.md, I can see the notes in the speaker view.

Likewise, the fragment demos also work.

The usage of these things is quite simple (I've even cut/paste the notes from other.md into my presentation), so I'm assuming it's something in the configuration. I'm running Hugo Static Site Generator v0.60.1/extended darwin/amd64 BuildDate: unknown if that makes a difference.

I started with the programming quotes presentation and welded on a few bits, including the menu plugin and a custom style. There's been a bit of cargo-cultish cut-and-paste. I'll try to keep diffing, or put together a sanitized version that I can share.

I'll keep plugging away.

hartzell commented 4 years ago

Adding this

# currently only the unsafe mode for goldmark is supported
[markup.goldmark.renderer]
unsafe = true

to the top level config.toml made the notes work. fragments still show up as

<p>&lt;span class='fragment '</p>
<blockquote>
</blockquote>
<p>you could move it, but it'll cost you.
</span></p>

(from the view source window).

hartzell commented 4 years ago

Ok, after restarting the browser fragments are also working (modulo the difficulty doing bulleted lists that mentioned in #36).

joshed-io commented 4 years ago

Glad you were able to get it working. The line about goldmark is newer and needs to be in the README, I will add that now, thanks for helping me catch that.

hartzell commented 4 years ago

Ah, weird. Turns out that fragments don't seem to work inside sections....

Gotta balance making progress on the presentation and debugging around this, but will keep trying....

joshed-io commented 4 years ago

Ah yuck, that could be a regression or a bug we hadn't seen yet. I wonder if trying the different the hugo shortcode syntaxes would make a difference.

hartzell commented 4 years ago

This syntax has the same problem:

{{< frag c="One" >}}