Search code examples
htmlpugmixins

Interpolation parameter in Pug


I'm using pug mixins.

mixin p(content)
  div.text
    p= content

+p("Hello, #[strong world]")

But tag interpolation #[strong ...] don't work.

Please, tell me how to solve this problem.


Solution

  • Need to use !{variable}

    mixin p(content)
      div.text
        p !{content}
    

    and native tags

    +p("Hello, <strong>world</strong>")