mirror of
https://github.com/documize/community.git
synced 2025-07-30 18:49:43 +02:00
CodeMirror dependency upgraded to v5.32.0
For handling Markdown and Code section types
This commit is contained in:
parent
3337db6b27
commit
0336f84a83
351 changed files with 3408 additions and 1945 deletions
19
gui/public/codemirror/mode/jsx/test.js
vendored
Executable file → Normal file
19
gui/public/codemirror/mode/jsx/test.js
vendored
Executable file → Normal file
|
@ -33,6 +33,9 @@
|
|||
MT("preserve_js_context",
|
||||
"[variable x] [operator =] [string-2 `quasi${][bracket&tag <][tag foo][bracket&tag />][string-2 }quoted`]")
|
||||
|
||||
MT("string_interpolation",
|
||||
"[variable x] [operator =] [string-2 `quasi<code>${] [number 10] [string-2 }</code>`]")
|
||||
|
||||
MT("line_comment",
|
||||
"([bracket&tag <][tag foo] [comment // hello]",
|
||||
" [bracket&tag ></][tag foo][bracket&tag >][operator ++])")
|
||||
|
@ -66,4 +69,20 @@
|
|||
|
||||
MT("tag_attribute",
|
||||
"([bracket&tag <][tag foo] [attribute bar]=[bracket&tag <][tag foo][bracket&tag />/>][operator ++])")
|
||||
|
||||
var ts_mode = CodeMirror.getMode({indentUnit: 2}, "text/typescript-jsx")
|
||||
function TS(name) { test.mode(name, ts_mode, Array.prototype.slice.call(arguments, 1)) }
|
||||
|
||||
TS("tsx_react_integration",
|
||||
"[keyword interface] [def Props] {",
|
||||
" [property foo]: [type string];",
|
||||
"}",
|
||||
"[keyword class] [def MyComponent] [keyword extends] [type React].[type Component] [operator <] [type Props], [type any] [operator >] {",
|
||||
" [property render]() {",
|
||||
" [keyword return] [bracket&tag <][tag span][bracket&tag >]{[keyword this].[property props].[property foo]}[bracket&tag </][tag span][bracket&tag >]",
|
||||
" }",
|
||||
"}",
|
||||
"[bracket&tag <][tag MyComponent] [attribute foo]=[string \"bar\"] [bracket&tag />]; [comment //ok]",
|
||||
"[bracket&tag <][tag MyComponent] [attribute foo]={[number 0]} [bracket&tag />]; [comment //error]")
|
||||
|
||||
})()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue