Minor Cleanups
Remove a no-longer-needed function. ' -> &39; Fix regexp for tag chunk.
This commit is contained in:
parent
f6508de6dd
commit
ca1e8de89c
6 changed files with 6 additions and 14 deletions
|
@ -18,7 +18,7 @@ class Category < Chunk::Abstract
|
|||
def initialize(match_data, content)
|
||||
super(match_data, content)
|
||||
@hidden = match_data[1]
|
||||
@list = match_data[2].split(',').map { |c| c.to_s.is_utf8? ? html_escape(c.strip) : nil }
|
||||
@list = match_data[2].split(',').map { |c| c.to_s.is_utf8? ? c.strip.escapeHTML : nil }
|
||||
@list.compact!
|
||||
@unmask_text = ''
|
||||
if @hidden
|
||||
|
|
|
@ -78,14 +78,6 @@ module Chunk
|
|||
@content.delete_chunk(self)
|
||||
end
|
||||
|
||||
def html_escape(string)
|
||||
string.gsub( /&/, "&" ).
|
||||
gsub( /</, "<" ).
|
||||
gsub( />/, ">" ).
|
||||
gsub( /'/, "'" ).
|
||||
gsub( /"/, """ )
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -24,7 +24,7 @@ module Literal
|
|||
|
||||
# A literal chunk that protects HTML tags from wiki rendering.
|
||||
class Tags < AbstractLiteral
|
||||
TAGS_PATTERN = Regexp.new('<[a-zA-Z]+[^>]*?>', Regexp::MULTILINE)
|
||||
TAGS_PATTERN = Regexp.new('<[-a-zA-Z]+[^>]*?>', Regexp::MULTILINE)
|
||||
def self.pattern() TAGS_PATTERN end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue