template.RegularElement() — svelte Function Reference
Architecture documentation for the template.RegularElement() function in index.js from the svelte codebase.
Entity Profile
Dependency Diagram
graph TD a08d16d0_ebd3_b975_18ce_1fcee3350ed6["template.RegularElement()"] cab41022_1b55_3b7a_06c6_b90763bbea47["index.js"] a08d16d0_ebd3_b975_18ce_1fcee3350ed6 -->|defined in| cab41022_1b55_3b7a_06c6_b90763bbea47 02a8b5a2_13c5_e5b3_1ed2_617763d0904d["is_void()"] a08d16d0_ebd3_b975_18ce_1fcee3350ed6 -->|calls| 02a8b5a2_13c5_e5b3_1ed2_617763d0904d a7190cf9_11f3_7b29_6ed5_5ee01fc100af["is_svg()"] a08d16d0_ebd3_b975_18ce_1fcee3350ed6 -->|calls| a7190cf9_11f3_7b29_6ed5_5ee01fc100af cdc1fb24_8bb0_cade_bc99_13f6efb7c385["migrate_slot_usage()"] a08d16d0_ebd3_b975_18ce_1fcee3350ed6 -->|calls| cdc1fb24_8bb0_cade_bc99_13f6efb7c385 24f461f2_c717_3a18_d33f_adb48a448ef4["handle_events()"] a08d16d0_ebd3_b975_18ce_1fcee3350ed6 -->|calls| 24f461f2_c717_3a18_d33f_adb48a448ef4 style a08d16d0_ebd3_b975_18ce_1fcee3350ed6 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/svelte/src/compiler/migrate/index.js lines 1060–1075
RegularElement(node, { state, path, next }) {
// Strip off any namespace from the beginning of the node name.
const node_name = node.name.replace(/[a-zA-Z-]*:/g, '');
if (state.analysis.source[node.end - 2] === '/' && !is_void(node_name) && !is_svg(node_name)) {
let trimmed_position = node.end - 2;
while (state.str.original.charAt(trimmed_position - 1) === ' ') trimmed_position--;
state.str.remove(trimmed_position, node.end - 1);
state.str.appendLeft(node.end, `</${node.name}>`);
}
migrate_slot_usage(node, path, state);
handle_events(node, state);
next();
},
Domain
Subdomains
Source
Frequently Asked Questions
What does template.RegularElement() do?
template.RegularElement() is a function in the svelte codebase, defined in packages/svelte/src/compiler/migrate/index.js.
Where is template.RegularElement() defined?
template.RegularElement() is defined in packages/svelte/src/compiler/migrate/index.js at line 1060.
What does template.RegularElement() call?
template.RegularElement() calls 4 function(s): handle_events, is_svg, is_void, migrate_slot_usage.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free