api-blueprint-sublime-plugin icon indicating copy to clipboard operation
api-blueprint-sublime-plugin copied to clipboard

Incorrect highlighting when MSON attribute description contains underscore

Open danielgtaylor opened this issue 10 years ago • 5 comments

See apiaryio/api-blueprint#202. Sample at line 126.

danielgtaylor avatar Jun 01 '15 20:06 danielgtaylor

Same problem here with wrong rendering

+ Request Client credentials (application/json)

    + Attributes

        + grant_type: `client_credentials` (string, required)
        + client_id: `88888888-4444-4444-4444-cccccccccccc` (string, required)
        + client_secret: `clientsecret` (string, required)

    + Body

            {
                "grant_type": "client_credentials",
                "client_id": "88888888-4444-4444-4444-cccccccccccc",
                "client_secret": "clientsecret"
            }

screenshot 2015-07-28 12 21 44 screenshot 2015-07-28 12 20 20

freezy-sk avatar Jul 28 '15 10:07 freezy-sk

@danielgtaylor Now that I look at this with fresh eyes, this might not be an issue at all, since underscores in MSON are not allowed and they need to be escaped. If that rule is followed, the highlighter would not make any mistake.

pksunkara avatar Jul 28 '15 11:07 pksunkara

MSON are not allowed and they need to be escaped

This is true for property names and values. Not for description.

zdne avatar Jul 28 '15 16:07 zdne

Same hightlighting issue happens if you have a JSON payload that contains a key that starts with an underscore.

For instance:

## Videos Collection [/videos]

Provides access to all videos.

+ Model (application/json)

    JSON representation of videos

    + Body

            {
                "_pagination":
                {
                    "next": "/videos?offset=7",
                    "total_count": 100
                }
            }

Highlighting is incorrect in sublime text starting from the underscore.

jeanregisser avatar Aug 05 '15 08:08 jeanregisser

any update?

xuxucode avatar Sep 26 '16 09:09 xuxucode