'{}' is not parse well
| newDocument |
newDocument := parser parse: '{}'
newDocument first .
says that it is unparseable as a key...
| newDocument |
newDocument := parser parse: '{
}'
newDocument first .
Should add
MicTextualMicrodownExporterTest >> testMetaDataEmpty
| newDocument |
newDocument := parser parse: '{}'.
visitor visit: newDocument.
self assert: visitor contents equals: '{}'.
This is from nearly a year ago, and Microdown seems to be changing. Here is my translations of your comments above: "parser parse: '{}'" is the same as parser := MicrodownParser new. (parser parse: '{}'). The "first" is now (parser parse: '{}') children first. "Metadata: a Dictionary('unparsableContents'->nil )" which also says "unparalleled" (though slightly different).
Class MicRichTextComposer seems to be the one that was previously the one you mention: MicTextualMicrodownExporter. That implies that the test has become MicMetaDataBlockTest.
So, there is a MicMetaDataBlockTest>>testParse, with some code like: testParse
| source root metadata |
source := '{
"authors" : "S. Ducasse" , "title" : "Pharo by Example" }
header'....
So the thing needed is a similar test, where the {...} is empty, and should be tested for both {} and {....} where ... is ascii < 32.
If all of this is true, writing the actual test is simple. I assume it to be the case, but will not be done now, as it is evening time...
As I guessed, I solved the issue, see #954.
It turns out that the { ... } is not working on: source := '{ "authors" : "S. Ducasse" , "title" : "Pharo by Example" }'.
The first line starting with "{", cannot have any arguments after it. This is however allowed: source := '{ "authors" : "S. Ducasse" , "title" : "Pharo by Example" }'. That is, ending with "}" works.