{"record":{"id":"64a70a4c28d1aa09","repo":"swc-project/swc","slug":"start-tag-tag-name-seen-in-table-body","errorCode":null,"errorMessage":"Start tag \"{tag_name}\" seen in \"table\" body","messagePattern":"Start tag \"(.+?)\" seen in \"table\" body","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"crates/swc_html_parser/src/parser/mod.rs","lineNumber":5241,"sourceCode":"                        ..\n                    } if tag_name == \"tr\" => {\n                        self.open_elements_stack.clear_back_to_table_body_context();\n                        self.insert_html_element(token_and_info)?;\n                        self.insertion_mode = InsertionMode::InRow;\n                        maybe_allow_self_closing!(is_self_closing, tag_name);\n                    }\n                    // A start tag whose tag name is one of: \"th\", \"td\"\n                    //\n                    // Parse error.\n                    //\n                    // Clear the stack back to a table body context. (See below.)\n                    //\n                    // Insert an HTML element for a \"tr\" start tag token with no attributes, then\n                    // switch the insertion mode to \"in row\".\n                    //\n                    // Reprocess the current token.\n                    Token::StartTag { tag_name, .. } if matches!(&**tag_name, \"th\" | \"td\") => {\n                        self.errors.push(Error::new(\n                            token_and_info.span,\n                            ErrorKind::StartTagInTableBody(tag_name.clone()),\n                        ));\n                        self.open_elements_stack.clear_back_to_table_body_context();\n                        self.insert_html_element(&self.create_fake_token_and_info(\"tr\", None))?;\n                        self.insertion_mode = InsertionMode::InRow;\n                        self.process_token(token_and_info, None)?;\n                    }\n                    // An end tag whose tag name is one of: \"tbody\", \"tfoot\", \"thead\"\n                    //\n                    // If the stack of open elements does not have an element in table scope that is\n                    // an HTML element with the same tag name as the token, this is a parse error;\n                    // ignore the token.\n                    //\n                    // Otherwise:\n                    //\n                    // Clear the stack back to a table body context. (See below.)\n                    //","sourceCodeStart":5223,"sourceCodeEnd":5259,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_html_parser/src/parser/mod.rs#L5223-L5259","documentation":"HTML parse error in the 'in table body' insertion mode: a start tag other than the expected tr/th/td/caption/col/tbody-family was seen while parsing a table body (e.g. a cell or row tag in the wrong position). The tag name is included; recovery clears back to table body context and continues.","triggerScenarios":"Thrown at crates/swc_html_parser/src/parser/mod.rs:5241 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Wrap cells in <tr> rows inside <tbody>/<thead>/<tfoot>","Move the tag to a valid position in the table structure"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5176682b65416c6b5de6b47379ae1588ea3ecb3f","analyzedAt":"2026-08-17T16:16:52.067Z","contentChangedAt":"2026-08-17T16:16:52.067Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}