WikiChunk::Word (Class)

In: app/models/chunks/wiki.rb
Parent: WikiLink

This chunk matches a WikiWord. WikiWords can be escaped by prepending a ’\’. When this is the case, the escaped_text method will return the WikiWord instead of the usual nil. The page_name method returns the matched WikiWord.

Methods

escaped_text   link_text   new   pattern  

Attributes

page_name  [R] 

Public Class methods

[Source]

    # File app/models/chunks/wiki.rb, line 44
44:     def initialize(match_data)
45:       super(match_data)
46:       @escape = match_data[1]
47:       @page_name = match_data[2]
48:     end

[Source]

    # File app/models/chunks/wiki.rb, line 38
38:     def self.pattern
39:       Regexp.new('(\\\\)?(' + WikiWords::WIKI_WORD_PATTERN + ')\b', 0, "utf-8")
40:     end

Public Instance methods

[Source]

    # File app/models/chunks/wiki.rb, line 50
50:     def escaped_text() (@escape.nil? ? nil : page_name) end

[Source]

    # File app/models/chunks/wiki.rb, line 51
51:     def link_text() WikiWords.separate(page_name) end

[Validate]