GithubHelp home page GithubHelp logo

Comments (5)

featdd avatar featdd commented on August 21, 2024

fixed in 69a54d8

from dpn_glossary.

ducrot avatar ducrot commented on August 21, 2024

The fix is not solving the problem. Please have a look at the following images.

First image shows the regex process before the fix. As you can see,
<!--[if lt IE 9]><script ...></script><![endif]-->
is replaces by
<!--[if lt IE 9]><!--DPNGLOSSARY<script ...></script>--><![endif]-->
which ends in invalid html.
old-version

After the fix, the regex is too greedy. Everything from
<script ...></script><![endif]-->
to

<script type="text/javascript">
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-xxxxxxx-1']);
    _gaq.push(['_gat._anonymizeIp']);
    _gaq.push(['_trackPageview']);
    (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();
</script>

is matching.

The result is also invalid html:

<!--[if lt IE 9]><!--DPNGLOSSARY<script src="/typo3conf/ext/myextension/Resources/Public/js/html5.js?1394455858" type="text/javascript"></script><![endif]-->
</head>
<body>

<p> SOME TEXT</p>

<script type="text/javascript">
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-xxxxxxx-1']);
    _gaq.push(['_gat._anonymizeIp']);
    _gaq.push(['_trackPageview']);
    (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();
</script>-->

fixed-version

I really would like to help you with the regex, but I'm not a pro in that. I can only debug ;-)

from dpn_glossary.

featdd avatar featdd commented on August 21, 2024

wtf... I'm sorry will take a look at this :-(

worked on my test site

from dpn_glossary.

featdd avatar featdd commented on August 21, 2024

hopefully I think this is a satisfying soloution 3ddb0f0

from dpn_glossary.

ducrot avatar ducrot commented on August 21, 2024

THX, it works!

from dpn_glossary.

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.