diff --git a/code-parser.ts b/code-parser.ts index c17c06e..5124960 100644 --- a/code-parser.ts +++ b/code-parser.ts @@ -31,7 +31,7 @@ export class IpynbParser implements CodeParser { } let keep_cells: number[] = []; - if (args) { + if (args.length > 0) { const regex = /^(\d+)(,\d+)*$/; if (regex.test(args)) { keep_cells = args.split(",").map(value => parseInt(value)); diff --git a/main.ts b/main.ts index d294328..88523d4 100644 --- a/main.ts +++ b/main.ts @@ -83,7 +83,7 @@ export default class EmbedCodeFile extends Plugin { srcLinesNum = analyseSrcLines(srcLinesNumString) } - let args: string = null + let args: string = ""; if (metaYaml.ARGS) { args = metaYaml.ARGS.toString() } diff --git a/manifest.json b/manifest.json index 42ecd0e..5b0568f 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "embed-code-file-ipynb-as-python", "name": "Embed Code File with Jupyter Notebook Support", - "version": "1.1.2", + "version": "1.1.3", "minAppVersion": "0.15.0", "description": "This is a plugin for Obsidian that allows for embedding code files.", "author": "Obsidian",