So the test was wrong :-)
This commit is contained in:
parent
de4e072c97
commit
6069d9f049
@ -36,7 +36,17 @@ describe "Shortcodes" do
|
||||
input[result.errors[0].position, 3].should eq ">}}"
|
||||
end
|
||||
|
||||
it "foo should accept mismatched brackets in qvals" do
|
||||
it "should accept mismatched brackets inside data are ok" do
|
||||
input = "foobar {{% sc %}} >}}blah {{% /sc %}} "
|
||||
result = parse(input)
|
||||
result.shortcodes.size.should eq 1
|
||||
result.errors.size.should eq 0
|
||||
result.shortcodes[0].whole.should eq "{{% sc %}} >}}blah {{% /sc %}}"
|
||||
result.shortcodes[0].data.should eq " >}}blah "
|
||||
result.shortcodes[0].args.size.should eq 0
|
||||
end
|
||||
|
||||
it "should accept mismatched brackets in qvals" do
|
||||
input = "foobar {{% sc \">}}blah\" %}} {{% /sc %}}"
|
||||
result = parse(input)
|
||||
result.shortcodes.size.should eq 1
|
||||
@ -46,18 +56,6 @@ describe "Shortcodes" do
|
||||
result.shortcodes[0].args[0].@value.should eq ">}}blah"
|
||||
end
|
||||
|
||||
it "foo should accept mismatched brackets inside data are ok" do
|
||||
input = "foobar {{% sc %}} >}}blah {{% /sc %}} "
|
||||
result = parse(input)
|
||||
result.shortcodes.size.should eq 1
|
||||
result.errors.size.should eq 0
|
||||
result.shortcodes[0].whole.should eq "{{% sc %}} >}}blah {{% /sc %}}"
|
||||
result.shortcodes[0].data.should eq " >}}blah "
|
||||
result.shortcodes[0].args.size.should eq 1
|
||||
result.shortcodes[0].args[0].@value.should eq ">}}blah"
|
||||
end
|
||||
|
||||
|
||||
it "should consider spaces in shortcodes optional" do
|
||||
input = "foobar {{% shortcode%}}blah"
|
||||
result = parse(input)
|
||||
|
264
src/shortcodes.c
264
src/shortcodes.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user