assetgraph
Version:
An auto discovery dependency graph based optimization framework for web pages and applications
23 lines (18 loc) • 526 B
JavaScript
const HtmlRelation = require('./HtmlRelation');
class XmlHtmlInlineFragment extends HtmlRelation {
inline() {
super.inline();
this.node.textContent = this.to.text;
this.from.markDirty();
return this;
}
attach(position, adjacentRelation) {
this.node = this.from.parseTree.createElement(this.node.nodeName);
super.attach(position, adjacentRelation);
}
}
Object.assign(XmlHtmlInlineFragment.prototype, {
targetType: 'Html',
_hrefType: 'inline',
});
module.exports = XmlHtmlInlineFragment;