diff --git a/packages/next/pages/_document.js b/packages/next/pages/_document.js index 5a5482ba899ce..4e84f6365553d 100644 --- a/packages/next/pages/_document.js +++ b/packages/next/pages/_document.js @@ -186,6 +186,12 @@ export class Head extends Component { badProp = 'name="viewport"' } else if (type === 'link' && props.rel === 'canonical') { badProp = 'rel="canonical"' + } else if (type === 'script') { + badProp = ' { + badProp += ` ${prop}="${props[prop]}"` + }) + badProp += '/>' } if (badProp) { diff --git a/test/integration/amphtml/pages/custom-scripts.js b/test/integration/amphtml/pages/custom-scripts.js new file mode 100644 index 0000000000000..a2769d1e977f3 --- /dev/null +++ b/test/integration/amphtml/pages/custom-scripts.js @@ -0,0 +1,13 @@ +import Head from 'next/head' + +export default () => ( +
+ +