Skip to content

Non-string frontmatter title/type/slug mis-types pages on import #1948

@100menotu001

Description

@100menotu001

Summary

parseMarkdown (src/core/markdown.ts) and importFromContent (src/core/import-file.ts) assume frontmatter title, type, and slug are strings and cast them with as string. When a page carries a non-string frontmatter value — e.g. a numeric title from a structured JSON import — the unchecked cast lets the wrong type flow into page typing and the content-sanity title check.

Expected

Non-string frontmatter values are coerced to a string (or ignored in favor of the path-derived inference) rather than propagated as the wrong type.

Fix

Defensive coercion in both functions. PR incoming.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions