Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pandocomatic fails on file with a "date" field in the YAML metadata #100

Closed
htdebeer opened this issue Jan 5, 2022 · 1 comment
Closed
Assignees
Labels

Comments

@htdebeer
Copy link
Owner

htdebeer commented Jan 5, 2022

Given the input file date-error.md, when I run pandocomatic date-error.md I get the following error message:

An unexpected error has occurred. You can report this bug via https://github.com/htdebeer/pandocomatic/issues/new.
/home/huub/.rvm/gems/ruby-3.0.0/gems/psych-4.0.3/lib/psych/class_loader.rb:99:in `find': Tried to load unspecified class: Date (Psych::DisallowedClass)
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/psych-4.0.3/lib/psych/class_loader.rb:28:in `load'
        from (eval):2:in `date'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/psych-4.0.3/lib/psych/scalar_scanner.rb:59:in `tokenize'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/psych-4.0.3/lib/psych/visitors/to_ruby.rb:65:in `deserialize'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/psych-4.0.3/lib/psych/visitors/to_ruby.rb:128:in `visit_Psych_Nodes_Scalar'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/psych-4.0.3/lib/psych/visitors/visitor.rb:30:in `visit'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/psych-4.0.3/lib/psych/visitors/visitor.rb:6:in `accept'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/psych-4.0.3/lib/psych/visitors/to_ruby.rb:35:in `accept'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/psych-4.0.3/lib/psych/visitors/to_ruby.rb:345:in `block in revive_hash'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/psych-4.0.3/lib/psych/visitors/to_ruby.rb:343:in `each'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/psych-4.0.3/lib/psych/visitors/to_ruby.rb:343:in `each_slice'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/psych-4.0.3/lib/psych/visitors/to_ruby.rb:343:in `revive_hash'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/psych-4.0.3/lib/psych/visitors/to_ruby.rb:167:in `visit_Psych_Nodes_Mapping'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/psych-4.0.3/lib/psych/visitors/visitor.rb:30:in `visit'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/psych-4.0.3/lib/psych/visitors/visitor.rb:6:in `accept'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/psych-4.0.3/lib/psych/visitors/to_ruby.rb:35:in `accept'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/psych-4.0.3/lib/psych/visitors/to_ruby.rb:318:in `visit_Psych_Nodes_Document'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/psych-4.0.3/lib/psych/visitors/visitor.rb:30:in `visit'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/psych-4.0.3/lib/psych/visitors/visitor.rb:6:in `accept'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/psych-4.0.3/lib/psych/visitors/to_ruby.rb:35:in `accept'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/psych-4.0.3/lib/psych.rb:335:in `safe_load'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/psych-4.0.3/lib/psych.rb:370:in `load'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/pandocomatic-0.2.8/lib/pandocomatic/pandoc_metadata.rb:190:in `block in extract_metadata'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/pandocomatic-0.2.8/lib/pandocomatic/pandoc_metadata.rb:190:in `map'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/pandocomatic-0.2.8/lib/pandocomatic/pandoc_metadata.rb:190:in `extract_metadata'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/pandocomatic-0.2.8/lib/pandocomatic/pandoc_metadata.rb:60:in `load'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/pandocomatic-0.2.8/lib/pandocomatic/pandoc_metadata.rb:50:in `load_file'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/pandocomatic-0.2.8/lib/pandocomatic/command/convert_file_multiple_command.rb:50:in `initialize'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/pandocomatic-0.2.8/lib/pandocomatic/pandocomatic.rb:85:in `new'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/pandocomatic-0.2.8/lib/pandocomatic/pandocomatic.rb:85:in `run'
        from /home/huub/.rvm/gems/ruby-3.0.0/gems/pandocomatic-0.2.8/bin/pandocomatic:3:in `<top (required)>'
        from /home/huub/.rvm/gems/ruby-3.0.0/bin/pandocomatic:23:in `load'
        from /home/huub/.rvm/gems/ruby-3.0.0/bin/pandocomatic:23:in `<main>'
@htdebeer htdebeer added the bug label Jan 5, 2022
@htdebeer htdebeer self-assigned this Jan 5, 2022
@htdebeer
Copy link
Owner Author

htdebeer commented Jan 5, 2022

As a workaround, write the date as a string rather than a date. Thus:

date: '2022-01-05'

rather than:

date: 2022-01-05

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant