static-site-scaffold-modules icon indicating copy to clipboard operation
static-site-scaffold-modules copied to clipboard

[eleventy-plugin-local-respimg] Clears everything except for body content

Open stevygee opened this issue 4 years ago • 5 comments

Version: 0.3.1

In some cases, the body tag isn't being recognized properly. This results in an output file where everything outside the body content is incorrectly removed. This happens if the body tag contains an url, for example: <body itemscope="" itemtype="http://schema.org/WebPage">

stevygee avatar Jun 21 '20 21:06 stevygee

I'm pretty sure this regex pattern is to blame: https://github.com/chromeos/static-site-scaffold-modules/blob/0738afc777e786371bc0606063c30c9aaf42399e/modules/eleventy-plugin-local-respimg/lib/respimg.js#L180

stevygee avatar Jun 21 '20 21:06 stevygee

TY I'll take a look.

Snugug avatar Jun 22 '20 14:06 Snugug

Sorry for the delay on this! Was launching http://chromeos.dev/ which ate my time on this. Back on this, now, though.

Snugug avatar Aug 14 '20 18:08 Snugug

Can confirm this bug. When using Tailwind CSS Variants in the body tag, eg: <body class="p-4 md:p-8">, things before and after the body disappear.

huphtur avatar Sep 29 '20 17:09 huphtur

Confirm the same. If the <body> tag has more than one attribute, say <body class="container" style="display:none">, it breaks. Temperory solution is to move the body styling and attributes to a child like that of below

<body>
  <div {move your body attributes like class, style, data-* here}>
  ...
  </div>
</body>

anselm94 avatar Apr 13 '21 08:04 anselm94