ConfigurationSectionHeaderMode Enum
Definition
- Namespace
- Bodu.Text.Configuration
- Assembly
- Bodu.Text.Configuration.dll
- Package
- Bodu.Text.Configuration 1.0.0
Controls how the reader treats non-whitespace text after the closing ] of a section header.
public enum ConfigurationSectionHeaderMode
- Extension Methods
Fields
Lenient = 0Trailing non-whitespace after the closing
]is accepted silently. This matches the historical Bodu profile and is the default for documents authored against lenient dialects.Strict = 1Trailing content (whether word or comment-introducer) after the closing
]emits TrailingContentAfterSectionHeader. Trailing whitespace is always permitted.AllowTrailingInlineComment = 2Trailing inline comments (introduced by
#or;) after the closing]are accepted and discarded; any other trailing content emits TrailingContentAfterSectionHeader.
Remarks
The parser identifies a section name as everything between the first [ on the line and the last ] on
the line, allowing ] inside section names so EditorConfig pattern conventions remain usable. The handling of
any text that appears *after* the final ] is a separate decision that this mode controls.
Under Lenient the parser accepts trailing content silently - useful when the document is authored
against a lenient EditorConfig dialect that ignores trailing words. Under Strict the parser emits
TrailingContentAfterSectionHeader so authors learn about typos.
AllowTrailingInlineComment sits between the two: trailing comments (introduced by # or
;) are accepted, anything else still produces the diagnostic.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |