Comments (18)
In the layout template, does adding |s
to the dynamic parameter help?
from makara.
so after talking to hoa, i have a better understanding of what the problem. The path to the layout is constructed in the controllers and dynamically included in the view. The dust helpers that have been included in the project, causes everything that is dynamically rendered to be html escaped. Unfortunately for this specific case (since it is a path) escaping should not happen. @aredridel |s
might help, infact i was suggesting the same to @hoaboat . I am planning on quickly doing a sample and linking it here.
from makara.
I believe we tried what you suggested @aredridel before we submitted the issue.
from makara.
Ah, interesting.
from makara.
interestingly i installed all the helpers your project uses and still the dust path i pass back from my controllers dont get escaped. It works as is... There is something else funky going on .
from makara.
rootcausing the html escapes in the path is vital to the solution of this issue.
from makara.
Did you find any of the root cause of this?
from makara.
nope not yet... :(
from makara.
No fun! Want me to take a peek on Monday?
from makara.
sure .. this is what i found so far...
The project has a layout dust set using adaro. In adaro, when there is a layout res.render(viewName, model)
gets converted to rendering the layout file and the viewName
becomes a partial in the layout
if referenced as {> {_main} /}
. When the layout file gets rendered in this case, for the issue to happen, the partial has to be in a subdirectory eg: foo/bar/baz.dust
So when dust.render('layout' ...
happens, and dust.onLoad
on the partials is called, the viewName partial has the /
escaped when dust calls onLoad... Note that this happens only when layout is set using adaro... I tried a standalone project where I just pass a view path like data = { _main: foo/bar/baz}
in the model while doing res.render('someView', data)
and reference it as a partial in a view by doing {> {_main} /}
, it is able to parse the partial name just fine (which is very bewildering). Initially i thought it is due to dust version difference. But that is not the case either....I bumped the dust and helper versions on the project that has the problem and still see the problem.
Huh.. and thats where i am now.
from makara.
Could it be a security module overriding the dust filters?
from makara.
hmmm... which security module ?
Also i made sure that the name that gets passed down all the way to dust is preserved and looks right.. i also dumped the value returned by <div> {_main} </div>
, the value is not escaped... it looks right...
from makara.
It's one of our private ones. Like Sanjeev mentioned in the DL today.
from makara.
oh yeah i tried including that as well in my standalone project... it still worked fine with that...
from makara.
Well nuts!
from makara.
I'll definitely take a look on Monday
from makara.
yes for sure... yeah i spoke to @hoaboat we have time till tuesday EOD...
from makara.
@hoaboat this is a paypal specific helper module triggered issue.. I will email you the mock project with the solution... basically {> "{_main|s}" /}
should be a sufficient fix. Check email for details.
Closing this issue out.
from makara.
Related Issues (20)
- multi
- Plan for makara deprecation HOT 6
- Add support for formatPath in Bundalo.
- dust helpers documentation is wrong HOT 1
- Express app stops responding if there are too many partial includes HOT 6
- specialization seems to be broken HOT 24
- Makara doesn't look up localised templates HOT 3
- Problem with format path HOT 3
- Makara 2 and Dust @provide helper HOT 3
- Makara 2 with locale from cookie is not localizing templates HOT 1
- Upgrading makara: client side HOT 9
- Locale specific templates HOT 4
- Build task on windows fails due to OS path separator issue HOT 4
- is there a concept of fallback at the level of the Country HOT 3
- Question: what are the various ways to manually set the expressjs-res's locale HOT 4
- I can't pass the enableMetadata parameter HOT 2
- Don't load req.locale HOT 1
- Update the bundalo to 1.x to remove dependency from dustjs-linkedin HOT 1
- is makara only for dustjs template engine?
- Update bundalo for security issue
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 makara.