pull/13362/head
Rich Harris 2 years ago
parent 63d91f918f
commit e835721007

@ -794,8 +794,6 @@ function handle_events(element, state) {
}
if (first) {
const indent = get_indent(state, first, element);
let singular = handlers.map((handler) => handler.handler).join(', ');
if (singular) {
@ -813,24 +811,6 @@ function handle_events(element, state) {
}
}
/**
* Returns the next indentation level of the first node that has all-whitespace before it
* @param {State} state
* @param {Array<{start: number; end: number}>} nodes
*/
function get_indent(state, ...nodes) {
for (const node of nodes) {
const line_start = state.str.original.lastIndexOf('\n', node.start);
const indent = state.str.original.substring(line_start + 1, node.start);
if (indent.trim() === '') {
return indent;
}
}
return '';
}
/**
* Returns start and end of the node. If the start is preceeded with white-space-only before a line break,
* the start will be the start of the line.

Loading…
Cancel
Save