MCPcopy Create free account
hub / github.com/breck7/scroll / _toHtml

Method _toHtml

external/.scrollLibs.js:22784–22796  ·  view source on GitHub ↗
(indentCount, withSuid)

Source from the content-addressed store, hash-verified

22782 return elem
22783 }
22784 _toHtml(indentCount, withSuid) {
22785 const tag = this.getTag()
22786 const children = this.map(child => child._toHtml(indentCount + 1, withSuid)).join("")
22787 const attributesStr = this.filter(particle => particle.isAttributeParser)
22788 .map(child => child.getAttribute())
22789 .join("")
22790 const indent = " ".repeat(indentCount)
22791 const collapse = this.shouldCollapse()
22792 const indentForChildParsers = !collapse && this.getSubparticleInstancesOfParserId("htmlTagParser").length > 0
22793 const suid = withSuid ? ` stumpUid="${this._getUid()}"` : ""
22794 const oneLiner = this._getOneLiner()
22795 return `${!collapse ? indent : ""}<${tag}${attributesStr}${suid}>${oneLiner}${indentForChildParsers ? "\n" : ""}${children}</${tag}>${collapse ? "" : "\n"}`
22796 }
22797 removeCssStumpParticle() {
22798 return this.removeStumpParticle()
22799 }

Callers 2

asHtmlWithSuidsMethod · 0.95
asHtmlMethod · 0.95

Calls 10

getTagMethod · 0.95
shouldCollapseMethod · 0.95
_getOneLinerMethod · 0.95
mapMethod · 0.80
getAttributeMethod · 0.80
_getUidMethod · 0.80
joinMethod · 0.45
_toHtmlMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected