-
Notifications
You must be signed in to change notification settings - Fork 12
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
chapters2documents.rb example raises an error #77
Comments
Thanks for your bug report. However, it's a bit sparse on the details. For me to look into your issue, I need to be able to reproduce your issue on my end. To that end, can you:
|
Sorry @htdebeer for the laconic and not helpful bug report. Hope this helps out to reproduce the issue and find the solution: Operaing System: Pandoc version: $ pandoc -v
pandoc 3.1.1
Features: +server +lua
Scripting engine: Lua 5.4
User data directory: /home/xbelanch/.pandoc
Copyright (C) 2006-2023 John MacFarlane. Web: https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose. I included a simple demo files that raises the error. Btw the full output: pandoc --from=markdown \
--to=html \
--filter=data-dir/filters/chapters2documents.rb
Pandoc responded with:
data-dir/filters/chapters2documents.rb:22:in `block in <main>': undefined method `parent' for nil:NilClass (NoMethodError)
from /home/xbelanch/.rvm/gems/ruby-3.0.0/gems/paru-1.1.0/lib/paru/filter.rb:291:in `instance_eval'
from /home/xbelanch/.rvm/gems/ruby-3.0.0/gems/paru-1.1.0/lib/paru/filter.rb:291:in `filter'
from /home/xbelanch/.rvm/gems/ruby-3.0.0/gems/paru-1.1.0/lib/paru/filter.rb:253:in `run'
from data-dir/filters/chapters2documents.rb:15:in `<main>'
Error running filter data-dir/filters/chapters2documents.rb:
Filter returned error status 1
Using configuration hierarchy: - /home/xbelanch/.rvm/gems/ruby-3.0.0/gems/pandocomatic-1.1.0/lib/pandocomatic/default_configuration.yaml - /home/xbelanch/Programming/playground/77/pandocomatic.yml 1 command to execute to convert '/home/xbelanch/Programming/playground/77/sandbox.md' to 'output/index.html'. pandoc --from=markdown \ --to=html \ --filter=data-dir/filters/chapters2documents.rb |
I can reproduce the issue. I think I've introduced this erroneous behavior when I added the before and after blocks feature in #38. I'll fix this, but that might take a week or so. Until then, as a workaround, only use ...
if @ran_before
doc << current_node if current_node.parent.is_a? Paru::PandocFilter::Document
end
... |
Can you verify that your issue is resolved with paru version 1.1.1? |
Works flawlessly! Thanks again! |
The text was updated successfully, but these errors were encountered: