presenterm icon indicating copy to clipboard operation
presenterm copied to clipboard

HTML causes presenterm to crash

Open tmbdev opened this issue 1 year ago • 4 comments

If there is any HTML inside the presentation, presenterm aborts with a parse error:

                       Error loading presentation: 

                       parse error at 292:1: unsupported element:
                       html block

This seems unnecessarily restrictive.

The simplest solution (and the Markdown compliant solution I believe) would be simply to display the HTML as text, without any attempt at rendering it.

Of course, it would be nice if a few common and easy tags were recognized: <BR>, <P>, <FONT>, <PRE>, <CENTER>, etc.

This is with presenterm 0.8.0 on Ubuntu 24.04 running under Kitty.

tmbdev avatar Sep 15 '24 14:09 tmbdev

Could you expand on what is the use case you have in mind where you would you want raw HTML showing up in your presentation? To me if the tool doesn't support rendering HTML I would prefer it to tell me it doesn't support it rather than spitting out HTML tags.

There is an issue regarding text coloring which could benefit from at least supporting span tags and attributes on them but it's been lingering for a while.

mfontanini avatar Sep 16 '24 00:09 mfontanini

@mfontanini I think it would be nice to allow inline html with user-defined css class. For example, it would be nice to highlight texts in different colors to indicate newly added and/or deleted content. tools like marp realize that by allowing users to add classes in theme css file.

fit-sizhe avatar Sep 29 '24 04:09 fit-sizhe

For presentations, HTML is often used for simple things like different font sizes/colors/styles, specific layouts, etc. Usually, nothing more complicated than that.

The thing is, a lot of other tools support it, so the occasional simple HTML just is present in many existing MARP files. If you can't render it, just ignoring the tags is usually fine and the output is still readable. But exiting makes the tool completely unusable with such presentations.

tmbdev avatar Sep 29 '24 18:09 tmbdev

@tmbdev if you don't mind using typst, you can easily achieve those by rendering typst snippet in presenterm. However, it is possible that a long prelude is needed before writing "real" content. I guess an easy way to work around is creating built-in functions for typst styling. Doing so won't change code structure much...

fit-sizhe avatar Sep 30 '24 16:09 fit-sizhe

I'm not sure what you mean. If I wanted to spend a lot of time on rewriting presentations, I would simply remove the HTML. The point is that I have existing MARP files that have HTML that I want to quickly page through or check with presenterm. If I have to change them to make them compliant with presenterm, it's not a useful tool for quickly looking at presentations anymore.

tmbdev avatar Oct 30 '24 14:10 tmbdev

The <kbd> would be nice to use in a presentation: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/kbd

Enough7 avatar Aug 28 '25 10:08 Enough7