5

I have a following markdown for my slate project:

---
title: API Reference
language_tabs:
  - http
  - javascript
search: true
---
# Getting Started
## Logout
# Call Management
## Call States
```javascript
{
}
```
## Call Notification
## Caller ID Called Number
## Call Information During Call

And I use middleman to serve a site: bundle exec middleman server. However, the last subsection title is not interpreted correctly as a h2 tag (screenshot). The result is the same if I build it through rake build.

However, if I put this markdown on other interpreters like http://stackedit.io, it is fine.

So I suspect that my markdown interpreter (Ruby redcarpet) is broken somehow. I did not get any warning/error message on the console. I tried different versions of redcarpet. The interpreted HTML is also erroneous, although errors are different. I suppose some combination of Ruby and Redcarpet will make it?

Here is my config.rb:

# Markdown
set :markdown_engine, :redcarpet
set :markdown,
fenced_code_blocks: true,
smartypants: true,
disable_indented_code_blocks: true,
prettify: true,
tables: true,
with_toc_data: true,
no_intra_emphasis: true

Could anybody tell what the probable cause is? Or how to recover?

enter image description here

Joy
  • 9,430
  • 11
  • 44
  • 95
  • What OS are you using? – Alexey Shein Sep 25 '15 at 10:33
  • I cannot reproduce this problem on my computer, with the same Gemfile. Did you change the `slate` engine somehow? Usually the code snippets are shown in another column with `slate`. – haradwaith Sep 25 '15 at 10:35
  • 1
    Your markdown compiles just fine for me. I just had to comment `therubyracer` gem since it's causing some hanging issues for me (and install `nodejs` package instead). – Alexey Shein Sep 25 '15 at 10:40
  • @AlexeyShein I am on Win7 x64. I am pretty sure that the markdown syntax is correct, because other interpreters work well. I just want to get some hint, at least, about where the probable cause is? Log file, or reinstall which gem, what so ever. – Joy Sep 28 '15 at 00:20

1 Answers1

1

Updating to the newest version (3.3.3) of RedCarpet solved my problem.


Update 1

Well, it still has problems: I cannot change even a single letter inside the Markdown file. Otherwise, the generated HTML markup screws up again...


Update 2

Finally solved. Switching RedCarpet to kramdown solved it.

My config.rb:

# set :markdown_engine, :redcarpet
set :markdown_engine, :kramdown
set :markdown,
    fenced_code_blocks: true,
    smartypants: true,
    disable_indented_code_blocks: true,
    prettify: true,
    tables: true,
    with_toc_data: true,
    no_intra_emphasis: true
Joy
  • 9,430
  • 11
  • 44
  • 95