kramdown 2.0.0.beta1 → 2.0.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of kramdown might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/kramdown/parser/kramdown.rb +5 -5
- data/lib/kramdown/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f737523fd370cb69aff3ae9bb1c7fbad526081be7d3df2275de8fb9563d9c4c2
|
4
|
+
data.tar.gz: 81ca8a7bb1aa6feecbad1cbe0cba3eeebb26751ff9b1e33692f0f0f663f76a3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e5cd66bdc510a27fa640fe0ed18d598c3f4acda9dcd8fe54b931f00ea08011e16772881f6e3b3a17338412cd03ea6af57e8687102601cdde24c6da195fa67f4
|
7
|
+
data.tar.gz: 06202fba99c3a55af853235d3c1d355856b085d30cc5d4d29bfbde3587a01c258663a4b47b12ce60e649ceeb2b1e72cca66c1d434ae662bfdd07221ba75d8d73
|
@@ -302,7 +302,7 @@ module Kramdown
|
|
302
302
|
el
|
303
303
|
end
|
304
304
|
|
305
|
-
|
305
|
+
@@parsers = {}
|
306
306
|
|
307
307
|
# Struct class holding all the needed data for one block/span-level parser method.
|
308
308
|
Data = Struct.new(:name, :start_re, :span_start, :method)
|
@@ -317,18 +317,18 @@ module Kramdown
|
|
317
317
|
# to the registry. The method name is automatically derived from the +name+ or can explicitly
|
318
318
|
# be set by using the +meth_name+ parameter.
|
319
319
|
def self.define_parser(name, start_re, span_start = nil, meth_name = "parse_#{name}")
|
320
|
-
raise "A parser with the name #{name} already exists!" if
|
321
|
-
|
320
|
+
raise "A parser with the name #{name} already exists!" if @@parsers.key?(name)
|
321
|
+
@@parsers[name] = Data.new(name, start_re, span_start, meth_name)
|
322
322
|
end
|
323
323
|
|
324
324
|
# Return the Data structure for the parser +name+.
|
325
325
|
def self.parser(name = nil)
|
326
|
-
|
326
|
+
@@parsers[name]
|
327
327
|
end
|
328
328
|
|
329
329
|
# Return +true+ if there is a parser called +name+.
|
330
330
|
def self.has_parser?(name)
|
331
|
-
|
331
|
+
@@parsers.key?(name)
|
332
332
|
end
|
333
333
|
|
334
334
|
# Regexp for matching indentation (one tab or four spaces)
|
data/lib/kramdown/version.rb
CHANGED