mirror of
https://github.com/mii443/obsidian-typst.git
synced 2025-08-22 16:15:34 +00:00
Fix: wrong paths generated for @local
/@preview
packages (#30)
This commit is contained in:
@ -201,7 +201,7 @@ impl SystemWorld {
|
||||
.js_request_data
|
||||
.call1(
|
||||
&JsValue::NULL,
|
||||
&format!("@{}/{}-{}", spec.namespace, spec.name, spec.version).into(),
|
||||
&format!("@{}/{}/{}", spec.namespace, spec.name, spec.version).into(),
|
||||
)
|
||||
.map_err(f)?
|
||||
.as_string()
|
||||
|
@ -185,12 +185,12 @@ export default class TypstPlugin extends Plugin {
|
||||
spec = spec.slice(1)
|
||||
let subdir = "/typst/packages/" + spec
|
||||
|
||||
let dir = normalizePath(this.getDataDir() + subdir)
|
||||
let dir = require('path').normalize(this.getDataDir() + subdir)
|
||||
if (this.fs.existsSync(dir)) {
|
||||
return dir
|
||||
}
|
||||
|
||||
dir = normalizePath(this.getCacheDir() + subdir)
|
||||
dir = require('path').normalize(this.getCacheDir() + subdir)
|
||||
|
||||
if (this.fs.existsSync(dir)) {
|
||||
return dir
|
||||
|
Reference in New Issue
Block a user