Class: Paru::PandocFilter::Para

Inherits:
Block show all
Includes:
InnerMarkdown
Defined in:
lib/paru/filter/para.rb

Overview

A Para is a paragraph: a list of Inline nodes

Instance Method Summary collapse

Constructor Details

#initialize(contents) ⇒ Para

Create a new Para node based on the contents

Parameters:

  • contents (Array)


31
32
33
# File 'lib/paru/filter/para.rb', line 31

def initialize(contents)
    super contents, true
end

Instance Method Details

#has_inline?Boolean

Does a Para have inline content?

Returns:

  • (Boolean)

    true



38
39
40
# File 'lib/paru/filter/para.rb', line 38

def has_inline?
    true
end

#inner_markdownString Originally defined in module InnerMarkdown

Get the markdown representation of this Node's children.

Examples:

Replace all occurrences of “hello” by “world” in all paragraphs

Paru::Filter.run do
    with "Para" do |p|
        p.inner_markdown = p.inner_markdown.gsub "hello", "world"
    end
end         

Returns:

  • (String)

    the inner markdown representation of this Node

#inner_markdown=(markdown) ⇒ Object Originally defined in module InnerMarkdown

Replace this Node's children with the Nodes represented by the markdown string

Examples:

Replace all occurrences of “hello” by “world” in all paragraphs

Paru::Filter.run do
    with "Para" do |p|
        p.inner_markdown = p.inner_markdown.gsub "hello", "world"
    end
end         

Parameters:

  • markdown (String)

    the markdown string to replace this Node's children