Skip to content

Commit

Permalink
more resilient parsing of notebook frontmatters
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Jun 14, 2024
1 parent 2e5d576 commit f581ea3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/vscode/src/docsnotebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,9 @@ function activateNotebookExecutor(state: ExtensionState) {
await state.parseWorkspace()
const project = state.project

// frontmatter
const firstCell = notebook.cellAt(0)
const { genaiscript: frontmatter = {} } =
(firstCell.document.languageId === "yaml" &&
YAMLTryParse(firstCell.document.getText())) ||
{}
frontmatterTryParse(firstCell?.document?.getText())?.value || {}
const {
model,
files,
Expand Down

0 comments on commit f581ea3

Please sign in to comment.