Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

bad error reporting for improper headers #17

Open
dherman opened this Issue · 1 comment

2 participants

@dherman

When an .md file has improperly indented headers it seems to crash the JS code and report an internal error. For example, running codex on a project with a file containing the following:

---
title: Home
---

Hello, world.

produces the error:

/Users/dherman/Sources/tc39-codex-wiki/node_modules/codex/node_modules/yaml/lib/yaml.js:179
  throw new Error(msg + ', ' + context(this.peek()[1].input))
        ^
Error: document not properly dedented, near "\n---"
    at Parser.expect (/Users/dherman/Sources/tc39-codex-wiki/node_modules/codex/node_modules/yaml/lib/yaml.js:179:9)
    at Parser.parseDoc (/Users/dherman/Sources/tc39-codex-wiki/node_modules/codex/node_modules/yaml/lib/yaml.js:266:8)
    at Parser.parse (/Users/dherman/Sources/tc39-codex-wiki/node_modules/codex/node_modules/yaml/lib/yaml.js:232:19)
    at Object.eval (/Users/dherman/Sources/tc39-codex-wiki/node_modules/codex/node_modules/yaml/lib/yaml.js:384:46)
    at /Users/dherman/Sources/tc39-codex-wiki/node_modules/codex/lib/codex/plugins/pages.js:33:26
    at Array.forEach (native)
    at /Users/dherman/Sources/tc39-codex-wiki/node_modules/codex/lib/codex/plugins/pages.js:16:13
    at /Users/dherman/Sources/tc39-codex-wiki/node_modules/codex/lib/codex/plugins/pages.js:79:29
    at /Users/dherman/Sources/tc39-codex-wiki/node_modules/codex/lib/codex/plugins/pages.js:79:29
    at Object.oncomplete (/Users/dherman/Sources/tc39-codex-wiki/node_modules/codex/lib/codex/plugins/pages.js:85:27)

Dave

@logicalparadox

This is the default yaml module error. Will surround it with a try/catch so it can report which markdown file it is referring to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.