File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
src/Elastic.Markdown/Myst/Directives Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ public string Title
3434 public override void FinalizeAndValidate ( ParserContext context )
3535 {
3636 CrossReferenceName = Properties . GetValueOrDefault ( "name" ) ;
37- DropdownOpen = PropBool ( "open" ) ;
37+ DropdownOpen = TryPropBool ( "open" ) ;
3838 if ( DropdownOpen . HasValue )
3939 Classes = "dropdown" ;
4040 }
Original file line number Diff line number Diff line change @@ -93,6 +93,16 @@ protected bool PropBool(params string[] keys)
9393 return bool . TryParse ( value , out var result ) && result ;
9494 }
9595
96+ protected bool ? TryPropBool ( params string [ ] keys )
97+ {
98+ var value = Prop ( keys ) ;
99+ if ( string . IsNullOrEmpty ( value ) )
100+ return keys . Any ( k => Properties . ContainsKey ( k ) ) ? true : null ;
101+
102+ return bool . TryParse ( value , out var result ) ? result : null ;
103+ }
104+
105+
96106 protected string ? Prop ( params string [ ] keys )
97107 {
98108 foreach ( var key in keys )
You can’t perform that action at this time.
0 commit comments