livingstyleguide 0.5.0 → 0.5.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a074be5029c9a4e91b8bf8b23da0ff2d9656c433
4
- data.tar.gz: 7c0e279055e9f77edc460df6959203f08c61471a
3
+ metadata.gz: 13d4d67aff5436433e7fbb5fc6f12d4e61e590e4
4
+ data.tar.gz: b48543efd1725a37b82a6cc0cd528d9dc5838c89
5
5
  SHA512:
6
- metadata.gz: 39a2fb00a60f5307240f85cb25378b8c58c580fd2ba00158b31d229ce5b720859e590d09c121d54357b199c6761fa002ed0d72d9c2bb2034e0310dd6a1f0015c
7
- data.tar.gz: b9eb472613d008aafd1e482f9a6e050f6c1c5e75029cb9c8053c2f0b3f9853a04e68c5aea994470f02ece4d281841eac57d6e248a3e99ce883fd347aef6f6880
6
+ metadata.gz: 36666790605e6a56db4453b4d83f652e472e036524025da2800fb79635468b57d3b0355c86cd6a5f3bae9f5865ab80eaf192fd356e13f79cdd5bef2b26e47db8
7
+ data.tar.gz: 455f1cdb1707f0be48322705d709add0009c5792d6bde3496b74bfb9abfbe3f88e55a5ea48ba8a9adeb3ee0f27911cbb5004d71f7c161249f23b8d63b5b3523c
data/CHANGELOG.md CHANGED
@@ -13,3 +13,8 @@
13
13
  * Added support for Haml code in examples (`haml-example`,
14
14
  `haml-layout-example`)
15
15
 
16
+ ## 0.5.1
17
+
18
+ * Fixed highlighting in Haml code examples
19
+ * Use the Haml syntax highlighter
20
+
@@ -93,8 +93,9 @@ module LivingStyleGuide
93
93
  type = language[5..-1]
94
94
  require 'haml'
95
95
  Haml::Options.defaults[:attr_wrapper] = '"'
96
- html = Haml::Engine.new(code).render.strip
97
- %Q(<div class="livingstyleguide--#{type}">\n #{html}\n</div>) + "\n" + block_code(code, 'html')
96
+ haml = code.gsub(/\*\*\*(.+?)\*\*\*/m, '\\1')
97
+ html = Haml::Engine.new(haml).render.strip
98
+ %Q(<div class="livingstyleguide--#{type}">\n #{html}\n</div>) + "\n" + block_code(code, 'haml')
98
99
  rescue LoadError
99
100
  raise "Please make sure `gem 'haml'` is added to your Gemfile."
100
101
  end
@@ -1,3 +1,3 @@
1
1
  module LivingStyleGuide
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
@@ -0,0 +1,4 @@
1
+ ~~~ haml-example
2
+ %button***.button*** Test
3
+ ~~~
4
+
@@ -38,7 +38,16 @@ class MarkdownTest < Test::Unit::TestCase
38
38
  <div class="livingstyleguide--example">
39
39
  <button class="button">Test</button>
40
40
  </div>
41
- <pre class="livingstyleguide--code-block"><code class="livingstyleguide--code">%button.button Test</code></pre>
41
+ <pre class="livingstyleguide--code-block"><code class="livingstyleguide--code"><em>%button</em>.button Test</code></pre>
42
+ HTML
43
+ end
44
+
45
+ def test_haml_example_with_highlight
46
+ assert_markdown <<-HTML, 'haml-example-with-highlight.md'
47
+ <div class="livingstyleguide--example">
48
+ <button class="button">Test</button>
49
+ </div>
50
+ <pre class="livingstyleguide--code-block"><code class="livingstyleguide--code"><em>%button</em><strong class="livingstyleguide--code-highlight">.button</strong> Test</code></pre>
42
51
  HTML
43
52
  end
44
53
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: livingstyleguide
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nico Hagenburger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-31 00:00:00.000000000 Z
11
+ date: 2013-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minisyntax
@@ -142,6 +142,7 @@ files:
142
142
  - test/fixtures/markdown/example-with-highlight.md
143
143
  - test/fixtures/markdown/example.md
144
144
  - test/fixtures/markdown/font-example.md
145
+ - test/fixtures/markdown/haml-example-with-highlight.md
145
146
  - test/fixtures/markdown/haml-example.md
146
147
  - test/fixtures/markdown/javascript-example.md
147
148
  - test/fixtures/markdown/layout-example.md
@@ -184,6 +185,7 @@ test_files:
184
185
  - test/fixtures/markdown/example-with-highlight.md
185
186
  - test/fixtures/markdown/example.md
186
187
  - test/fixtures/markdown/font-example.md
188
+ - test/fixtures/markdown/haml-example-with-highlight.md
187
189
  - test/fixtures/markdown/haml-example.md
188
190
  - test/fixtures/markdown/javascript-example.md
189
191
  - test/fixtures/markdown/layout-example.md