Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 18x 18x 18x 18x 18x 18x 18x | /** @import { Ast } from '#compiler' */ /** @import { ComponentContext } from '../types.js' */ import * as b from '../../../../utils/builders.js'; import { process_children, build_template } from './shared/utils.js'; /** * @param {Ast.TitleElement} node * @param {ComponentContext} context */ export function TitleElement(node, context) { // title is guaranteed to contain only text/expression tag children const template = [b.literal('<title>')]; process_children(node.fragment.nodes, { ...context, state: { ...context.state, template } }); template.push(b.literal('</title>')); context.state.init.push(...build_template(template, b.id('$$payload.title'), '=')); } |