{"record":{"id":"074f104ed8c13b99","repo":"stride3d/stride","slug":"while-scanning-a-plain-scalar-find-a-tab-character-that","errorCode":null,"errorMessage":"While scanning a plain scalar, find a tab character that violate intendation.","messagePattern":"While scanning a plain scalar, find a tab character that violate intendation\\.","errorType":"exception","errorClass":"SyntaxErrorException","httpStatus":null,"severity":"error","filePath":"sources/core/Stride.Core.Yaml/Scanner.cs","lineNumber":1917,"sourceCode":"\n                // Is it the end?\n\n                if (!(analyzer.IsBlank() || analyzer.IsBreak()))\n                {\n                    break;\n                }\n\n                // Consume blank characters.\n\n                while (analyzer.IsBlank() || analyzer.IsBreak())\n                {\n                    if (analyzer.IsBlank())\n                    {\n                        // Check for tab character that abuse intendation.\n\n                        if (hasLeadingBlanks && mark.Column < currentIndent && analyzer.IsTab())\n                        {\n                            throw new SyntaxErrorException(start, mark, \"While scanning a plain scalar, find a tab character that violate intendation.\");\n                        }\n\n                        // Consume a space or a tab character.\n\n                        if (!hasLeadingBlanks)\n                        {\n                            whitespaces.Append(ReadCurrentCharacter());\n                        }\n                        else\n                        {\n                            Skip();\n                        }\n                    }\n                    else\n                    {\n                        // Check if it is a first line break.\n\n                        if (!hasLeadingBlanks)","sourceCodeStart":1899,"sourceCodeEnd":1935,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/core/Stride.Core.Yaml/Scanner.cs#L1899-L1935","documentation":"Thrown by the YAML Scanner when a tab character is used in the indentation of a plain scalar continuation line. YAML forbids tabs for indentation; after leading blanks, a tab at a column less than the current block indent violates indentation rules and the scanner cannot determine structure.","triggerScenarios":"Parsing YAML where a continuation line of a multi-line plain scalar begins with (or contains indentation from) a tab character that starts before the current indentation level, e.g. a value line indented with a tab under a block mapping.","commonSituations":"Files edited in editors configured to insert tabs (default vim/Notepad settings); copy-pasting content from terminals or chat that converted spaces to tabs; build tooling that expands indentation with tabs.","solutions":["Replace all tab characters used for indentation with spaces (e.g. `expand -t 2 file.yml` or editor 'convert tabs to spaces').","Configure your editor to insert spaces instead of tabs for YAML files (editorconfig: indent_style = space).","Re-run `grep -P '\\t' file.yml` to locate remaining tabs and fix them manually.","Normalize the file programmatically before parsing if it comes from an external source."],"exampleFix":"// before (tab-indented)\nkey:\n\tvalue continues\n// after\nkey:\n  value continues","handlingStrategy":"validation","validationCode":"bool HasTabIndentation(string yaml) => yaml.Split('\\n').Any(l => l.Length > 0 && (l[0] == '\\t' || l.StartsWith(\" \\t\")));","typeGuard":null,"tryCatchPattern":"try\n{\n    var obj = Deserializer.FromFile(path);\n}\ncatch (SyntaxErrorException ex)\n{\n    Log.Error(ex, \"Tab in indentation at line {Line}\", ex.Start.Line);\n    File.WriteAllText(path, File.ReadAllText(path).Replace(\"\\t\", \"  \"));\n}","preventionTips":["Add an .editorconfig with indent_style = space for *.yml/*.yaml","Run `grep -P '\\t' *.yml` in CI to reject tab-indented YAML","Sanitize externally supplied YAML (replace tabs with spaces) before parsing"],"tags":["yaml","scanner","tab-character","indentation"],"backgroundTag":"yaml-parse-error","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}