{"record":{"id":"ffc4f1bb659cd672","repo":"swc-project/swc","slug":"garbage-in-colgroup-element","errorCode":null,"errorMessage":"Garbage in \"colgroup\" element","messagePattern":"Garbage in \"colgroup\" element","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"crates/swc_html_parser/src/parser/mod.rs","lineNumber":5195,"sourceCode":"                    //\n                    // If the current node is not a colgroup element, then this is a parse error;\n                    // ignore the token.\n                    //\n                    // Otherwise, pop the current node from the stack of open elements.\n                    //\n                    // Switch the insertion mode to \"in table\".\n                    //\n                    // Reprocess the token.\n                    _ => match self.open_elements_stack.items.last() {\n                        Some(node) if !is_html_element!(node, \"colgroup\") => match token {\n                            Token::Character { .. } => {\n                                self.errors.push(Error::new(\n                                    token_and_info.span,\n                                    ErrorKind::NonSpaceCharacterInColumnGroup,\n                                ));\n                            }\n                            _ => {\n                                self.errors.push(Error::new(\n                                    token_and_info.span,\n                                    ErrorKind::GarbageInColumnGroup,\n                                ));\n                            }\n                        },\n                        _ => {\n                            self.open_elements_stack.pop();\n                            self.insertion_mode = InsertionMode::InTable;\n                            self.process_token(token_and_info, None)?;\n                        }\n                    },\n                }\n            }\n            // The \"in table body\" insertion mode\n            InsertionMode::InTableBody => {\n                // When the user agent is to apply the rules for the \"in table body\" insertion\n                // mode, the user agent must handle the token as follows:\n                match token {","sourceCodeStart":5177,"sourceCodeEnd":5213,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_html_parser/src/parser/mod.rs#L5177-L5213","documentation":"HTML parse error in the 'in column group' anything-else branch: a token (other than the allowed col/template/whitespace forms) was seen while in <colgroup>, and the current node was not the colgroup element ('garbage' in colgroup). The token is ignored after recording the error, or colgroup is popped and the token reprocessed.","triggerScenarios":"Thrown at crates/swc_html_parser/src/parser/mod.rs:5195 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Close <colgroup> before emitting table body content","Remove invalid tokens from inside <colgroup>"],"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-14T05:17:10.506Z"}