Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OHR Support
Manage
Activity
Members
Labels
Plan
Issues
97
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
OHR Support
Commits
f6805303
Commit
f6805303
authored
13 years ago
by
Holger Just
Browse files
Options
Downloads
Patches
Plain Diff
[#604] Remove the leading newline from Liquid blocks for easier formatting
parent
994132a5
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/chili_project/liquid/liquid_ext.rb
+1
-0
1 addition, 0 deletions
lib/chili_project/liquid/liquid_ext.rb
lib/chili_project/liquid/liquid_ext/block.rb
+22
-0
22 additions, 0 deletions
lib/chili_project/liquid/liquid_ext/block.rb
with
23 additions
and
0 deletions
lib/chili_project/liquid/liquid_ext.rb
+
1
−
0
View file @
f6805303
module
ChiliProject
module
Liquid
module
LiquidExt
::
Liquid
::
Block
.
send
(
:include
,
Block
)
::
Liquid
::
Context
.
send
(
:include
,
Context
)
end
end
...
...
This diff is collapsed.
Click to expand it.
lib/chili_project/liquid/liquid_ext/block.rb
0 → 100644
+
22
−
0
View file @
f6805303
module
ChiliProject
module
Liquid
module
LiquidExt
module
Block
def
self
.
included
(
base
)
base
.
send
(
:include
,
InstanceMethods
)
base
.
class_eval
do
alias_method_chain
:render_all
,
:cleaned_whitespace
end
end
module
InstanceMethods
def
render_all_with_cleaned_whitespace
(
list
,
context
)
# Remove the leading newline in a block's content
list
[
0
].
sub!
(
/\A\r?\n/
,
""
)
if
list
[
0
].
is_a?
(
String
)
render_all_without_cleaned_whitespace
(
list
,
context
)
end
end
end
end
end
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment