Skip to content
This repository was 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
ayxos wants to merge 2 commits into
krux:masterfrom
smaato:hotfix
Open

Comments function has been refactored to use substring instead of substr#307
ayxos wants to merge 2 commits into
krux:masterfrom
smaato:hotfix

Conversation

@ayxos

@ayxos ayxos commented Jan 26, 2018

Copy link
Copy Markdown
Contributor

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