File tree 1 file changed +2
-3
lines changed
packages/foam-vscode/src/features/preview
1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 1
1
/*global markdownit:readonly*/
2
2
3
3
// eslint-disable-next-line no-restricted-imports
4
- import { readFileSync } from 'fs' ;
5
4
import { workspace as vsWorkspace } from 'vscode' ;
6
5
import markdownItRegex from 'markdown-it-regex' ;
7
6
import { isSome , isNone } from '../../utils' ;
@@ -177,7 +176,7 @@ function fullExtractor(
177
176
parser : ResourceParser ,
178
177
workspace : FoamWorkspace
179
178
) : string {
180
- let noteText = readFileSync ( note . uri . toFsPath ( ) ) . toString ( ) ;
179
+ let noteText = vsWorkspace . fs . readFile ( toVsCodeUri ( note . uri ) ) . toString ( ) ;
181
180
const section = Resource . findSection ( note , note . uri . fragment ) ;
182
181
if ( isSome ( section ) ) {
183
182
const rows = noteText . split ( '\n' ) ;
@@ -194,7 +193,7 @@ function contentExtractor(
194
193
parser : ResourceParser ,
195
194
workspace : FoamWorkspace
196
195
) : string {
197
- let noteText = readFileSync ( note . uri . toFsPath ( ) ) . toString ( ) ;
196
+ let noteText = vsWorkspace . fs . readFile ( toVsCodeUri ( note . uri ) ) . toString ( ) ;
198
197
let section = Resource . findSection ( note , note . uri . fragment ) ;
199
198
if ( ! note . uri . fragment ) {
200
199
// if there's no fragment(section), the wikilink is linking to the entire note,
You can’t perform that action at this time.
0 commit comments