reveal.js: Data separator and data vertical don't work with external markdown
I tried the following and it worked:
<section data-markdown data-separator="^\n----\n$" data-vertical="^\n---\n$">
<script type="text/template">
###Title
---
####Title 2
* 1
* 2
</script>
</section>
But if I use an external markdown file:
<section data-markdown="slides/test.md" data-separator="^\n----\n$" data-vertical="^\n---\n$"></section>
Everything is stacked in one page, the vertical slides are not created …
Any idea ? Is it a bug or a config problem ?
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 16 (4 by maintainers)
Commits related to this issue
- updated md slide separator regex #929 see https://github.com/hakimel/reveal.js/issues/929#issuecomment-80738837 — committed to hakimel/reveal.js by hakimel 9 years ago
- All commits before revealJs 3.1.0 Squashed commit of the following: commit 5f90a449cf1fa6edc93aaa4e69e6152c6096cd2e Author: Hakim El Hattab <hakim.elhattab@gmail.com> Date: Fri May 8 08:55:26 2015... — committed to hrambelo/breizhCamp2015-slides by deleted user 9 years ago
- updated md slide separator regex #929 see https://github.com/hakimel/reveal.js/issues/929#issuecomment-80738837 — committed to software-opal/why-python-is-awesome by hakimel 9 years ago
- updated md slide separator regex #929 see https://github.com/hakimel/reveal.js/issues/929#issuecomment-80738837 — committed to rastandy/xwiki-presentation by hakimel 9 years ago
- fix data-seperator on windows https://github.com/hakimel/reveal.js/issues/929 — committed to KyleMit/Presentations by KyleMit 6 years ago
- updated md slide separator regex #929 see https://github.com/hakimel/reveal.js/issues/929#issuecomment-80738837 — committed to rockaBe/presentations by hakimel 9 years ago
This is a problem with the newline sign. Windows use
\r\n
and not\n
. A quik fix for me was to add the following code in line 129 in the plugin filemarkdown.js
The code then looks like this:
Hope that helps to find a clean solution 😉
it’s not
data-vertical
butdata-separator-vertical
Did this bug creep back into the latest version. I cannot get a vertical slide to work - in either the external or md file.
For external
<section data-markdown="example.md" data-separator="^\n----\n" data-vertical="^\n---\n">
NOTE: I’ve also tried “^\r\n—\r\n” and ^\r\n—\r\n$" and “^\n—\n$”And in this file…
This produces a seperate slide,
but this
Doesn’t produce a new vertical slide, but instead the following “stacked” (single slide)
Oh, @ocombe’s test actually works just great for me after renaming
data-vertical
todata-separator-vertical
(per changes from https://github.com/hakimel/reveal.js/commit/015468c3a2d1d4092f33920ac555a0e288e6213f, released in 3.0 on Jan 9, 2015).I believe @rhhamburg correctly diagnosed the issue: if I switch my
slides.md
file between Unix and Windows line endings, it works (Unix) and fails (Windows).Updating the regex to include an optional
\r
fixes it for me regardless of line endings:data-separator="^\r?\n----\r?\n$" data-separator-vertical="^\r?\n---\r?\n$"
Similarly, the following regex works with both line endings:
data-separator="^----$" data-separator-vertical="^---$"