Closed lensco closed 1 year ago
Yes, you should follow this method: https://github.com/phug-php/phug/issues/79#issuecomment-1679565659
This can also likely be achieved by creating a custom component for that.
But as explained in the other issue, this project is a port of Pug-js and aims behave consistently.
Yeah, sorry for asking the same question two years later – forgot about that. I tried the component way, and I can't get it to work without repeating the whole code block/slot twice. Too bad I can’t just echo the original, unparsed block…
I'm working on a component library which has many examples, showing both the result and markup, written in pug. In order to avoid writing the same code twice, I made a mixin:
… but of course this outputs the literal text "block" in the
code
tag. If I leave off the dot I just get the actual parsed results. So is there an easy way to output the contents of a block without parsing?