Skip to content

Commit

Permalink
Allowing dashes in code names. Closes home-assistant#1166
Browse files Browse the repository at this point in the history
  • Loading branch information
imathis committed Apr 9, 2013
1 parent 7dfba9a commit 3ab22cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions plugins/code_block.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ def initialize(tag_name, markup, tokens)
@caption = nil
@filetype = nil
@highlight = true
if markup =~ /\s*lang:(\w+)/i
if markup =~ /\s*lang:([\w-]+)/i
@filetype = $1
markup = markup.sub(/lang:\w+/i,'')
markup = markup.sub(/\s*lang:([\w-]+)/i,'')
end
if markup =~ CaptionUrlTitle
@file = $1
Expand Down
4 changes: 2 additions & 2 deletions plugins/include_code.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ class IncludeCodeTag < Liquid::Tag
def initialize(tag_name, markup, tokens)
@title = nil
@file = nil
if markup.strip =~ /\s*lang:(\w+)/i
if markup.strip =~ /\s*lang:([\w-]+)/i
@filetype = $1
markup = markup.strip.sub(/lang:\w+/i,'')
markup = markup.strip.sub(/\s*lang:([\w-]+)/i,'')
end
if markup.strip =~ /(.*)?(\s+|^)(\/*\S+)/i
@title = $1 || nil
Expand Down

0 comments on commit 3ab22cb

Please sign in to comment.