Class: Paru::PandocFilter::Inline

Inherits:
Node
  • Object
show all
Includes:
InnerMarkdown
Defined in:
lib/paru/filter/inline.rb

Overview

An Inline node

Instance Method Summary collapse

Constructor Details

#initialize(contents) ⇒ Inline

Create a new Inline node with contents

Parameters:

  • contents (Array)

    the contents of this inline node



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

def initialize(contents)
    super contents, true
end

Instance Method Details

#has_inline?Boolean

Has this Inline node inline contents? Of course!

Returns:

  • (Boolean)

    true



45
46
47
# File 'lib/paru/filter/inline.rb', line 45

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

#is_inline?Boolean

Is this Inline node inline? Of course!

Returns:

  • (Boolean)

    true



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

def is_inline?()
    true
end