From ab95cca4349640d6e66a356dbe1048ac8c04fbb6 Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Thu, 26 Dec 2013 00:33:34 -0500 Subject: [PATCH] Add TomDoc for Jekyll::Converters::Markdown#allowed_custom_class? --- lib/jekyll/converters/markdown.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/jekyll/converters/markdown.rb b/lib/jekyll/converters/markdown.rb index a539150e..178eaaa8 100644 --- a/lib/jekyll/converters/markdown.rb +++ b/lib/jekyll/converters/markdown.rb @@ -42,6 +42,14 @@ module Jekyll end 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) parser_name !~ /[^A-Za-z0-9]/ && self.class.constants.include?(parser_name.to_sym) end