You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nunj...@googlegroups.com
What the easiest way to "compress" your html (aka remove unneeded whitespace) in nunjucks? Many template solutions simply make this an available setting.
Christian
Alberto Gimeno Brieba
unread,
Mar 25, 2014, 2:31:50 PM3/25/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nunj...@googlegroups.com
As far as I know this is not possible. Nunjucks is a general purpose templating engine. You can generate HTML or anything else. Well, there is the autoescaping feature, but I think that's all.
You could parse the output and then post-process it with other library. Nevertheless it could be potentially dangerous to just remove whitespaces. For example for a "script" tag you could broke the code.
Additionally some CSS properties are sensitive to whitespaces such as "display: inline-block"
> --
> You received this message because you are subscribed to the Google Groups
> "Nunjucks" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nunjucks+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Christian Gloddy
unread,
Mar 25, 2014, 3:40:55 PM3/25/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nunj...@googlegroups.com
It certainly can have downsides if done inappropriately, but it's another step in getting the page to render as quickly as possible. Google's own recommendations even suggest doing so.