octopress-code-highlighter 4.0.3 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eaa7b8003229b9a5190ee54429c6600c56e8fd0f
4
- data.tar.gz: 436f78a3eab962ad6a882d89104fc5f1888c7b44
3
+ metadata.gz: 4b873308424a70aaeff4e38929c2d30b3ad997c5
4
+ data.tar.gz: 04c339c9d22b19071a6d188da480d0242329b9ac
5
5
  SHA512:
6
- metadata.gz: 26408b9788d16e3f593b375661fe9f6a17b0d3ce5a5f3fd2c7cdd5ae984f092e3dc21294281e99e5b73d85d09e131af5586ccafd82ce500beef2fd0182e67017
7
- data.tar.gz: fe56c4a7449e23122297d5ab3a626af4516c4ac935239b7de78ca5f546118c920ffcc0386f4dcccbbaa9ef804af990dd6e963b4f3b0241d8c1d06cdbc997825e
6
+ metadata.gz: c9277a808f9fea0e4090c39b7a600698fd5b14ce61e609eb15616d9ef4987887a47afef4cf1533a55a344aaf2a027fd4e1da6d00fc555d7eab6213663b62f091
7
+ data.tar.gz: e06b537a0ab19e4a951ba958712c515567cab02934614607ccbe0b09443a0c63f1f8d3f8db7a413a3e0d43410c8851cc7550a5d93e98ce5c4465584008e19782
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.1.0 - 2014-06-27
4
+ - Added support for setting PHP's startinline option (now defaults to true).
5
+
3
6
  ## 4.0.3 - 2014-06-26
4
7
  - Fixed: Improved escaping characters for Liquid.
5
8
 
@@ -18,6 +18,7 @@ module Octopress
18
18
  .sub(/\s*end:\s*\d+/i,'')
19
19
  .sub(/\s*range:\s*\d+-\d+/i,'')
20
20
  .sub(/\s*escape:\s*\w+/i,'')
21
+ .sub(/\s*startinline:\s*\w+/i,'')
21
22
  end
22
23
 
23
24
  def parse_markup(defaults = {})
@@ -30,7 +31,8 @@ module Octopress
30
31
  link_text: link_text,
31
32
  start: start,
32
33
  end: endline,
33
- escape: escape
34
+ escape: escape,
35
+ startinline: startinline
34
36
  }
35
37
  options = options.delete_if { |k,v| v.nil? }
36
38
  defaults.merge(options)
@@ -40,6 +42,10 @@ module Octopress
40
42
  extract(/\s*lang:\s*(\S+)/i)
41
43
  end
42
44
 
45
+ def startinline
46
+ boolize(extract(/\s*startinline:\s*(\w+)/i))
47
+ end
48
+
43
49
  def url
44
50
  extract(/\s*url:\s*(("(.+?)")|('(.+?)')|(\S+))/i, [3, 5, 6])
45
51
  end
@@ -80,11 +80,13 @@ module Octopress
80
80
  def render_pygments
81
81
  if lexer = Pygments::Lexer.find(lang) || Pygments::Lexer.find(@aliases[lang])
82
82
  begin
83
+ options = { encoding: 'utf-8' }
84
+ if lang =~ /php/
85
+ options[:startinline] = @options[:startinline] || true
86
+ end
83
87
  lexer.highlight @code, {
84
88
  formatter: 'html',
85
- options: {
86
- encoding: 'utf-8'
87
- }
89
+ options: options
88
90
  }
89
91
  rescue MentosError => e
90
92
  raise e
@@ -1,6 +1,6 @@
1
1
  module Octopress
2
2
  module CodeHighlighter
3
- VERSION = "4.0.3"
3
+ VERSION = "4.1.0"
4
4
  end
5
5
  end
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress-code-highlighter
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.3
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-26 00:00:00.000000000 Z
11
+ date: 2014-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorator