Skip to content

[Bug] Frontmatter: endings with '...' fails to be parsed #107

Description

@GuillaumeHM

What version of Cosma are you using?

v 2.4.0
node: 18.19.0

On which operating system(s) did you observe the bug?

  • macOS
  • Windows
  • Linux

What version of the operating system are you on?

Debian Bookworm

Actions leading to the bug

When ending the Frontmatter by three dots like specified in the Zettlr's doc (https://docs.zettlr.com/fr/core/yaml-frontmatter/), modelizing with Cosma ends in a crash.

Bug description

$ cosma modelize
[Cosma v.2.4.0]  /home/***/Documents/cosma-test/config.yml
Building cosmoscope… (source type: directory)
../***/20240316224025.md could not have its frontmatter parsed.
/usr/local/lib/node_modules/@graphlab-fr/cosma/core/models/cosmoscope.js:148
      throw new SyntaxError('YAML parse error on ' + filePath);
            ^

SyntaxError: YAML parse error on ../***/20240316224025.md
    at Cosmoscope.getDataFromYamlFrontMatter (/usr/local/lib/node_modules/@graphlab-fr/cosma/core/models/cosmoscope.js:148:13)
    at /usr/local/lib/node_modules/@graphlab-fr/cosma/core/models/cosmoscope.js:120:33
    at Array.map (<anonymous>)
    at Cosmoscope.getFromPathFiles (/usr/local/lib/node_modules/@graphlab-fr/cosma/core/models/cosmoscope.js:116:8)
    at module.exports (/usr/local/lib/node_modules/@graphlab-fr/cosma/controllers/modelize.js:85:32)
    at Command.<anonymous> (/usr/local/lib/node_modules/@graphlab-fr/cosma/app.js:102:38)
    at Command.listener [as _actionHandler] (/usr/local/lib/node_modules/@graphlab-fr/cosma/node_modules/commander/lib/command.js:488:17)
    at /usr/local/lib/node_modules/@graphlab-fr/cosma/node_modules/commander/lib/command.js:1227:65
    at Command._chainOrCall (/usr/local/lib/node_modules/@graphlab-fr/cosma/node_modules/commander/lib/command.js:1144:12)
    at Command._parseCommand (/usr/local/lib/node_modules/@graphlab-fr/cosma/node_modules/commander/lib/command.js:1227:27)

Node.js v18.19.0

Additional information

When replacing the three dots by '---', it works.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions