diff --git a/index.js b/index.js index ecff88f..c8e5eca 100644 --- a/index.js +++ b/index.js @@ -13,6 +13,7 @@ const boilerplate = require('./lib/boilerplate') const serviceworker = require('./lib/serviceWorker') const link = require('./lib/link/canonical') const preload = require('./lib/link/preload') +const amphtml = require('./lib/link/amphtml') const toolbox = require('./lib/toolbox') const html = require('./lib/html') @@ -29,6 +30,7 @@ const html2amp = async (htmlString, options = {}) => { $ = iframe($, options) $ = link($) $ = preload($) + $ = amphtml($, options) $ = serviceworker($, options) $ = boilerplate($, options) htmlString = html($, options) diff --git a/lib/link/amphtml.js b/lib/link/amphtml.js new file mode 100644 index 0000000..90bbc29 --- /dev/null +++ b/lib/link/amphtml.js @@ -0,0 +1,6 @@ +const amphtml = ($) => { + $('link[rel="amphtml"]').remove() + return $ +} + +module.exports = amphtml diff --git a/test/index.test.js b/test/index.test.js index 543570c..4c27317 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -7,6 +7,7 @@ const html = ` test page + @@ -23,6 +24,7 @@ const expected = `