Giter VIP home page Giter VIP logo

Comments (18)

aredridel avatar aredridel commented on July 27, 2024

In the layout template, does adding |s to the dynamic parameter help?

from makara.

pvenkatakrishnan avatar pvenkatakrishnan commented on July 27, 2024

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.

hoaboat avatar hoaboat commented on July 27, 2024

I believe we tried what you suggested @aredridel before we submitted the issue.

from makara.

aredridel avatar aredridel commented on July 27, 2024

Ah, interesting.

from makara.

pvenkatakrishnan avatar pvenkatakrishnan commented on July 27, 2024

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.

pvenkatakrishnan avatar pvenkatakrishnan commented on July 27, 2024

rootcausing the html escapes in the path is vital to the solution of this issue.

from makara.

aredridel avatar aredridel commented on July 27, 2024

Did you find any of the root cause of this?

from makara.

pvenkatakrishnan avatar pvenkatakrishnan commented on July 27, 2024

nope not yet... :(

from makara.

aredridel avatar aredridel commented on July 27, 2024

No fun! Want me to take a peek on Monday?

from makara.

pvenkatakrishnan avatar pvenkatakrishnan commented on July 27, 2024

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.

aredridel avatar aredridel commented on July 27, 2024

Could it be a security module overriding the dust filters?

from makara.

pvenkatakrishnan avatar pvenkatakrishnan commented on July 27, 2024

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.

aredridel avatar aredridel commented on July 27, 2024

It's one of our private ones. Like Sanjeev mentioned in the DL today.

from makara.

pvenkatakrishnan avatar pvenkatakrishnan commented on July 27, 2024

oh yeah i tried including that as well in my standalone project... it still worked fine with that...

from makara.

aredridel avatar aredridel commented on July 27, 2024

Well nuts!

from makara.

aredridel avatar aredridel commented on July 27, 2024

I'll definitely take a look on Monday

from makara.

pvenkatakrishnan avatar pvenkatakrishnan commented on July 27, 2024

yes for sure... yeah i spoke to @hoaboat we have time till tuesday EOD...

from makara.

pvenkatakrishnan avatar pvenkatakrishnan commented on July 27, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.