File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
src/Elastic.Markdown/Myst/FrontMatter Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -122,10 +122,17 @@ public class ApplicableToConverter : IYamlTypeConverter
122122
123123 public object ? ReadYaml ( IParser parser , Type type , ObjectDeserializer rootDeserializer )
124124 {
125+ var warnings = new List < string > ( ) ;
126+ var applicableTo = new ApplicableTo ( ) ;
127+
125128 if ( parser . TryConsume < Scalar > ( out var value ) )
126129 {
127130 if ( string . IsNullOrWhiteSpace ( value . Value ) )
128- return ApplicableTo . All ;
131+ {
132+ warnings . Add ( "The 'applies_to' field is present but empty. No applicability will be assumed." ) ;
133+ return null ;
134+ }
135+
129136 if ( string . Equals ( value . Value , "all" , StringComparison . InvariantCultureIgnoreCase ) )
130137 return ApplicableTo . All ;
131138 }
@@ -134,10 +141,6 @@ public class ApplicableToConverter : IYamlTypeConverter
134141 if ( deserialized is not Dictionary < object , object ? > { Count : > 0 } dictionary )
135142 return null ;
136143
137-
138- var applicableTo = new ApplicableTo ( ) ;
139- var warnings = new List < string > ( ) ;
140-
141144 var keys = dictionary . Keys . OfType < string > ( ) . ToArray ( ) ;
142145 var oldStyleKeys = keys . Where ( k => k . StartsWith ( ':' ) ) . ToList ( ) ;
143146 if ( oldStyleKeys . Count > 0 )
You can’t perform that action at this time.
0 commit comments