Skip to content
This repository was archived by the owner on Oct 1, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/server/generators/tagGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default function _tagGenerator (options = {}) {
// these attributes are treated as children on the tag
case 'innerHTML':
case 'cssText':
case 'once':
return attrsStr

// these form the attribute list for this tag
Expand All @@ -35,10 +36,15 @@ export default function _tagGenerator (options = {}) {
// these tag types will have content inserted
const closed = ['noscript', 'script', 'style'].indexOf(type) === -1

// generate tag exactly without any other redundance attribute
const observeTag = tag.once
? ''
: `${attribute}="true" `

// the final string for this specific tag
return closed
? `${tagsStr}<${type} ${attribute}="true" ${attrs}/>`
: `${tagsStr}<${type} ${attribute}="true" ${attrs}>${content}</${type}>`
? `${tagsStr}<${type} ${observeTag}${attrs}/>`
: `${tagsStr}<${type} ${observeTag}${attrs}>${content}</${type}>`
}, '')
}
}
Expand Down