From 089af26b02dbdce0c960aa544bd8b803d69d4e5f Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Sun, 21 Aug 2011 10:31:14 -0400 Subject: improved lang:language for codeblock and include code. It no longer strips out surrounding whitespace. --- plugins/code_block.rb | 4 ++-- plugins/include_code.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/code_block.rb b/plugins/code_block.rb index 4d7ca6bb..9c971bf5 100644 --- a/plugins/code_block.rb +++ b/plugins/code_block.rb @@ -55,9 +55,9 @@ module Jekyll @caption = nil @filetype = nil @highlight = true - if markup =~ /\s+lang:(\w+)/i + if markup =~ /\s*lang:(\w+)/i @filetype = $1 - markup = markup.sub(/\s+lang:\w+\s*/i,'') + markup = markup.sub(/lang:\w+/i,'') end if markup =~ CaptionUrlTitle @file = $1 diff --git a/plugins/include_code.rb b/plugins/include_code.rb index 046f6245..5529f322 100644 --- a/plugins/include_code.rb +++ b/plugins/include_code.rb @@ -30,9 +30,9 @@ module Jekyll 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(/\s+lang:\w+\s*/i,'') + markup = markup.strip.sub(/lang:\w+/i,'') end if markup.strip =~ /(.*)?(\s+|^)(\/*\S+)/i @title = $1 || nil -- cgit v1.2.1