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

Fix support for the "All Blocks Test" Page #67

Closed
sHermanGriffiths opened this issue Aug 31, 2022 · 2 comments
Closed

Fix support for the "All Blocks Test" Page #67

sHermanGriffiths opened this issue Aug 31, 2022 · 2 comments

Comments

@sHermanGriffiths
Copy link
Contributor

sHermanGriffiths commented Aug 31, 2022

Pandoc throws an error when parsing this page, which holds an example of each block. The error code is displayed below, nail down its source and correct it.

2022-08-31 13:41:59,826 - ERROR: Pandoc couldn't parse the generated AST. This is likely due to a bug in n2y or a plugin: JSON parse error: Error in $.blocks[1][0][0]: parsing Text failed, expected String, but encountered Null

Traceback (most recent call last):
  File "/Users/dcd/Coding/Innolitics/n2y/venv/lib/python3.9/site-packages/n2y/utils.py", line 74, in pandoc_write_or_log_errors
    return pandoc.write(pandoc_ast, format=format, options=options)
  File "/Users/dcd/Coding/Innolitics/n2y/venv/lib/python3.9/site-packages/pandoc/__init__.py", line 337, in write
    pandoc(options)
  File "/Users/dcd/Coding/Innolitics/n2y/venv/lib/python3.9/site-packages/plumbum/commands/base.py", line 99, in __call__
    return self.run(args, **kwargs)[1]
  File "/Users/dcd/Coding/Innolitics/n2y/venv/lib/python3.9/site-packages/plumbum/commands/base.py", line 240, in run
    return p.run()
  File "/Users/dcd/Coding/Innolitics/n2y/venv/lib/python3.9/site-packages/plumbum/commands/base.py", line 201, in runner
    return run_proc(p, retcode, timeout)
  File "/Users/dcd/Coding/Innolitics/n2y/venv/lib/python3.9/site-packages/plumbum/commands/processes.py", line 322, in run_proc
    return _check_process(proc, retcode, timeout, stdout, stderr)
  File "/Users/dcd/Coding/Innolitics/n2y/venv/lib/python3.9/site-packages/plumbum/commands/processes.py", line 24, in _check_process
    proc.verify(retcode, timeout, stdout, stderr)
  File "/Users/dcd/Coding/Innolitics/n2y/venv/lib/python3.9/site-packages/plumbum/machines/base.py", line 28, in verify
    raise ProcessExecutionError(
plumbum.commands.processes.ProcessExecutionError: Unexpected exit code: 64
Command line: | /usr/local/bin/pandoc -t gfm+tex_math_dollars+raw_attribute -o /var/folders/g7/jkmzx_3n753c2sdkz350pt1c0000gn/T/tmprj44d4zm/output --wrap none --eol lf -f json /var/folders/g7/jkmzx_3n753c2sdkz350pt1c0000gn/T/tmprj44d4zm/input.js
Stderr:       | JSON parse error: Error in $.blocks[1][0][0]: parsing Text failed, expected String, but encountered Null

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/dcd/Coding/Innolitics/n2y/venv/bin/n2y", line 8, in <module>
    sys.exit(cli_main())
  File "/Users/dcd/Coding/Innolitics/n2y/venv/lib/python3.9/site-packages/n2y/main.py", line 19, in cli_main
    sys.exit(main(args, access_token))
  File "/Users/dcd/Coding/Innolitics/n2y/venv/lib/python3.9/site-packages/n2y/main.py", line 151, in main
    print(node.to_markdown())
  File "/Users/dcd/Coding/Innolitics/n2y/venv/lib/python3.9/site-packages/n2y/page.py", line 111, in to_markdown
    self.content_to_markdown() or '',
  File "/Users/dcd/Coding/Innolitics/n2y/venv/lib/python3.9/site-packages/n2y/page.py", line 100, in content_to_markdown
    return pandoc_ast_to_markdown(pandoc_ast)
  File "/Users/dcd/Coding/Innolitics/n2y/venv/lib/python3.9/site-packages/n2y/utils.py", line 53, in pandoc_ast_to_markdown
    return pandoc_write_or_log_errors(
  File "/Users/dcd/Coding/Innolitics/n2y/venv/lib/python3.9/site-packages/n2y/utils.py", line 88, in pandoc_write_or_log_errors
    raise PandocASTParseError(msg)
n2y.errors.PandocASTParseError: Pandoc couldn't parse the generated AST. This is likely due to a bug in n2y or a plugin: JSON parse error: Error in $.blocks[1][0][0]: parsing Text failed, expected String, but encountered Null
@johndgiese
Copy link
Contributor

@sHermanGriffiths can you confirm that this error occurred prior to your most recent changes?

@sHermanGriffiths
Copy link
Contributor Author

sHermanGriffiths commented Aug 31, 2022

Yes, that is true. This error was present when I ran the program using this version.

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

No branches or pull requests

2 participants