formol-bbcode 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
  # Describe your gem and declare its dependencies:
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "formol-bbcode"
6
- s.version = "1.0.0"
6
+ s.version = "1.0.1"
7
7
  s.authors = ["Florian DUTEY"]
8
8
  s.email = ["fdutey@gmail.com"]
9
9
  s.homepage = "https://github.com/mulasse/formol-markdown"
@@ -6,10 +6,12 @@ module Formol
6
6
  class Extensions
7
7
  ::BBCoder.configure do
8
8
  tag :code do
9
+ m = meta.blank? ? nil : meta
10
+
9
11
  output = ""
10
12
 
11
- output << Formol::Formatters::BBCoder::Extensions.title_block(meta)
12
- output << Pygments.highlight(content, :lexer => meta,
13
+ output << Formol::Formatters::BBCoder::Extensions.title_block(m)
14
+ output << Pygments.highlight(content, :lexer => m,
13
15
  :options => {
14
16
  :linenos => 'inline' })
15
17
 
@@ -19,7 +21,16 @@ module Formol
19
21
  tag :quote do
20
22
  wrote = I18n.t('formol.posts.wrote')
21
23
 
22
- %{<blockquote>\n<p><strong>#{meta} #{wrote}:</strong></p>\n#{content}\n</blockquote>}
24
+ output = "<blockquote>\n"
25
+
26
+ unless meta.blank?
27
+ output << "<p><strong>#{meta} #{wrote}:</strong></p>\n"
28
+ end
29
+
30
+ output << content || ''
31
+ output << "\n</blockquote>"
32
+
33
+ output
23
34
  end
24
35
  end
25
36
 
@@ -27,9 +38,11 @@ module Formol
27
38
 
28
39
  class << self
29
40
  def title_block(language)
30
- return nil if language.blank?
41
+ return '' if language.blank?
42
+
43
+ l = language.downcase
31
44
 
32
- %{<div class="highlight_title #{language.downcase}">#{language.downcase.capitalize}</div>}
45
+ %{<div class="highlight_title #{l}">#{l.capitalize}</div>}
33
46
  end
34
47
  end
35
48
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formol-bbcode
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-01-19 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pygments.rb
16
- requirement: &78276420 !ruby/object:Gem::Requirement
16
+ requirement: &84117360 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *78276420
24
+ version_requirements: *84117360
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bbcoder
27
- requirement: &78276060 !ruby/object:Gem::Requirement
27
+ requirement: &84117070 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *78276060
35
+ version_requirements: *84117070
36
36
  description: BBCode formatter for formol forum engine
37
37
  email:
38
38
  - fdutey@gmail.com