bustle/mobiledoc-kit

Cards payload quotations and the standard

randohinn opened this issue · 6 comments

Hello. I'm writing a MobileDoc renderer in PHP. However, php really does not like to decode from json, when keys do not have quotation marks around them... Eg, this fails if I don't surround src in quotes.

  "cards": [
    ["image", {
        "src": "http://google.com/logo.png"
    }]
],

I was wondering, is the quotation marks something one can configure in the kit output, or how much "in-spec" they are with the MobileDoc standard? If these are not configurable, I suggest making it so they are 😄.

Found workaround on PHP side

@randohinn All Mobiledocs should be valid JSON. If it ain't JSON, it ain't Mobiledoc.

If you're seeing something to the contrary, please let me know!

@mixonic Yup, the cards examples in mobiledoc.md, which describes the format, and iirc, also the atoms section there has unquoted examples.

Reopening as this JSON fault still exists in the docs. https://github.com/bustle/mobiledoc-kit/blob/master/MOBILEDOC.md under Card definition signature.

Closed by #645, feel free to re-open if I am missing something.

This has not been automatically closed, apparently. There are some more JSON errors in the examples, but I'll have to pass on fixing them, on account of not having the time right now. However, I'd be really happy, if someone could point out all the unsupported features in my renderer so I'd have basis on refactoring it a bit.