Closed nightroman closed 10 years ago
Exception information:
MethodInvocationException:
Exception calling "Transform" with "1" argument(s): "Unable to cast object of type 'System.Boolean' to type 'System.String'."
At C:\TEMP\MarkdownDeep\_120308_230831.text.ps1:20 char:1
+ $markdown.Transform($text)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
InvalidCastException:
Unable to cast object of type 'System.Boolean' to type 'System.String'.
System.Management.Automation.MethodInvocationException: Exception calling "Transform" with "1" argument(s): "Unable to cast object of type 'System.Boolean' to type 'System.String'." ---> System.InvalidCastException: Unable to cast object of type 'System.Boolean' to type 'System.String'.
at MarkdownDeep.Block.ResolveHeaderID(Markdown m) in C:\TEMP\MarkdownDeep\Block.cs:line 124
at MarkdownDeep.Block.Render(Markdown m, StringBuilder b) in C:\TEMP\MarkdownDeep\Block.cs:line 168
at MarkdownDeep.Markdown.Transform(String str, Dictionary`2& definitions) in C:\TEMP\MarkdownDeep\MardownDeep.cs:line 136
at MarkdownDeep.Markdown.Transform(String str) in C:\TEMP\MarkdownDeep\MardownDeep.cs:line 64
Seems like a .NET specific issue. The JS version doesn't crash.
Fixed in latest master for C# and JS
The following minimized piece of markdown makes
Transform()
to crash ifExtraMode && !SafeMode
:Here is a PowerShell script ready to demonstrate the problem (replace the hardcoded DLL path with the actual):