Markdown is misinterpreted by Ruby redcarpet

I have the 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 the site: bundle exec middleman server . However, the last title of the subsection is not interpreted correctly as the h2 tag (screenshot). The result will be the same if I build it through rake build .

However, if I put this markdown on other interpreters, such as http://stackedit.io , this is normal.

Therefore, I suspect that my markdown interpreter ( Ruby redcarpet ) is somehow broken. I did not receive an error / error message on the console. I tried different versions of redcarpet. The interpreted HTML is also erroneous, although the errors are different. I believe some combinations of Ruby and Redcarpet will do this?

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 

Can anyone tell what the probable cause is? Or how to recover?

enter image description here

+5
source share
1 answer

Updating the latest version (3.3.3) from RedCarpet solved my problem.


Update 1

Well, he still has problems: I can't change even one letter inside the Markdown file. Otherwise, the generated HTML markup is twisted again ...


Update 2

Finally decided. Switching RedCarpet to kramdown resolved 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 
+1
source

Source: https://habr.com/ru/post/1232079/


All Articles