module GitlabKramdown::Parser::FencedCodeblock

Fenced Codeblock

This parser implements codeblocks fenced by “` or ~~~

With a codeblock you can pass the language after the initial fenced separator and use one of Kramdowns syntax highlighters

For maximum compatibility with GitLab, use `:rouge` as your highlighter.

Based on Kramdown GFM implementation

@see docs.gitlab.com/ee/user/markdown.html#code-and-syntax-highlighting

Constants

FENCED_CODEBLOCK_MATCH
FENCED_CODEBLOCK_START

Public Class Methods

included(klass) click to toggle source
# File lib/gitlab_kramdown/parser/fenced_codeblock.rb, line 21
def self.included(klass)
  klass.define_parser(:codeblock_fenced_gitlab, FENCED_CODEBLOCK_START, nil, 'parse_codeblock_fenced')
end