Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly support of non-ascii strings by filters #4

Open
wants to merge 63 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
39e7810
pass a hash as context when parsing
did Aug 19, 2010
6150705
implementation of template inheritance + tests
did Aug 19, 2010
92aad46
clean code
did Aug 19, 2010
a41213c
change find_blocks method visibility + fix bug
did Aug 19, 2010
ba44b85
keep current block in context during parsing
did Aug 24, 2010
dbcc0b1
a bit of refactoring
did Aug 24, 2010
0c1cf77
a bit of refactoring
did Aug 24, 2010
9e35d06
add the name method in block drops
did Aug 25, 2010
f299f8b
context used in the parsing time was not the same instance all the ti…
did Aug 26, 2010
7ce591f
split the end_tag method for InheritedBlock
did Aug 27, 2010
9ec5709
new algorithm for the inheritance module. This one is much more simpl…
did Aug 30, 2010
b03cdc2
current block pushed in a stack during parsing
did Aug 31, 2010
7a06126
Repackage liquid gem for locomotive
Sep 28, 2010
8c2132d
reorganizing gemspec
Sep 28, 2010
3691796
Cleanup Readme and gemspec
Sep 28, 2010
a9345c4
RSpec environment setup
Sep 28, 2010
49e718e
Converting Block, Assign, and Capture to specs
Sep 28, 2010
9ecb9ff
Converting Condition Test
Sep 28, 2010
f0d0cc8
Converting Context Spec
Sep 28, 2010
876972d
Refactoring specs
Sep 28, 2010
ac1a7bd
Converting drop test
Sep 29, 2010
1fdfc2f
Convert error handling spec
Sep 29, 2010
f3be5a6
Convert template inheritance spec
Sep 29, 2010
bb978e0
spec cleanup and reorg
Sep 29, 2010
67062a4
converting filesystem test
Sep 29, 2010
232645a
Converting filter test
Sep 29, 2010
98eacaf
Reorganizing fixtures
Sep 29, 2010
9ddce08
Converting additional tests to specs
Sep 29, 2010
01a1bfc
include tag spec, and cleanup
Sep 29, 2010
57149f9
Converting some additional output specs
Sep 29, 2010
4e40056
reorganize specs
Sep 29, 2010
d0c109c
Remove money_filter
Sep 29, 2010
508d542
Additional spec refactoring
Sep 29, 2010
ec77241
cleaning out template etsts
Sep 29, 2010
31727bc
Converting filter specs
Sep 29, 2010
bcbc997
reorganize filter spec
Sep 29, 2010
f3affdb
Rspec
Sep 29, 2010
6f20154
Adding output and tag specs
Sep 29, 2010
5276a7b
Refactor tag specs
Sep 30, 2010
893a5f9
Adding RSpec to Rakefile
Sep 30, 2010
448ba2f
cleaning test folder
Sep 30, 2010
cd5e7b7
Additional specs and cleanup
Oct 1, 2010
78d5dad
cleanup whitespace
Oct 1, 2010
093fe3e
Adding strainger spec
Oct 1, 2010
ff43af8
Strainer
Oct 1, 2010
3dada41
Fix up filters for Ruby 1.9.2
Oct 1, 2010
bbab7be
Fix context for Ruby 1.9.2
Oct 1, 2010
fd63553
Additional fixes from master
Oct 1, 2010
89985bc
Adding Literal support + Specs
Oct 1, 2010
8b7b27d
Updating history and readme
Oct 1, 2010
1b27b1a
fixing gemspec
Oct 1, 2010
cd7d7e1
Adding release rake task
Oct 1, 2010
eaee027
Reorgnaize specs a bit
Oct 1, 2010
b107cd2
Add pending default content tag / spec
Oct 1, 2010
5e51d05
raw tag
Jul 26, 2012
fc155be
fix broken tests with ruby 1.9.x + upgrade libs
Jul 26, 2012
566fca9
allow assign with filters
rpmessner Sep 29, 2012
3a637bd
Merge pull request #2 from Liquidthread/master
did Nov 20, 2012
69e3c07
merging
did Nov 20, 2012
f8e6ee7
fixed broken tests
did Nov 20, 2012
a84b052
releasing version 2.4.1
did Nov 20, 2012
bc3c0ba
move some methods from LocomotiveCMS to Liquid
did Dec 16, 2012
55d3974
Properly support of non-ascii strings for downcase, upcase, capitaliz…
dimonzozo Apr 9, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add pending default content tag / spec
  • Loading branch information
Jacques Crocker committed Oct 1, 2010
commit b107cd2ced8426ace2b4eb7a06bdfbb10cdcf1a8
21 changes: 21 additions & 0 deletions lib/liquid/tags/default_content.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module Liquid

# InheritedContent pulls out the content from child templates that isnt defined in blocks
#
# {% defaultcontent %}
#
class DefaultContent < Tag
def initialize(tag_name, markup, tokens, context)
super
end

def render(context)
context.stack do
"HELLO"
end
end
end


Template.register_tag('defaultcontent', DefaultContent)
end
26 changes: 19 additions & 7 deletions spec/integration/extends_spec.rb
Original file line number Diff line number Diff line change
@@ -49,12 +49,6 @@ def read_template_file(template_path)
END
end

# TODO
# it "should allow extending, with additional content" do
# template = Liquid::Template.parse "{% extends parent-template %} Huzzah!"
# template.render.should == "Hurrah! Huzzah!"
# end

it "should allow access to the context from the inherited template" do
@templates['parent-with-variable'] = "Hello, {{ name }}!"

@@ -70,7 +64,25 @@ def read_template_file(template_path)
output.should == "Hello, Joe!!"
end

context "inherited blocks" do
describe "{% defaultcontent %}" do
it "should allow me to render in all the nonblock wrapped content from a parent layout" do
pending "how do i get the content?"

@templates['parent-template'] = multiline_string(<<-END)
| OUTSIDE {% defaultcontent %}
END

# with content
template = Liquid::Template.parse "{% extends parent-template %} [INSIDE]"
template.render.should == "OUTSIDE [INSIDE]"

# without content
template = Liquid::Template.parse "{% extends parent-template %}"
template.render.should == "OUTSIDE "
end
end

describe "inherited blocks" do
before(:each) do
@templates['base'] = "Output / {% block content %}Hello, World!{% endblock %}"
end