Skip to content

Commit

Permalink
Accepting all non-whitespace characters as language names for Pygment…
Browse files Browse the repository at this point in the history
…s code highlighting
  • Loading branch information
imathis committed Apr 9, 2013
1 parent 3ab22cb commit afca876
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:(\S+)/i
@filetype = $1
markup = markup.sub(/\s*lang:([\w-]+)/i,'')
markup = markup.sub(/\s*lang:(\S+)/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:(\S+)/i
@filetype = $1
markup = markup.strip.sub(/\s*lang:([\w-]+)/i,'')
markup = markup.strip.sub(/lang:\S+/i,'')
end
if markup.strip =~ /(.*)?(\s+|^)(\/*\S+)/i
@title = $1 || nil
Expand Down

0 comments on commit afca876

Please sign in to comment.