Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Underscores in JSON payload break Sublime Text & GitHub syntax highlighting #241

Closed
czechboy0 opened this issue Aug 3, 2015 · 4 comments

Comments

@czechboy0
Copy link

It seems like keys that contain an underscore break highlighting for the whole apib file, see https://github.com/czechboy0/XcodeServer-API-Docs/blob/master/apiary.apib#L136. This is different than the MSON underscore issue, because there underscores are reserved characters, whereas in JSON they are allowed.

Would be great if this could get fixed in both parsers (Sublime Text's and GitHub's).

@danielgtaylor
Copy link
Contributor

Thanks for reporting this. I believe that adding support for the + Model section should help fix this by preventing the markdown rules from taking over there.

@kylef
Copy link
Member

kylef commented Aug 4, 2015

@danielgtaylor Regardless of native support for + Model section, this should be a code block in plain markdown (four spaces within a list item) so it should be rendered as a code block regardless of the list item content (Model as a string).

Note: I believe there are plans to deprecate/remove resource model's. I wouldn't suggest adding native support for resource model's within the lexers refractproject/rfcs#1 (comment).

@czechboy0
Copy link
Author

@kylef Does that mean there would be no way to copy/paste example JSON responses into API Blueprint? I'd see that as a regression if not provided with an automatic JSON/XML/... -> MSON converter.

@kylef
Copy link
Member

kylef commented Sep 22, 2015

@czechboy0 You would still be able to copy-paste example code into API Blueprint examples.

I've closed this issue to move it to the sublime plugin (which is how GitHub also does the rendering) apiaryio/api-blueprint-sublime-plugin#29

As a workaround, you could use fenced code-blocks as shown in the following example until this issue has been resolved.

+ Model (application/json)

     ```
    {
      "_id": "963bc95f1c1a56f69f3392b4aa03302f"
    }
     ```

@kylef kylef closed this as completed Sep 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants