Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Comments function has been refactored to use substring instead of substr #307

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ayxos
Copy link
Contributor

@ayxos ayxos commented Jan 26, 2018

Some customers have the following creatives:

function markup() {/*
    <_test!doctype html>
    <_testhtml>
      <_testhead></_testhead>
      <_testbody style="margin:0px">
        <_testh1> This is a Test </_testh1>
        <_testdiv class="test_creative" style="width:320px;height:50px;">
            <_testscript type='text/javascript'>
                console.log('TEST')
            </_testscript>
        </_testdiv>
        </_testbody>
    </_testhtml>
*/}
function parsingFn(func) {
    return func.toString().replace(/(<|\*)(\/)?_test/g,"$1$2").split(/\n/).slice(1, -1).join('\n');
}
document.write(parsingFn(markup));
document.close();

Which is not working with the current version of Postscribe. The PR fixes the problem

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

Successfully merging this pull request may close these issues.

1 participant