Skip to content
Discussion options

You must be logged in to vote

The filter you have listed above works fine for me and replaces the custom attributes with classes when running pandoc -f docx+styles .\entrada.docx -L .\filter2.lua -o salida.epub using the DOCX you have attached and the filter you have listed above:

function Div(el)
  local estilo = el.attr.attributes and el.attr.attributes["custom-style"]
  if estilo then
    local clase = estilo:lower():gsub(" ", "-")
    return pandoc.Div(el.content, pandoc.Attr("", { clase }))
  end
  return el
end

In the zip archive you have attached, the filter doesn't work because it uses data-custom-style instead of custom-style, as I have pointed out in my comment above.

I don't think I can do anything else to …

Replies: 5 comments 11 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@rnwst
Comment options

Comment options

You must be logged in to vote
1 reply
@rnwst
Comment options

Comment options

You must be logged in to vote
3 replies
@rnwst
Comment options

@Gogmoth
Comment options

@rnwst
Comment options

Comment options

You must be logged in to vote
6 replies
@denismaier
Comment options

@rnwst
Comment options

@Gogmoth
Comment options

@rnwst
Comment options

Answer selected by Gogmoth
@Gogmoth
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants