| 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.
| page_name | [R] |
# 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
# 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
# File app/models/chunks/wiki.rb, line 50
50: def escaped_text() (@escape.nil? ? nil : page_name) end