Code Monkey home page Code Monkey logo

Comments (3)

Mai-Saad avatar Mai-Saad commented on August 27, 2024 1

Can reproduce the issue here for elements below/above the fold when having 3 or more nested elements https://newer.rocketlabsqa.ovh/lrc_similive/
Here

    <header> header in body totally atf
        <div class="container"> div in header in body <div> div in div in header in body
            <h1>Powerful Electrical LLC</h1> </div>
            <nav>
                <ul>
                    <li><a href="#about1">About Us</a></li>
                    <li><a href="#services1">Services</a></li>
                    <li><a href="#contact1">Contact</a></li>
                </ul>
            </nav>
        </div>
        end header in body
    </header>
    <div> div in body <div> another div in body <header> header in div in div in body<div>another div in header in div in div in body</div></header></div></div>

and here <div> div in body<section>section in div<footer>footer in section in div</footer></section></div>

from wp-rocket.

Khadreal avatar Khadreal commented on August 27, 2024

Reproduce the issue ✅

Yes

Identify the root cause ✅

$result = preg_replace( '/data-rocket-location-hash="(?:.*)"/i', '', $html );

The pattern here doesn't handle values on a same line well which is why it break some nested elements, rightly changing to this /data-rocket-location-hash="[^"]*"/i as suggested by @DahmaniAdame fix the problem.

Scope a solution ✅

Change regex pattern to /data-rocket-location-hash="[^"]*"/i and add test

Estimate the effort ✅

[S]

from wp-rocket.

jeawhanlee avatar jeawhanlee commented on August 27, 2024

LGTM

from wp-rocket.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.