File tree Expand file tree Collapse file tree 5 files changed +8
-11
lines changed Expand file tree Collapse file tree 5 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,3 @@ foo `'ts const x: number = 123;` bar
9
9
aaa `'json ["welcome!"]` bbb
10
10
asd `'md *i* **b** _u_ ~~s~~'` jkl
11
11
```
12
-
13
- #### Note
14
- Highlighting uses the builtin Prism.
15
- I don't know how to import it yet, so it'll work only after you've opened a page with a code block that Obsidian highlights itself
Original file line number Diff line number Diff line change 1
1
{
2
2
"id" : " inline-code-highlight" ,
3
3
"name" : " InlineCodeHighlight" ,
4
- "version" : " 1.0.0 " ,
4
+ "version" : " 1.0.1 " ,
5
5
"minAppVersion" : " 0.15.0" ,
6
6
"description" : " Highlight inline `'md **code**` blocks as well as you do the ```md **big**``` ones" ,
7
7
"author" : " Dimava" ,
8
8
"authorUrl" : " https://github.com/dimava" ,
9
9
"isDesktopOnly" : false
10
- }
10
+ }
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " inline-code-highlight" ,
3
- "version" : " 1.0.0 " ,
3
+ "version" : " 1.0.1 " ,
4
4
"description" : " Highlight inline `'md **code**` blocks as well as you do the ```md **big**``` ones" ,
5
5
"main" : " main.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change 1
- import { Plugin } from "obsidian" ;
1
+ import { Plugin , loadPrism } from "obsidian" ;
2
2
3
3
export default class InlineCodeHighlight extends Plugin {
4
4
async onload ( ) {
@@ -16,7 +16,7 @@ export default class InlineCodeHighlight extends Plugin {
16
16
17
17
cb . classList . add ( `lang-${ lang } ` , 'plugin-inline-code-highlight' ) ;
18
18
cb . innerText = code ;
19
- window . Prism ? .highlightElement ( cb ) ;
19
+ loadPrism ( ) . then ( ( Prism : typeof window . Prism ) => Prism . highlightElement ( cb ) )
20
20
}
21
21
} ) ;
22
22
}
Original file line number Diff line number Diff line change 1
1
{
2
- "1.0.0" : " 0.15.0"
3
- }
2
+ "1.0.0" : " 0.15.0" ,
3
+ "1.0.1" : " 0.15.0"
4
+ }
You can’t perform that action at this time.
0 commit comments