From 269bc27acb993867eb4e070f3dd673399eb5647f Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Tue, 9 Apr 2013 09:20:45 -0500 Subject: [PATCH] Allow any non-whitespace character in language types for pygments code highlighting. Addresses #1166 --- plugins/pygments_code.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/pygments_code.rb b/plugins/pygments_code.rb index b06b153..b14968c 100644 --- a/plugins/pygments_code.rb +++ b/plugins/pygments_code.rb @@ -114,7 +114,7 @@ module HighlightCode end def parse_markup (input) - lang = input.match(/\s*lang:(\w+)/i) + lang = input.match(/\s*lang:([\S+)/i) title = input.match(/\s*title:\s*(("(.+?)")|('(.+?)')|(\S+))/i) linenos = input.match(/\s*linenos:(\w+)/i) escape = input.match(/\s*escape:(\w+)/i) @@ -139,7 +139,7 @@ module HighlightCode end def clean_markup (input) - input.sub(/\s*lang:\s*\w+/i, '' + input.sub(/\s*lang:\s*\S+/i, '' ).sub(/\s*title:\s*(("(.+?)")|('(.+?)')|(\S+))/i, '' ).sub(/\s*url:\s*(\S+)/i, '' ).sub(/\s*link_text:\s*(("(.+?)")|('(.+?)')|(\S+))/i, ''