Skip to content

My filter adds unwanted classes (bug in Pandoc?) #10179

Answered by alerque
pagiraud asked this question in Q&A
Discussion options

You must be logged in to vote

You are not actually initializing newClasses. You're re-assigning it by reference to classes, but when you mutate it after that the original table for classes gets updated.

$ lua
Lua 5.4.7  Copyright (C) 1994-2024 Lua.org, PUC-Rio
> D = require("pl.pretty").dump
> a = { "one" }
> b = a
> b[#b+1] = "two"
> D(a)
{
  "one",
  "two"
}

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@pagiraud
Comment options

@alerque
Comment options

Answer selected by pagiraud
@pagiraud
Comment options

@bpj
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants