wikiwah 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/wikiwah/flow.rb CHANGED
@@ -89,30 +89,36 @@ module WikiWah
89
89
  # Add a block
90
90
  def add_block(block)
91
91
  case block
92
- when /\A( *)- / # unordered list item
92
+ when /\A( *)- / # unordered list item
93
93
  push_context('ul',$1.size)
94
94
  write_tag($', 'li')
95
- when /\A( *)\* / # unordered list item
95
+ when /\A( *)\* / # unordered list item
96
96
  push_context('ul class="sparse"',$1.size)
97
97
  write_tag($', 'li')
98
98
  when /\A( *)(\#|\d+\.|\(\d+\)) / # ordered list item
99
99
  push_context('ol',$1.size)
100
100
  write_tag($', 'li')
101
- when /\A( *)% / # unordered list item
101
+ when /\A( *)% / # unordered list item
102
102
  push_context('dl',$1.size)
103
103
  write_tag($', 'dt')
104
104
  when /\A(( *)> )/ # citation
105
105
  push_context('blockquote',$2.size)
106
106
  block = strip_prefix($1, block)
107
107
  write_text(block)
108
- when /\A(( *)\| )/ # preformatted (explicit)
108
+ when /\A(( *)\| )/ # preformatted
109
109
  push_context('pre',$2.size)
110
110
  block = strip_prefix($1, block)
111
111
  write_html("<code>" + CGI.escapeHTML(block) + "</code>")
112
- when /\A( *)(=+) / # heading
112
+ when /\A( *)\,-- (\w+).*\n/ # preformatted (with language)
113
+ indent = $1
114
+ lang = $2
115
+ push_context('pre',indent.size)
116
+ block = strip_prefix(indent + "| ", $')
117
+ write_html(%(<code lang="#{lang}">) + CGI.escapeHTML(block) + "</code>")
118
+ when /\A( *)(=+) / # heading
113
119
  flush_context_stack
114
120
  write_tag($', "h#{$2.size}")
115
- when /\A( *)/ # body text
121
+ when /\A( *)/ # body text
116
122
  tag = \
117
123
  if $1 == ""
118
124
  'p'
@@ -1,3 +1,3 @@
1
1
  module WikiWah
2
- VERSION = "0.1.0".freeze
2
+ VERSION = "0.1.1".freeze
3
3
  end
@@ -174,6 +174,18 @@ P2
174
174
  more code
175
175
  </code></pre>
176
176
 
177
+ ==== # Code with language specified
178
+ ,-- fnordscript --
179
+ | code
180
+ |
181
+ | more code
182
+ ----
183
+ <pre>
184
+ <code lang="fnordscript">code
185
+
186
+ more code
187
+ </code></pre>
188
+
177
189
  ==== # Blockquote
178
190
  > block
179
191
  > quote
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wikiwah
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Mike Williams
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-05-07 00:00:00.000000000 Z
12
+ date: 2013-06-17 00:00:00.000000000 Z
12
13
  dependencies: []
13
14
  description: ! "WikiWah is a text-to-HTML converter, along the lines of Markdown.
14
15
  \ \n\nThis isn't the markup language you're looking for. \nIt offers no improvements
@@ -38,26 +39,33 @@ files:
38
39
  - Rakefile
39
40
  homepage: http://github.com/mdub/wikiwah
40
41
  licenses: []
41
- metadata: {}
42
42
  post_install_message:
43
43
  rdoc_options: []
44
44
  require_paths:
45
45
  - lib
46
46
  required_ruby_version: !ruby/object:Gem::Requirement
47
+ none: false
47
48
  requirements:
48
49
  - - ! '>='
49
50
  - !ruby/object:Gem::Version
50
51
  version: '0'
52
+ segments:
53
+ - 0
54
+ hash: 1183097445060914495
51
55
  required_rubygems_version: !ruby/object:Gem::Requirement
56
+ none: false
52
57
  requirements:
53
58
  - - ! '>='
54
59
  - !ruby/object:Gem::Version
55
60
  version: '0'
61
+ segments:
62
+ - 0
63
+ hash: 1183097445060914495
56
64
  requirements: []
57
65
  rubyforge_project:
58
- rubygems_version: 2.0.0
66
+ rubygems_version: 1.8.23
59
67
  signing_key:
60
- specification_version: 4
68
+ specification_version: 3
61
69
  summary: WikiWah turns text into HTML
62
70
  test_files:
63
71
  - test/wikiwah/flow_tests.rb
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MWM1ZGQ5ZjhjZThhY2EzNWE0NWJmZWI5Zjg1ZTU5ZTYyYmFhMzY0Yg==
5
- data.tar.gz: !binary |-
6
- NTliYTFkMGFkOTg3NjMzZjc2MWQ0Y2UzNzM0ZjY5YTFiMzU2YWVmMg==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- NDA0MjFjNmNiODFkMjA0MTgzMzJhMWVjZmViZDE0YzRhMWI1YjM2NjM0YjBj
10
- N2FlNDljZTUwZjc2NTE1NGUzZDFiOGE1ODkwYzUwYTljNjE3M2U4MGRhM2Y3
11
- MzU3NDA2ZjI5Zjg2NWQyNTE2MWIyZTY2N2Y1MzA4NjVmMzlkODg=
12
- data.tar.gz: !binary |-
13
- OGVlYzY0OTYzNDAyNWRhNjk5ODI4MzIxZWNkY2I0Zjc3MGE4ODBjODEwZjdl
14
- ZjJkYTg1NmVjNmVlNjM3OTJmOGI5OGM1MDEzNWQ3MzRjZWExODgwNzhlMmU2
15
- NTAxOTEzZGUzMjc2NDczYWIyNDM5ZmZkMmQ5NDNjZDk4MWIwOWQ=