eggshell 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/eggshell/block-handler.rb +6 -0
- data/lib/eggshell/bundles/basics.rb +7 -7
- data/lib/eggshell/format-handler.rb +1 -1
- data/lib/eggshell/processor.rb +7 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd2753240c406b052a69a3c8858a54de232db6d0
|
4
|
+
data.tar.gz: a9dc32169269a7098689daab365f566a514c8596
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26ea82772d6c94e1ac78040338f6bbad8e9f2afe5be53506deb0cdc8a7bc106dd76e73ccf2373840c3f811c407458135fe5eb7691c204790c1ed254172c014f0
|
7
|
+
data.tar.gz: 676b738ace9f4ccc2358034a13b55110a6a101bc86731c6f082f867b25c9fc592996f35b116aa56e2d0b81bfcd068e73402bdaff21c780832dbf1bf4a6e081c7
|
@@ -83,6 +83,12 @@ module Eggshell::BlockHandler
|
|
83
83
|
RETRY
|
84
84
|
end
|
85
85
|
end
|
86
|
+
|
87
|
+
# Useful for pipeline chains in the form `block-macro*-block`. This checks if
|
88
|
+
# the current block handler/type is equivalent to the block that's being pipelined.
|
89
|
+
def equal?(handler, type)
|
90
|
+
false
|
91
|
+
end
|
86
92
|
|
87
93
|
module Defaults
|
88
94
|
class NoOpHandler
|
@@ -269,7 +269,7 @@ module Eggshell::Bundles::Basic
|
|
269
269
|
if colgroup.length > 0
|
270
270
|
out[1].gsub!('%colgroup%', "<colgroup>\n\t#{colgroup.join("\n\t")}\n</colgroup>")
|
271
271
|
else
|
272
|
-
out[1].gsub(
|
272
|
+
out[1].gsub!('%colgroup%', '')
|
273
273
|
end
|
274
274
|
|
275
275
|
o_out << out.join("\n")
|
@@ -406,6 +406,10 @@ module Eggshell::Bundles::Basic
|
|
406
406
|
out << @eggshell.expand_all(order_stack.join("\n"))
|
407
407
|
end
|
408
408
|
end
|
409
|
+
|
410
|
+
def equal?(handler, type)
|
411
|
+
self.class == handler.class && (type == 'ol' || type == 'ul')
|
412
|
+
end
|
409
413
|
end
|
410
414
|
|
411
415
|
class SectionBlocks
|
@@ -588,7 +592,7 @@ module Eggshell::Bundles::Basic
|
|
588
592
|
link, alt = args
|
589
593
|
link = '' if !link
|
590
594
|
alt = '' if !alt
|
591
|
-
|
595
|
+
|
592
596
|
atts[akey]['src'] = link if link != ''
|
593
597
|
atts[akey]['alt'] = alt if alt != ''
|
594
598
|
tagname = 'img'
|
@@ -597,11 +601,7 @@ module Eggshell::Bundles::Basic
|
|
597
601
|
tagname = TAG_MAP[tag]
|
598
602
|
end
|
599
603
|
|
600
|
-
|
601
|
-
return "#{create_tag(tagname, atts)}#{text}</#{tagname}>"
|
602
|
-
else
|
603
|
-
return create_tag(tagname, atts, false)
|
604
|
-
end
|
604
|
+
return create_tag(tagname, atts, tagopen, text)
|
605
605
|
end
|
606
606
|
end
|
607
607
|
|
@@ -36,7 +36,7 @@ module Eggshell::FormatHandler
|
|
36
36
|
return [] if !arg_str || arg_str == ''
|
37
37
|
raw_args = arg_str.split(/(?<!\\)\|/)
|
38
38
|
args = []
|
39
|
-
args
|
39
|
+
args += raw_args.shift.split(/ ; /) if !no_direct
|
40
40
|
map = {}
|
41
41
|
raw_args.each do |rarg|
|
42
42
|
k, v = rarg.split('=', 2)
|
data/lib/eggshell/processor.rb
CHANGED
@@ -428,9 +428,11 @@ module Eggshell
|
|
428
428
|
if unit.is_a?(String)
|
429
429
|
out << unit
|
430
430
|
last_line += 1
|
431
|
+
last_type = nil
|
431
432
|
elsif unit.is_a?(Eggshell::Line)
|
432
433
|
out << unit.to_s
|
433
434
|
last_line = unit.line_nameum
|
435
|
+
last_type = nil
|
434
436
|
elsif unit.is_a?(Array)
|
435
437
|
handler = unit[0] == :block ? @blocks_map[unit[1]] : @macros[unit[1]]
|
436
438
|
name = unit[1]
|
@@ -457,8 +459,7 @@ module Eggshell
|
|
457
459
|
# two cases:
|
458
460
|
# 1. this block is immediately tied to block-macro chain and is continuation of same type of block
|
459
461
|
# 2. part of block-macro chain but not same type, or immediately follows another block
|
460
|
-
|
461
|
-
if last_type == :macro && (lines_end - last_line == 1) && _name == name
|
462
|
+
if last_type == :macro && (lines_start - last_line <= 1) && _handler.equal?(handler, name)
|
462
463
|
lines.each do |line|
|
463
464
|
_lines << line
|
464
465
|
end
|
@@ -507,6 +508,7 @@ module Eggshell
|
|
507
508
|
elsif unit
|
508
509
|
_warn "not sure how to handle #{unit.class}"
|
509
510
|
_debug unit.inspect
|
511
|
+
last_type = nil
|
510
512
|
end
|
511
513
|
end
|
512
514
|
|
@@ -577,7 +579,8 @@ module Eggshell
|
|
577
579
|
quote = nil if tok == quote
|
578
580
|
buff[-1] += tok
|
579
581
|
elsif tok == '"' || tok == "'"
|
580
|
-
|
582
|
+
# only open quote if there's whitespace or blank string preceeding it
|
583
|
+
quote = tok if opened[-1] && (!buff[-1] || buff[-1] == '' || buff[-1].match(/\s$/))
|
581
584
|
buff[-1] += tok
|
582
585
|
elsif @fmt_handlers[tok] && (!non_nesting[-1] || non_nesting.index(tok))
|
583
586
|
handler, closer, non_nest = @fmt_handlers[tok]
|
@@ -603,6 +606,7 @@ module Eggshell
|
|
603
606
|
bstr = buff.pop
|
604
607
|
buff[-1] += op + bstr
|
605
608
|
_warn "expand_formatting: unclosed #{op}, not doing anything: #{bstr}"
|
609
|
+
#_warn toks.inspect
|
606
610
|
end
|
607
611
|
|
608
612
|
buff.join('')
|