From 971b1f3e8d72a90ca5ec81f1175bc79b801f87d2 Mon Sep 17 00:00:00 2001 From: pimlie Date: Mon, 28 Jan 2019 11:55:12 +0100 Subject: [PATCH 1/2] fix: follow html specs with regards to end tags --- src/server/generators/tagGenerator.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/server/generators/tagGenerator.js b/src/server/generators/tagGenerator.js index 0cdd134c..c59fbf1a 100644 --- a/src/server/generators/tagGenerator.js +++ b/src/server/generators/tagGenerator.js @@ -37,17 +37,20 @@ export default function _tagGenerator (options = {}) { // grab child content from one of these attributes, if possible const content = tag.innerHTML || tag.cssText || '' - // these tag types will have content inserted - const closed = ['noscript', 'script', 'style'].indexOf(type) === -1 - // generate tag exactly without any other redundant attribute const observeTag = tag.once ? '' : `${attribute}="true" ` + // these tags have no end tag + const hasEndTag = !['base', 'meta', 'link'].includes(type) + + // these tag types will have content inserted + const hasContent = hasEndTag && ['noscript', 'script', 'style'].includes(type) + // the final string for this specific tag - return closed - ? `${tagsStr}<${type} ${observeTag}${attrs}/>` + return !hasContent + ? `${tagsStr}<${type} ${observeTag}${attrs}${hasEndTag ? '/' : ''}>` : `${tagsStr}<${type} ${observeTag}${attrs}>${content}` }, '') } From 901fd2fcb8ee1bc63d1329f6fc0903b79d736778 Mon Sep 17 00:00:00 2001 From: pimlie Date: Mon, 28 Jan 2019 12:10:41 +0100 Subject: [PATCH 2/2] fix: update travis config --- .travis.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7e87a31e..88f6dbaa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,18 @@ language: node_js +node_js: + - "8" + - "11" cache: + yarn: true directories: - - $HOME/.npm - - $HOME/.yarn-cache - node_modules branches: only: - master -node_js: - - "6" -before_install: - - npm i -g yarn --cache-min 999999999 install: - - yarn --force + - yarn install script: + - yarn lint - yarn test -after_script: - - yarn run codecov +after_success: + - yarn codecov