joshed-io / reveal-hugo

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

Section with Markdown shortcode inside it excludes slides from the resulting section #32

Open hbobenicio opened 5 years ago

hbobenicio commented 5 years ago

If you put a Markdown shortcode inside a Section, slides after the markdown close tag doen't belong to the current Section.

Example:

{{% section %}}

# My Section: Slide 1

Here the section begins...

---

{{< markdown >}}

# My Section: Slide 2

## I'm a mardown slide, but with custom HTML

<section data-noprocess>
  <h1>Hi, Reveal JS!</h1>
<section>

{{< /markdown >}}

---

# My Section (?): Slide 3

* this is not
* in the
* section any more :(

{{% /section %}}

Am I doing something wrong here? Or this issue is just there?

joshed-io commented 5 years ago

Thanks for reporting @hbobenicio. This could be a bug. Does it make a difference if you use the {{< tags for the section instead of the {{%?

hbobenicio commented 5 years ago

@dzello Thanks for the quick feedback.

you say like this:

{{< section >}}

some slides

{{< markdown >}}

some content

{{< /markdown >}}

some unfortunate slides that stays out of section somehow

{{</ section >}}

If that is the case, the same problem happens.

hbobenicio commented 5 years ago

Renamed the issue's title to better describe what is happening.

joshed-io commented 5 years ago

Thanks for clarifying the title, I will investigate to see what markup is being generated incorrectly.

Curious - is there a reason you're using the Markdown shortcode vs. markdown directly?

hbobenicio commented 5 years ago

I'm using the markdown shortcode just to define HTML slides (with <section data-noprocess>) in order to put some fontawesome icons in it.

I could also download them manually (or via npm) and serve them as static files as well... but I thought that could be a bit more complex solution to manage instead of a plain html slide.

joshed-io commented 5 years ago

Got it. Check out https://reveal-hugo.dzello.com/#/43. You should be able to put in that HTML without the markdown shortcode wrapping it. Let me know if that works.

On Mon, May 20, 2019 at 6:37 PM Hugo BenĂ­cio notifications@github.com wrote:

I'm using the markdown shortcode just to define HTML slides (with <section data-noprocess>) in order to put some fontawesome icons in it.

I could also download them manually (or via npm) and serve them as static files... but I thought that could be a bit more complex solution to manage instead of plain a html slide.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dzello/reveal-hugo/issues/32?email_source=notifications&email_token=AABKVOP72MNWJ5IKFTFQHHTPWLHVFA5CNFSM4HOCL5KKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVZMXGA#issuecomment-494062488, or mute the thread https://github.com/notifications/unsubscribe-auth/AABKVOJQ2HPBUDDECUIZEFDPWLHVFANCNFSM4HOCL5KA .

hbobenicio commented 5 years ago

My bad after all! Thanks for the quick support!

I've already tried that approach but i was doing this:

<section data-noprocess>
  <h1>Hi, Reveal JS!</h1>
<section> <!-- whoops -->

instead of the obvious

<section data-noprocess>
  <h1>Hi, Reveal JS!</h1>
</section>  <!-- let's close it correctly now :P -->

which motivated me to use markdown shortcode in the first place. Anyway, typo fixed and no markdown shortcodes after all!

Really appreciate your help @dzello ! Thanks!

joshed-io commented 5 years ago

Ah hah! Glad that works :)

hbobenicio commented 5 years ago

^^'

Sorry for that but in my excitement about rendering HMTL I forgot to double check about slides in the section.

no markdown shortcode anymore but the issue still persists.

{{< section >}}

some slides here

---
<section data-noprocess>
  <h1>No markdown shortcode, but after this slides still get out of the section</h1>
</section>
---

some slides that still get out of the section somehow

{{</ section >}}

Better to keep this issue, rename it or open it with another name?

joshed-io commented 5 years ago

Does it work if you put at least one newline both before and after the ---?

joshed-io commented 5 years ago

Also, can you verify you're using the latest version of Hugo and of reveal-hugo? There was recently a section-related fix.

hbobenicio commented 5 years ago

Does it work if you put at least one newline both before and after the ---?

Nope... my slides, section shortode and section html tag are already all surrounded by newlines.

Also, can you verify you're using the latest version of Hugo and of reveal-hugo? There was recently a section-related fix.

slides goes off the section still.

joshed-io commented 5 years ago

Sorry I mean two newlines.

Le lun. 20 mai 2019 Ă  19:42, Hugo BenĂ­cio notifications@github.com a Ă©crit :

Does it work if you put at least one newline both before and after the --- ?

Nope... my slides, section shortode and section html tag are all surrounded by newlines.

Also, can you verify you're using the latest version of Hugo and of reveal-hugo? There was recently a section-related fix.

  • upgraded hugo from v0.54.0 to v0.55.6
  • reveal-hugo already on the latest version

slides goes off the section still.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/dzello/reveal-hugo/issues/32?email_source=notifications&email_token=AABKVOKTDK6ED2R6ITKDEJDPWLPINA5CNFSM4HOCL5KKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVZSBFA#issuecomment-494084244, or mute the thread https://github.com/notifications/unsubscribe-auth/AABKVOKUPKGT7GA6Z2QJN2TPWLPINANCNFSM4HOCL5KA .

hbobenicio commented 5 years ago

Can this be related to reveal js itself? Maybe trying to reproduce it with plain html and reveaj js can help us here too. I can create a sandbox I think.

hbobenicio commented 5 years ago

two newlines didn't make it.