Questions tagged [posthtml]

PostHTML is a tool for transforming HTML/XML with JS plugins. PostHTML itself is very small. It includes only a HTML parser, a HTML node tree API and a node tree stringifier.

All HTML transformations are made by plugins. And these plugins are just small plain JS functions, which receive a HTML node tree, transform it, and return a modified tree.

For more detailed information about PostHTML in general take a look at the docs.

9 questions
5
votes
3 answers

Parse an HTML template as you require it in JavaScript

I spent hours on a basic webpack configuration but I'm still not able to make it work. My aim is to perform the parsing of a html template as you import it in a JavaScript file. It looks like a common use-case, but there should be something odd in…
4
votes
1 answer

Parceljs / PostHTML - keeping .htm files from being renamed to .html

When building through parcel .htm files, the output is .html files. I much rather just keep the .htm files as output files, but couldn't figure out a way to do it in either Parcel or PostHTML which is being used by parcel. I've updated an old static…
Shuky Capon
  • 785
  • 5
  • 22
1
vote
1 answer

inserting ignored php code within Maizzle components

I am working on a project using the Maizzle html-email framework that needs to have some php code embedded (but ignored) within the final production build file so that it can get later executed at runtime. Essentially I just want Maizzle to ignore…
markm
  • 48
  • 1
  • 4
1
vote
2 answers

How can I use posthtml with Webpack and multiple HTML files?

I'm trying to use Webpack to simulate Parcel's behavior in a multi-page application (I would use Parcel, but Parcel 1 won't work on Node 15 and Parcel 2 is still a beta with too many bugs to be usable at present.), and part of that is that I need to…
john01dav
  • 1,842
  • 1
  • 21
  • 40
1
vote
0 answers

Sort attributes (HTML/Vue) on VSCode breaking self-close tags

I am currently using Sorting HTML and Jade attributes extension on VS Code to auto-sort my Vue attributes. I set it up so that it will be executed when saving. My problem: When executing, my self-closed Vue components are changed. ex. Let's say this…
kzaiwo
  • 1,558
  • 1
  • 16
  • 45
1
vote
1 answer

How to automatically repeat HTML content in nunjucks?

This PostHTML plugin "PostHTML Each" can repeat HTML code in a simple way. Like this
How to repeat in a…
Jitendra Vyas
  • 148,487
  • 229
  • 573
  • 852
0
votes
0 answers

How to make Parcel build without JavaScript

We have a small static site based on Tailwind, PostCSS and PostHTML that doesn't contain any JS/TS code or