Comments (2)
I was about to file a bug when I found this issue. It's reversing the order of the escaped items.
test code
use liquid::{Renderable, Context, Value};
let template = liquid::parse(
r"{% raw %}
{{ abc }}
{{ def }}
{{ ghi }}
{% endraw %}", Default::default()).unwrap();
let mut context = Context::new();
context.set_val("num", Value::Num(4f32));
let output = template.render(&mut context);
assert_eq!(output.unwrap(), Some("\n{{ abc }}\n{{ def }}\n{{ ghi }}\n".to_string()));
I'm going to have a go a see if I can fix it!
from liquid-rust.
I'm getting a bit confused, I thought this was a fault with the raw
block, but my latest findings would indicate otherwise.
I jumped straight into the raw
block code and added a new test that should fail.
#[test]
fn test_raw_ordered() {
use std::default::Default;
let options: LiquidOptions = Default::default();
let raw = raw_block("raw",
&[],
&vec![Expression(vec![], "{{abc}}\n{{def}}\n{{ghi}}".to_owned())],
&options);
assert_eq!(raw.unwrap().render(&mut Default::default()).unwrap(),
Some("{{abc}}\n{{def}}\n{{ghi}}".to_owned()));
}
It didn't fail, it passed!
Yet my test code still fails. I've cleaned up the code from last update.
fn main() {
use liquid::Renderable;
let template = liquid::parse(r"{% raw %}
{{ abc }}
{{ def }}
{{ ghi }}
{% endraw %}", Default::default()).unwrap();
let output = template.render(&mut Default::default());
assert_eq!(output.unwrap(),
Some("\n{{ abc }}\n{{ def }}\n{{ ghi }}\n".to_string()));
}
Wondering I should look next? I'm thinking the parser or render calls?
from liquid-rust.
Related Issues (20)
- How to use the "Template" class. HOT 33
- Allow accessing renderer state/runtime before rendering HOT 6
- with_time unimplemented HOT 3
- Change `master` branch to `main` HOT 3
- could not compile kstring HOT 1
- Render Tag HOT 3
- EmptyDrop and Object indexing HOT 7
- Make struct InnerError public HOT 1
- Open to the idea of supporting less strict parsing/rendering as an option? HOT 3
- Can't render dates with millisecond precision HOT 1
- No way to return a reference for the values method of trait ObjectView
- Dependency Dashboard
- Question: supporting object literals with unknown keys on custom filters HOT 8
- Thoughts on implementing `From<serde_json::Value> for liquid_core::Value`? HOT 2
- How do you use `{% include x.liquid %}`? HOT 5
- Liquid Tag and Echo Tag
- How would you go about implementing a Drop HOT 3
- Add support for u64 numbers?
- Inline comments are not supported HOT 1
- Hash access to globals produces parse error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liquid-rust.