Skip to content

Commit

Permalink
make parse_lang_for_codeblock return the language as a symbol, not a …
Browse files Browse the repository at this point in the history
…string
  • Loading branch information
dominikh authored and lsegal committed Jan 31, 2012
1 parent 4690ddf commit 6464b38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/yard/templates/helpers/html_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -510,11 +510,11 @@ def convert_method_to_overload(meth)
end

# @param [String] source the source code whose language to determine
# @return [Array(String, String)] the language, if any, and the remaining source
# @return [Array(Symbol, String)] the language, if any, and the remaining source
def parse_lang_for_codeblock(source)
type = nil
if source =~ /\A(?:[ \t]*\r?\n)?[ \t]*!!!([\w.+-]+)[ \t]*\r?\n/
type, source = $1, $'
type, source = $1.to_sym, $'
end

[type, source]
Expand Down

0 comments on commit 6464b38

Please sign in to comment.