Class: ComfyPress::Tag::PageMarkdown
- Inherits:
-
Object
- Object
- ComfyPress::Tag::PageMarkdown
show all
- Includes:
- ComfyPress::Tag
- Defined in:
- lib/comfypress/tags/page_markdown.rb
Constant Summary
IDENTIFIER_REGEX, TOKENIZER_REGEX
Instance Attribute Summary
#identifier, #namespace, #page, #params, #parent
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.regex_tag_signature(identifier = nil) ⇒ Object
4
5
6
7
|
# File 'lib/comfypress/tags/page_markdown.rb', line 4
def self.regex_tag_signature(identifier = nil)
identifier ||= IDENTIFIER_REGEX
/\{\{\s*cms:page:(#{identifier}):markdown\s*\}\}/
end
|
Instance Method Details
#content ⇒ Object
9
10
11
|
# File 'lib/comfypress/tags/page_markdown.rb', line 9
def content
block.content
end
|
#render ⇒ Object
13
14
15
16
17
18
19
20
21
|
# File 'lib/comfypress/tags/page_markdown.rb', line 13
def render
md = Redcarpet::Markdown.new(Redcarpet::Render::HTML,
:autolink => true,
:no_intra_emphasis => true,
:fenced_code_blocks => true,
:lax_spacing => true
)
md.render(content.to_s)
end
|