0

I'm inserting remark.js slides (as MD files) into a jekyll site (hosted on github, and pre-processing done there).

Since remark.js uses three dashes to indicate a next slide, it's important that these three dashes do not get transformed into a new line '<hr />'.

Is there a way to turn off jekyll preprocessing within an MD file? Or, change the behavior so that --- are not transformed into <hr /> ?

tcs
  • 353
  • 1
  • 3
  • 11

2 Answers2

0

I believe you would need to enter a backslash before the three hyphens, according to this document linked to from Jekyll's website.

Markdown allows you to use backslash escapes to generate literal characters which would otherwise have special meaning in Markdown’s formatting syntax.

But depending on the markdown processor you are using with Jekyll, the escape character could be something other than a backslash, or you might need to escape each hyphen.

Zeke Hernandez
  • 1,226
  • 11
  • 14
  • Thanks for the quick response. Your suggestion sort of works, in that the dashes are not translated into line breaks... but, it embeds the text within a paragraph `

    ---

    `. I need `---` to exist at the beginning of a line.
    – tcs Jan 12 '18 at 15:13
  • Ahh, I didn't think of that. I'm not sure how to configure Jekyll to ignore that. – Zeke Hernandez Jan 12 '18 at 15:27
  • it should only convert it to

    if there is a blank line before the 3 dashes

    – Garr Godfrey Mar 27 '22 at 18:53
0

This might be an old post, but recently I hit the same issue: I couldn't escape --- in markdown such that remarkjs can render them as individual slides. In Jekyll 4.2.2, the --- was converted into </hr> and this was braking remarkjs.

My solution was to write my content for slides into an .md file and put it under _includes/presentations. I didn't add any --- at the beginning of this file so it will not be picked-up by Kramdown for processing. Then I added a regular .md file in _posts, to this file I added the previous one as an include between <pre> tags.

Content of the post file is:

---
layout: presentation
title: TDD Workshop Presentation
permalink: /tdd-workshop-presentation/
---

<pre>{% include presentations/tdd-workshop-1.md %}</pre>

Content of presentations/tdd-workshop-1.md


# TDD

## Test Driven Development Workshop

---

# Agenda

1. Introduction
2. Deep-dive
3. ...

Please mind the new line at the beginning of this file, as that's necessary for the first tag to be rendered properly.

I hope that this helps.

georger
  • 1,568
  • 21
  • 24