33// Licensed under the MIT license.
44
55using System ;
6- using System . Buffers ;
76using System . Collections . Generic ;
87using SmartFormat . Core . Extensions ;
98using SmartFormat . Core . Output ;
@@ -17,7 +16,7 @@ namespace SmartFormat.Core.Formatting;
1716/// <summary>
1817/// The class contains the fields and methods which are necessary for formatting.
1918/// </summary>
20- public class FormattingInfo : IFormattingInfo , ISelectorInfo
19+ public class FormattingInfo : IFormattingInfo , ISelectorInfo , IFormattingExtensionsToggle
2120{
2221 /// <summary>
2322 /// CTOR for object pooling.
@@ -52,6 +51,7 @@ public FormattingInfo Initialize(FormattingInfo? parent, FormatDetails formatDet
5251 CurrentValue = currentValue ;
5352 FormatDetails = formatDetails ;
5453 Format = format ;
54+ DisableFormattingExtensions = false ;
5555 // inherit alignment
5656 if ( parent != null ) Alignment = parent . Alignment ;
5757 else if ( format . ParentPlaceholder != null ) Alignment = format . ParentPlaceholder . Alignment ;
@@ -73,6 +73,7 @@ public FormattingInfo Initialize(FormattingInfo? parent, FormatDetails formatDet
7373 FormatDetails = formatDetails ;
7474 Placeholder = placeholder ;
7575 Format = placeholder . Format ;
76+ DisableFormattingExtensions = false ;
7677 CurrentValue = currentValue ;
7778 // inherit alignment
7879 Alignment = placeholder . Alignment ;
@@ -94,6 +95,7 @@ public void ReturnToPool()
9495 Alignment = 0 ;
9596
9697 Format = null ;
98+ DisableFormattingExtensions = false ;
9799 CurrentValue = null ;
98100
99101 // Children can safely be returned
@@ -304,6 +306,9 @@ public FormattingException FormattingException(string issue, FormatItem? problem
304306 /// </summary>
305307 public object ? Result { get ; set ; }
306308
309+ /// <inheritdoc />
310+ public bool DisableFormattingExtensions { get ; set ; }
311+
307312 /// <summary>
308313 /// Creates a child <see cref="FormattingInfo"/> from the current <see cref="FormattingInfo"/> instance for a <see cref="Parsing.Format"/>.
309314 /// </summary>
0 commit comments