Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shortcode HTML seems to be filtered out #76

Open
hartzell opened this issue Feb 24, 2020 · 8 comments
Open

shortcode HTML seems to be filtered out #76

hartzell opened this issue Feb 24, 2020 · 8 comments

Comments

@hartzell
Copy link

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

@joshed-io
Copy link
Owner

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
Copy link
Author

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....

@hartzell hartzell reopened this Feb 25, 2020
@joshed-io
Copy link
Owner

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
Copy link
Author

This syntax has the same problem:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants