govspeak 0.8.7 → 0.8.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/govspeak.rb +2 -2
- data/test/govspeak_test.rb +10 -0
- metadata +54 -40
data/lib/govspeak.rb
CHANGED
@@ -49,9 +49,9 @@ module Govspeak
|
|
49
49
|
open = Regexp::escape(open)
|
50
50
|
if close
|
51
51
|
close = Regexp::escape(close)
|
52
|
-
%r+(?:\r|\n|^)#{open}(.*?)#{close}(\r|\n|$)?+m
|
52
|
+
%r+(?:\r|\n|^)#{open}(.*?)#{close} *(\r|\n|$)?+m
|
53
53
|
else
|
54
|
-
%r+(?:\r|\n|^)#{open}(.*?)#{open}?(\r|\n|$)+m
|
54
|
+
%r+(?:\r|\n|^)#{open}(.*?)#{open}? *(\r|\n|$)+m
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
data/test/govspeak_test.rb
CHANGED
@@ -54,6 +54,16 @@ class GovspeakTest < Test::Unit::TestCase
|
|
54
54
|
assert_equal "foo bar baz", doc.to_text
|
55
55
|
end
|
56
56
|
|
57
|
+
test "trailing space after the address should not prevent parsing" do
|
58
|
+
input = %{$A
|
59
|
+
123 Test Street
|
60
|
+
Testcase Cliffs
|
61
|
+
Teston
|
62
|
+
0123 456 7890 $A }
|
63
|
+
doc = Govspeak::Document.new(input)
|
64
|
+
assert_equal %{<div class="address vcard"><div class="adr org fn"><p>\n123 Test Street<br />Testcase Cliffs<br />Teston<br />0123 456 7890 \n</p></div></div>\n}, doc.to_html
|
65
|
+
end
|
66
|
+
|
57
67
|
test "govspark extensions" do
|
58
68
|
markdown_regression_tests = [
|
59
69
|
{
|
metadata
CHANGED
@@ -1,59 +1,64 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: govspeak
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.7
|
3
|
+
version: !ruby/object:Gem::Version
|
5
4
|
prerelease:
|
5
|
+
version: 0.8.8
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Ben Griffiths
|
9
9
|
- James Stewart
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
|
14
|
+
date: 2012-01-17 00:00:00 Z
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
16
17
|
name: kramdown
|
17
|
-
requirement: &
|
18
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
18
19
|
none: false
|
19
|
-
requirements:
|
20
|
+
requirements:
|
20
21
|
- - ~>
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
+
- !ruby/object:Gem::Version
|
22
23
|
version: 0.13.3
|
23
24
|
type: :runtime
|
24
25
|
prerelease: false
|
25
|
-
version_requirements: *
|
26
|
-
- !ruby/object:Gem::Dependency
|
26
|
+
version_requirements: *id001
|
27
|
+
- !ruby/object:Gem::Dependency
|
27
28
|
name: htmlentities
|
28
|
-
requirement: &
|
29
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
29
30
|
none: false
|
30
|
-
requirements:
|
31
|
+
requirements:
|
31
32
|
- - ~>
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: "4"
|
34
35
|
type: :runtime
|
35
36
|
prerelease: false
|
36
|
-
version_requirements: *
|
37
|
-
- !ruby/object:Gem::Dependency
|
37
|
+
version_requirements: *id002
|
38
|
+
- !ruby/object:Gem::Dependency
|
38
39
|
name: rake
|
39
|
-
requirement: &
|
40
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
40
41
|
none: false
|
41
|
-
requirements:
|
42
|
+
requirements:
|
42
43
|
- - ~>
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
version: 0.
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.9.0
|
45
46
|
type: :development
|
46
47
|
prerelease: false
|
47
|
-
version_requirements: *
|
48
|
-
description:
|
49
|
-
|
50
|
-
|
48
|
+
version_requirements: *id003
|
49
|
+
description: |-
|
50
|
+
A set of extensions to markdown layered on top of the kramdown
|
51
|
+
library for use in the UK Government Single Domain project
|
52
|
+
email:
|
51
53
|
- ben@alphagov.co.uk
|
52
54
|
- james.stewart@digital.cabinet-office.gov.uk
|
53
55
|
executables: []
|
56
|
+
|
54
57
|
extensions: []
|
58
|
+
|
55
59
|
extra_rdoc_files: []
|
56
|
-
|
60
|
+
|
61
|
+
files:
|
57
62
|
- lib/govspeak/header_extractor.rb
|
58
63
|
- lib/govspeak.rb
|
59
64
|
- Gemfile
|
@@ -62,28 +67,37 @@ files:
|
|
62
67
|
- test/test_helper.rb
|
63
68
|
homepage: http://github.com/alphagov/govspeak
|
64
69
|
licenses: []
|
70
|
+
|
65
71
|
post_install_message:
|
66
72
|
rdoc_options: []
|
67
|
-
|
73
|
+
|
74
|
+
require_paths:
|
68
75
|
- lib
|
69
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
70
77
|
none: false
|
71
|
-
requirements:
|
72
|
-
- -
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
|
75
|
-
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
hash: -776524915
|
82
|
+
segments:
|
83
|
+
- 0
|
84
|
+
version: "0"
|
85
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
86
|
none: false
|
77
|
-
requirements:
|
78
|
-
- -
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
hash: -776524915
|
91
|
+
segments:
|
92
|
+
- 0
|
93
|
+
version: "0"
|
81
94
|
requirements: []
|
95
|
+
|
82
96
|
rubyforge_project:
|
83
|
-
rubygems_version: 1.8.
|
97
|
+
rubygems_version: 1.8.12
|
84
98
|
signing_key:
|
85
99
|
specification_version: 3
|
86
100
|
summary: Markup language for single domain
|
87
|
-
test_files:
|
101
|
+
test_files:
|
88
102
|
- test/govspeak_test.rb
|
89
103
|
- test/test_helper.rb
|