File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " codemirror-json-schema " : patch
3
+ ---
4
+
5
+ Fix description markdown rendering in completion
Original file line number Diff line number Diff line change @@ -66,7 +66,10 @@ export async function expectCompletion(
66
66
}
67
67
const filteredResults = result . options . map ( ( item ) => ( {
68
68
detail : item . detail ,
69
- info : item . info ,
69
+ info :
70
+ typeof item . info === "function"
71
+ ? ( item . info ( item ) as HTMLElement ) . innerText
72
+ : item . info ,
70
73
label : item . label ,
71
74
type : item . type ,
72
75
apply : typeof item . apply === "string" ? item . apply : undefined ,
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ import {
30
30
} from "../utils/json-pointers" ;
31
31
import { MODES , TOKENS } from "../constants" ;
32
32
import { JSONMode } from "../types" ;
33
+ import { el } from "../utils/dom" ;
33
34
import { renderMarkdown } from "../utils/markdown" ;
34
35
import { DocumentParser , getDefaultParser } from "../parsers" ;
35
36
@@ -308,7 +309,10 @@ export class JSONCompletion {
308
309
) ,
309
310
type : "property" ,
310
311
detail : typeStr ,
311
- info : renderMarkdown ( description ) ,
312
+ info : ( ) =>
313
+ el ( "div" , {
314
+ inner : renderMarkdown ( description ) ,
315
+ } ) ,
312
316
} ;
313
317
collector . add ( this . applySnippetCompletion ( completion ) ) ;
314
318
}
You can’t perform that action at this time.
0 commit comments