wparser 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +9 -0
- data/Manifest.txt +1 -0
- data/lib/wparser/inline/code.rb +13 -0
- data/lib/wparser/inline/inline.rb +2 -0
- data/lib/wparser.rb +1 -1
- metadata +5 -4
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'wparser/parse'
|
2
|
+
|
3
|
+
module Inlines
|
4
|
+
class Code < Parse
|
5
|
+
def self.parse line
|
6
|
+
@result = line.gsub!(/(?:(?!\\@)(^|.)@)(.+?)(?:(?!\\@)(.)@)/){|s|
|
7
|
+
"#$1<pre><code>#$2#$3</code></pre>"
|
8
|
+
}
|
9
|
+
@result = line.gsub!(/\\@/, '@')
|
10
|
+
super
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'wparser/inline/heading'
|
2
2
|
require 'wparser/inline/strong'
|
3
|
+
require 'wparser/inline/code'
|
3
4
|
require 'wparser/inline/italic'
|
4
5
|
require 'wparser/inline/underLine'
|
5
6
|
require 'wparser/inline/deleted'
|
@@ -29,6 +30,7 @@ module Inline
|
|
29
30
|
if @protected_preTag == nil
|
30
31
|
parse_line = Heading.parse parse_line
|
31
32
|
parse_line = Strong.parse parse_line
|
33
|
+
parse_line = Code.parse parse_line
|
32
34
|
parse_line = Italic.parse parse_line
|
33
35
|
parse_line = UnderLine.parse parse_line
|
34
36
|
parse_line = Deleted.parse parse_line
|
data/lib/wparser.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wparser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- iori
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-08-
|
18
|
+
date: 2010-08-24 00:00:00 +09:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -88,6 +88,7 @@ files:
|
|
88
88
|
- lib/wparser/inline/italic.rb
|
89
89
|
- lib/wparser/inline/paragraph.rb
|
90
90
|
- lib/wparser/inline/strong.rb
|
91
|
+
- lib/wparser/inline/code.rb
|
91
92
|
- lib/wparser/inline/underLine.rb
|
92
93
|
- lib/wparser/parser.rb
|
93
94
|
- script/console
|