html を雑に AST にするやつを書いてる。parse5 だと 今回やろうとしてる使い方には厳密すぎる。 html ファイルを作るツールがほしいのん。
<img src="hoge" alt="""> を食わせたら、別ファイルにある画像の定義から picture 要素なり srcset なり作るようなのとか。
<heading2>fuga</heading2> 食わせたら <h2 class="heading2">fuga</h2> にしてくれるとか。
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!
<heading2>fuga</heading2> 食わせたら <h2 class="heading2">fuga</h2> にしてくれるとか。