{"record":{"id":"772c031748015c89","repo":"stride3d/stride","slug":"while-scanning-a-block-scalar-find-a-tab-character-where-an","errorCode":null,"errorMessage":"While scanning a block scalar, find a tab character where an intendation space is expected.","messagePattern":"While scanning a block scalar, find a tab character where an intendation space is expected\\.","errorType":"exception","errorClass":"SyntaxErrorException","httpStatus":null,"severity":"error","filePath":"sources/core/Stride.Core.Yaml/Scanner.cs","lineNumber":1518,"sourceCode":"            for (;;)\n            {\n                // Eat the intendation spaces.\n\n                while ((currentIndent == 0 || mark.Column < currentIndent) && analyzer.IsSpace())\n                {\n                    Skip();\n                }\n\n                if (mark.Column > maxIndent)\n                {\n                    maxIndent = mark.Column;\n                }\n\n                // Check for a tab character messing the intendation.\n\n                if ((currentIndent == 0 || mark.Column < currentIndent) && analyzer.IsTab())\n                {\n                    throw new SyntaxErrorException(start, mark, \"While scanning a block scalar, find a tab character where an intendation space is expected.\");\n                }\n\n                // Have we find a non-empty line?\n\n                if (!analyzer.IsBreak())\n                {\n                    break;\n                }\n\n                // Consume the line break.\n\n                ReadLine(breaks);\n\n                end = mark;\n            }\n\n            // Determine the indentation level if needed.\n","sourceCodeStart":1500,"sourceCodeEnd":1536,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/core/Stride.Core.Yaml/Scanner.cs#L1500-L1536","documentation":"Inside a block scalar's body, indentation must consist of spaces only. ScanBlockScalar throws this SyntaxErrorException when it detects a tab character on a line whose column is before the required indentation (or while indentation is still 0), because tabs cannot count as indentation in YAML block scalars.","triggerScenarios":"A multi-line block scalar whose continuation lines are indented with tab characters instead of spaces, e.g. 'text: |\\n\\tline'. Any parse of such content throws while scanning the block scalar body.","commonSituations":"Editors configured with tab indentation saving YAML files, code generators emitting '\\t' prefixes for multi-line strings, and paste operations converting leading spaces to tabs.","solutions":["Replace leading tabs with spaces in all lines of the block scalar.","Configure your editor to insert spaces for indentation in YAML files (editorconfig: indent_style = space).","Fix generator/serializer code to pad with spaces, e.g. new string(' ', indent) instead of '\\t'.","Re-encode files: run expand -t 2 (or similar) over the YAML to convert tabs to spaces.","Add a pre-commit or CI check rejecting tab characters at line starts in YAML files."],"exampleFix":"// before (tab indentation inside block scalar)\ntext: |\n\tline one\n\n// after (spaces)\ntext: |\n  line one","handlingStrategy":"validation","validationCode":"static bool NoLeadingTabs(string yamlContent) =>\n    !yamlContent.Split('\\n').Any(line => line.Length > 0 && (line[0] == '\\t' || line.TrimEnd().StartsWith(\"\\t\")));","typeGuard":null,"tryCatchPattern":"try\n{\n    var obj = deserializer.Deserialize<T>(input);\n}\ncatch (YamlException ex)\n{\n    throw new FormatException($\"Tab used for indentation at {ex.Start.Line}:{ex.Start.Column} — replace tabs with spaces\", ex);\n}","preventionTips":["Use spaces only for YAML indentation; set indent_style=space in .editorconfig","Run 'expand' or an equivalent to normalize tabs before parsing","Never emit '\\\\t' from generators for block scalar indentation","Add a CI check rejecting tab characters at line starts in YAML files"],"tags":["yaml","parser","whitespace","tabs"],"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"}