Add TomDoc for Jekyll::Converters::Markdown#allowed_custom_class?

This commit is contained in:
Parker Moore 2013-12-26 00:33:34 -05:00
parent 7b9984699c
commit ab95cca434
1 changed files with 8 additions and 0 deletions

View File

@ -42,6 +42,14 @@ module Jekyll
end end
private private
# Private: Determine whether a class name is an allowed custom markdown
# class name
#
# parser_name - the name of the parser class
#
# Returns true if the parser name contains only alphanumeric characters
# and is defined within Jekyll::Converters::Markdown
def allowed_custom_class?(parser_name) def allowed_custom_class?(parser_name)
parser_name !~ /[^A-Za-z0-9]/ && self.class.constants.include?(parser_name.to_sym) parser_name !~ /[^A-Za-z0-9]/ && self.class.constants.include?(parser_name.to_sym)
end end