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

One-line examples with a judgement are unprocessible when producing an HTML file #3

Closed
CLRafaelR opened this issue Feb 8, 2021 · 2 comments

Comments

@CLRafaelR
Copy link
Contributor

I am trying to produce an HTML file which contains one-line examples with a judgement. If I correctly understand, the following markdown syntax will work:

::: ex
^* This traditionally signals ungrammaticality.
:::

However, pandoc throws an error on lua when processing the markdown file, as follows:

Error running filter configuration/pandoc-ling/pandoc-ling.lua:
configuration/pandoc-ling/pandoc-ling.lua:607: attempt to index a nil value (field '?')
stack traceback:
	configuration/pandoc-ling/pandoc-ling.lua:607: in function 'pandocMakeSingle'
	configuration/pandoc-ling/pandoc-ling.lua:527: in function 'pandocMakeExample'
	configuration/pandoc-ling/pandoc-ling.lua:256: in function 'processDiv'
Error: pandoc document conversion failed with error 83

The problem looks similar to the issue on the following link, but I cannot work around by myself since I am not familiar with lua...
https://stackoverflow.com/q/12153537/10215301

What am I missing...?

MWE

Here I put an Rmarkdown example with its subsidiary R packages, bookdown. The contents are exactly same as pandoc's markdown, except what I wrote in YAML section.

---
author: Masataka OGAWA
title: Using pandoc-ling for HTML

output: 
  bookdown::html_document2:
    pandoc_args:
      - --lua-filter=configuration/pandoc-ling/pandoc-ling.lua

  ## No problem with pdf-producing
  bookdown::pdf_document2:
    pandoc_args:
      - --lua-filter=configuration/pandoc-ling/pandoc-ling.lua
---

These two examples throw an error when I produce an HTML file:

```
Error running filter configuration/pandoc-ling/pandoc-ling.lua:
configuration/pandoc-ling/pandoc-ling.lua:607: attempt to index a nil value (field '?')
stack traceback:
	configuration/pandoc-ling/pandoc-ling.lua:607: in function 'pandocMakeSingle'
	configuration/pandoc-ling/pandoc-ling.lua:527: in function 'pandocMakeExample'
	configuration/pandoc-ling/pandoc-ling.lua:256: in function 'processDiv'
Error: pandoc document conversion failed with error 83
```

::: ex
^* This traditionally signals ungrammaticality.
:::

::: ex
a. ^* This traditionally signals ungrammaticality.
:::

<!-- 

This commented-out example works fine.

::: ex

a. ^* This traditionally signals ungrammaticality.
d. However, such long sequences sometimes lead to undesirable effects in the layout.

:::

-->    

Note but that I can produce a PDF file without any problem with the Rmd file above, as shown in the following screen capture.

image

Environment

Environment
pandoc-ling: v1.4
pandoc: v2.11.4
OS: Windows 10 x64 (build 19042)

@cysouw
Copy link
Owner

cysouw commented Feb 8, 2021

You found a bug! It's fixed now in the master branch, so please download it from there. The next release will come later.

@CLRafaelR
Copy link
Contributor Author

I always appreciate your quick response and now I confirm that I can get the desirable HTML!
Thank you so much and I close this issue!

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