mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
75fbf60274
* Use Curl constants for info * Extra timeline info and cookie url encoding setting * Add warning to environment selector * Title attribute on the autocomplete types * Added test
23 lines
853 B
JavaScript
23 lines
853 B
JavaScript
import CodeMirror from 'codemirror';
|
|
import 'codemirror/addon/mode/simple';
|
|
|
|
CodeMirror.defineSimpleMode('curl', {
|
|
start: [
|
|
// Regular key-value header tokens
|
|
{regex: /^(> )([\w-]*: )(.*)$/, token: ['curl-prefix curl-out', 'curl-out', 'curl-out curl-value']},
|
|
{regex: /^(< )([\w-]*: )(.*)$/, token: ['curl-prefix curl-in', 'curl-in', 'curl-in curl-value']},
|
|
|
|
// Header fields ("POST /foo/bar HTTP/1.1")
|
|
{regex: /^(> )([^:]+ .*)$/, token: ['curl-prefix curl-out curl-header', 'curl-out curl-header']},
|
|
{regex: /^(< )([^:]+ .*)$/, token: ['curl-prefix curl-in curl-header', 'curl-in curl-header']},
|
|
|
|
// Data
|
|
{regex: /^(\| )(.*)$/, token: ['curl-prefix curl-data', 'curl-data']},
|
|
|
|
// Informational text
|
|
{regex: /^(\* )(.*)$/, token: ['curl-prefix curl-comment', 'curl-comment']}
|
|
],
|
|
comment: [],
|
|
meta: {}
|
|
});
|