befocken / revealjs-embed-code

Embed external code files into your revealjs presentation
GNU General Public License v3.0
3 stars 1 forks source link

No highlighting & line breaks not preserved #1

Open peter-lyons-kehl opened 2 years ago

peter-lyons-kehl commented 2 years ago

Hi Bent,

Thank you for RevealJS-embed-code.

This is a minor issue (compared to the issue with markdown. I confirm that loading a file works - lovely. However, it doesn't highlight, and it doesn't preserve line breaks.

(I use my own clone of reveal.js and of your revealjs-embed-code, both published to GitHub pages. But both are up to date, with no local changes.) Thanks in advance for any tips.

peter-lyons-kehl commented 2 years ago

Actually, "standard" Markdown's <code> doesn't highlight for me either. So it's most likely not specific to revealjs-embed-code. I'll investigate.

peter-lyons-kehl commented 2 years ago

Update: The fix is to use the following two attributes:

I'll provide a pull request for README.md.

befocken commented 2 years ago

Hi Peter, sorry for my late reply, I was not really monitoring my GitHub or associated mailbox for some time ^^".

Indeed, as you noted correctly, the language-X class is required to display the syntax highlighting. I also used it in my presentations, but forgot to mention it in the README. I'm not sure if it could work in some cases via the automatic recognition that highlight.js provides.

I did not, however, notice an error with the line breaks (the links you provided are not valid anymore as wel). What exactly is not working there?

l0b0 commented 1 month ago

I'm also seeing missing line breaks when using this: <pre class="language-bash"><code class="hljs" data-url="my.bash"></code></pre>. Please ignore, this was caused by some custom CSS.