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
99aaa `'json ["welcome!"]` bbb
1010asd `'md *i* **b** _u_ ~~s~~'` jkl
1111```
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 11{
22 "id" : " inline-code-highlight" ,
33 "name" : " InlineCodeHighlight" ,
4- "version" : " 1.0.0 " ,
4+ "version" : " 1.0.1 " ,
55 "minAppVersion" : " 0.15.0" ,
66 "description" : " Highlight inline `'md **code**` blocks as well as you do the ```md **big**``` ones" ,
77 "author" : " Dimava" ,
88 "authorUrl" : " https://github.com/dimava" ,
99 "isDesktopOnly" : false
10- }
10+ }
Original file line number Diff line number Diff line change 11{
22 "name" : " inline-code-highlight" ,
3- "version" : " 1.0.0 " ,
3+ "version" : " 1.0.1 " ,
44 "description" : " Highlight inline `'md **code**` blocks as well as you do the ```md **big**``` ones" ,
55 "main" : " main.js" ,
66 "scripts" : {
Original file line number Diff line number Diff line change 1- import { Plugin } from "obsidian" ;
1+ import { Plugin , loadPrism } from "obsidian" ;
22
33export default class InlineCodeHighlight extends Plugin {
44 async onload ( ) {
@@ -16,7 +16,7 @@ export default class InlineCodeHighlight extends Plugin {
1616
1717 cb . classList . add ( `lang-${ lang } ` , 'plugin-inline-code-highlight' ) ;
1818 cb . innerText = code ;
19- window . Prism ? .highlightElement ( cb ) ;
19+ loadPrism ( ) . then ( ( Prism : typeof window . Prism ) => Prism . highlightElement ( cb ) )
2020 }
2121 } ) ;
2222 }
Original file line number Diff line number Diff line change 11{
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