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

Nesting Jade/Pug with functions or precompiled mixins #2187

Closed
SargoDarya opened this issue Dec 15, 2015 · 1 comment
Closed

Nesting Jade/Pug with functions or precompiled mixins #2187

SargoDarya opened this issue Dec 15, 2015 · 1 comment

Comments

@SargoDarya
Copy link

Here's what I'm trying to achieve:

Pseudo locals

locals.link_to = function() {
  return '<a href="#">|</a>';
}

Jade

- link_to()
  strong Foo
  | Bar

What I'd like to output in that case:

<a href="#">
  <strong>Foo</strong>
  Bar
</a>

What currently gets outputted:

<strong>Foo</strong>
Bar

So my solution I guess would be to have some kind of precompiled mixin. Is something like that possible already?

@TimothyGu
Copy link
Member

Unfortunately there is no support for a feature like this. #1950 is a more generic ticket that includes documenting the internals of how mixin functions work, including how external blocks are handled. I imagine that when #1950 is fixed this ticket should be fixed as well. Stay tuned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants