pandoc crashes if I try to replace an image
See original GitHub issueI’m writing a filter for pandoc, but if I try to remove images I get an error. Here’s a minimal filter:
from pandocfilters import toJSONFilter, RawBlock
def filter(key, value, format, meta):
if key == 'Image':
return RawBlock('html', 'ok')
if __name__ == "__main__":
toJSONFilter(filter)
Here’s the error:
pandoc: Error in $.blocks[17].c[0]: failed to parse field blocks: failed to parse field c: mempty
CallStack (from HasCallStack):
error, called at pandoc.hs:144:42 in main:Main
I call pandoc without any extra options, just --filter my_filter.py
and -o output.html
.
Version:
pandoc 1.19.2.1
Compiled with pandoc-types 1.17.0.4, texmath 0.9, skylighting 0.1.1.4
on Windows 10 x64
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Releases - Pandoc
Prevent crashing when handling invalid tables (Albert Krewinkel, #8102). Tables with different numbers of cells per row would sometimes crash pandoc. This fix ......
Read more >Image file path error while using pandoc for markdown to pdf ...
I just tried it with the MRE being just a line specifying the image. When the image was in the current working directory,...
Read more >15 Common Problems with rmarkdown (and some solutions)
To avoid problems in the first place, I try and do the following: Develop code in chunks and execute the chunks until they...
Read more >Document crashing LibreOffice Writer since upgrade to 7.2.0.4
What we are trying to do here is to either confirm the problem is with the program or the document. You could try...
Read more >Chapter 20 Make it fancier | rstudio4edu - GitHub Pages
You'll get the most out of this chapter if you read through the CSS crash course ... Insert the following, replacing favicon.ico with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh, the problem is that you use RawBlock instead of RawInline. An image is an Inline. Sorry, this library doesn’t have very good error reporting. You might try panflute instead!
I solved by replacing the containing Para. Thanks for the help and the library!