bluefeather 0.30 → 0.31
Sign up to get free protection for your applications and to get access to all the features.
- data/doc/en/index.bfdoc +1 -1
- data/doc/en/index.html +1 -1
- data/doc/index.bfdoc +1 -1
- data/doc/index.html +1 -1
- data/lib/bluefeather.rb +8 -10
- data/spec/code-block.rb +29 -0
- metadata +2 -2
data/doc/en/index.bfdoc
CHANGED
@@ -10,7 +10,7 @@ BlueFeather Manual
|
|
10
10
|
|
11
11
|
-> [Japanese version (original)](../index.html)
|
12
12
|
|
13
|
-
(2009-
|
13
|
+
(2009-09-26: this document based on version 0.31)
|
14
14
|
|
15
15
|
BlueFeather is software for converting text written by extended Markdown like
|
16
16
|
[PHP Markdown Extra][] to html. It is pair of command-line tool and pure Ruby
|
data/doc/en/index.html
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
<p>-> <a href="../index.html">Japanese version (original)</a></p>
|
14
14
|
|
15
|
-
<p>(2009-
|
15
|
+
<p>(2009-09-26: this document based on version 0.31)</p>
|
16
16
|
|
17
17
|
<p>BlueFeather is software for converting text written by extended Markdown like
|
18
18
|
<a href="http://michelf.com/projects/php-markdown/extra/">PHP Markdown Extra</a> to html. It is pair of command-line tool and pure Ruby
|
data/doc/index.bfdoc
CHANGED
data/doc/index.html
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
|
14
14
|
<p>→ <a href="en/index.html">English version</a></p>
|
15
15
|
|
16
|
-
<p>(2009-
|
16
|
+
<p>(2009-09-26 バージョン 0.31 準拠)</p>
|
17
17
|
|
18
18
|
<p>BlueFeather は、拡張 Markdown 記法で書かれたテキストを html に変換するソフトウェアです。
|
19
19
|
コマンドラインツールと、Ruby スクリプト内で変換を行うためのライブラリがセットになっています。</p>
|
data/lib/bluefeather.rb
CHANGED
@@ -42,9 +42,9 @@ require 'uri'
|
|
42
42
|
|
43
43
|
|
44
44
|
module BlueFeather
|
45
|
-
VERSION = '0.
|
46
|
-
VERSION_NUMBER = 0.
|
47
|
-
RELEASE_DATE = '2009-
|
45
|
+
VERSION = '0.31'
|
46
|
+
VERSION_NUMBER = 0.31
|
47
|
+
RELEASE_DATE = '2009-09-26'
|
48
48
|
VERSION_LABEL = "#{VERSION} (#{RELEASE_DATE})"
|
49
49
|
|
50
50
|
UTF8_BOM = "\xef\xbb\xbf"
|
@@ -1149,7 +1149,6 @@ module BlueFeather
|
|
1149
1149
|
@log.debug " Found list %p" % list
|
1150
1150
|
bullet = $1
|
1151
1151
|
list_type = (ListMarkerUl.match(bullet) ? "ul" : "ol")
|
1152
|
-
list.gsub!( /\n{2,}/, "\n\n\n" )
|
1153
1152
|
|
1154
1153
|
%{<%s>\n%s</%s>\n} % [
|
1155
1154
|
list_type,
|
@@ -1158,16 +1157,15 @@ module BlueFeather
|
|
1158
1157
|
]
|
1159
1158
|
}
|
1160
1159
|
end
|
1161
|
-
|
1162
|
-
|
1160
|
+
|
1163
1161
|
# Pattern for transforming list items
|
1164
1162
|
ListItemRegexp = %r{
|
1165
1163
|
(\n)? # leading line = $1
|
1166
1164
|
(^[ ]*) # leading whitespace = $2
|
1167
1165
|
(#{ListMarkerAny}) [ ]+ # list marker = $3
|
1168
1166
|
((?m:.+?) # list item text = $4
|
1169
|
-
|
1170
|
-
(?= \n* (\z | \2 (#{ListMarkerAny}) [ ]+))
|
1167
|
+
\n)
|
1168
|
+
(?= (\n*) (\z | \2 (#{ListMarkerAny}) [ ]+))
|
1171
1169
|
}x
|
1172
1170
|
|
1173
1171
|
### Transform list items in a copy of the given +str+ and return it.
|
@@ -1176,12 +1174,12 @@ module BlueFeather
|
|
1176
1174
|
|
1177
1175
|
# Trim trailing blank lines
|
1178
1176
|
str = str.sub( /\n{2,}\z/, "\n" )
|
1179
|
-
|
1180
1177
|
str.gsub( ListItemRegexp ) {|line|
|
1181
1178
|
@log.debug " Found item line %p" % line
|
1182
1179
|
leading_line, item = $1, $4
|
1180
|
+
separating_lines = $5
|
1183
1181
|
|
1184
|
-
if leading_line or /\n{2,}/.match(
|
1182
|
+
if leading_line or /\n{2,}/.match(item) or not separating_lines.empty? then
|
1185
1183
|
@log.debug " Found leading line or item has a blank"
|
1186
1184
|
item = apply_block_transforms( outdent(item), rs )
|
1187
1185
|
else
|
data/spec/code-block.rb
CHANGED
@@ -143,3 +143,32 @@ describe 'Fenced Code Block:' do
|
|
143
143
|
|
144
144
|
|
145
145
|
end
|
146
|
+
|
147
|
+
describe "0.30 code block bug in list item:" do
|
148
|
+
before(:each) do
|
149
|
+
@bf = BlueFeather::Parser.new
|
150
|
+
@html = @bf.parse_text(@src)
|
151
|
+
@doc = Hpricot(@html)
|
152
|
+
end
|
153
|
+
|
154
|
+
before(:all) do
|
155
|
+
@src = <<MARKDOWN
|
156
|
+
* example list
|
157
|
+
|
158
|
+
~~~
|
159
|
+
code line a
|
160
|
+
|
161
|
+
code line b
|
162
|
+
~~~
|
163
|
+
MARKDOWN
|
164
|
+
end
|
165
|
+
|
166
|
+
specify 'overview' do
|
167
|
+
@doc.should have_elements(1, 'ul li pre code')
|
168
|
+
end
|
169
|
+
|
170
|
+
specify 'body' do
|
171
|
+
@doc.at('pre code').inner_text.should == "code line a\n\ncode line b\n"
|
172
|
+
end
|
173
|
+
|
174
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bluefeather
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: "0.
|
4
|
+
version: "0.31"
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dice
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-09-26 00:00:00 +09:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|