module YARD::Templates::Helpers::HtmlHelper
def detect_lang_in_codeblock_attributes(pre_html_attrs, code_html_attrs)
-
(String, nil)- detected programming language
Parameters:
-
code_html_attrs(String, nil) -- HTML attribute list of +code+ -
pre_html_attrs(String, nil) -- HTML attribute list of +pre+ element
def detect_lang_in_codeblock_attributes(pre_html_attrs, code_html_attrs) detected = nil detected ||= (/\bdata-lang="(.+?)"/ =~ code_html_attrs && $1) detected ||= (/\blang="(.+?)"/ =~ pre_html_attrs && $1) detected ||= (/\bclass="(.+?)"/ =~ code_html_attrs && $1) detected end