slipshow icon indicating copy to clipboard operation
slipshow copied to clipboard

Attaching attributes to an element of a markdown list

Open meithecatte opened this issue 1 year ago • 3 comments

Consider the following

- step one
- step two
- big reveal: step three!! muaha

None of the following work right:

- step one
- step two
[- big reveal: step three!! muaha]{.unrevealed #blah}
- step one
- step two
- [big reveal: step three!! muaha]{.unrevealed #blah}
- step one
- step two
- big reveal: step three!! muaha {.unrevealed #blah}
- step one
- step two
{.unrevealed #blah}
- big reveal: step three!! muaha
- step one
- step two
{.unrevealed #blah}- big reveal: step three!! muaha

Is there a way to get this to work without manually typing out the HTML?

<ul>
<li>step one</li>
<li>step two</li>
<li id="blah" class="unrevealed">big reveal: step three!! muaha</li>
<li>...and now I [can't]{.fucking-annoying} use any markdown syntax within the list elements and need to convert everything to HTML!</li>
</ul>

meithecatte avatar Mar 09 '25 00:03 meithecatte

Yes, you are totally right, this is annoying...

I'm not sure what is the best way to be able to attach attributes to list items. I'll write down my though on this here soon!

But first, let me try to provide a few workarounds:

Not sure if that is enough for you, but the following shows the first two steps and then the last one after a forward step:

- step one
- step two {pause}
- big reveal: step three!! muaha

If you "absolutely" need to give some attributes to a list item, you can also use inline raw HTML (not block HTML, the Markdown rules for those are different) to not have to write everything in HTML:

- step one
- step two
  </li><li id="blah" class="unrevealed">big reveal: step three!! muaha
- ...and now [it's]{.fucking-great} that I can use any markdown syntax within the list elements and don't need to convert everything to HTML!

panglesd avatar Mar 09 '25 20:03 panglesd

Not sure if that is enough for you, but the following shows the first two steps and then the last one after a forward step:

Ah, right, what I'm actually doing is later on in the presentation I scroll back up to reveal more bullet points, which is why I need to do it the convoluted way.

If you "absolutely" need to give some attributes to a list item, you can also use inline raw HTML (not block HTML, the Markdown rules for those are different) to not have to write everything in HTML:

Ooooh, that's nasty. I like it.

meithecatte avatar Mar 09 '25 21:03 meithecatte

The same issue on djot, where a syntax is proposed: https://github.com/jgm/djot/issues/250

panglesd avatar Oct 21 '25 09:10 panglesd