Skip to content

Commit

Permalink
Remove <!doctype> from markup before rendering with postscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
dgirardi committed Aug 16, 2022
1 parent 2590307 commit 52b0f4f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export function writeAdUrl(adUrl, width, height) {
}

export function writeAdHtml(markup) {
// remove <?xml> and <!doctype> tags
// https://github.com/prebid/prebid-universal-creative/issues/134
markup = markup.replace(/\<(\?xml|(\!DOCTYPE[^\>\[]+(\[[^\]]+)?))+[^>]+\>/g, '');
postscribe(document.body, markup, {
error: console.error
});
Expand Down

0 comments on commit 52b0f4f

Please sign in to comment.