Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
stevygee opened this issue Jun 21, 2020 · 5 comments
Labels

Comments

@stevygee
Copy link

stevygee commented Jun 21, 2020

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
Copy link
Author

I'm pretty sure this regex pattern is to blame:

const hasBody = /<\s*body(\w|\s|=|"|-)*>/gm;

@Snugug
Copy link
Collaborator

Snugug commented Jun 22, 2020

TY I'll take a look.

@Snugug Snugug added bug problem: bug good first issue Good for newcomers and removed bug labels Jun 22, 2020
@Snugug
Copy link
Collaborator

Snugug commented Aug 14, 2020

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

@huphtur
Copy link

huphtur commented Sep 29, 2020

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.

@anselm94
Copy link

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants