Skip to content

pypandoc ignores lua filters #367

Open
@knauthe

Description

@knauthe

I'm using pypandoc to use pandoc in python to convert html to markdown
I'm trying to make pypandoc apply lua filters. But non of the filters are applied. I put checkpoints at every function head and none of them are visited, so the filters aren't even called, even though pypandoc registers them.
I know that pypandoc registers the filters, because when I put some syntax error into one of my lua scripts, it is specifically my pypandoc call that throws an error, specifically referencing that lua script.

Here is my pypandoc call:


filters = ["lua/" + f for f in os.listdir("lua")]
md = pypandoc.convert_file(source_file=sourcepath, format='html', to='gfm-raw_html', filters = filters)

Here are some of my filters:

lua/Nav.lua:


function Nav(el)
	return {}
end

lua/Img.lua:


function Img(el)
	if el.attributes.alt == "question_mark" then
		return ' "?" '
	else
		return {}
	end
end

What I tried: Using lua filters in pypandoc.

Expected behavior: The filters get applied.

Actual behavior: The filters are ignored. Pypandoc converts files without applying any filters. No errors are thrown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions