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

Converting <u> tags to pandoc underline #287

Open
Triquetra opened this issue Feb 17, 2025 · 1 comment
Open

Converting <u> tags to pandoc underline #287

Triquetra opened this issue Feb 17, 2025 · 1 comment

Comments

@Triquetra
Copy link

Triquetra commented Feb 17, 2025

I have some markdown in obsidian that contains <u>text</u> html underline tags. When exporting to .docx format, these underlines seem to be ignored. I created a pandoc lua filter to converts these tags to pandoc underlines, and included the filter in my "extra arguments" field in enhancing exporter for the docx format with "--lua-filter=". Here's the code:

local function underline_filter (elem)
  if elem.tag == "u" then
    return pandoc.Underline(elem.content)
  end
end

return {
  { Inline = underline_filter },
}

Although this should work. It does not. I'm at a loss for next steps here. Does anyone have some idea about how to get the html underline tags to be converted to underlines in docx? What am I missing?

@rafjaf
Copy link

rafjaf commented Mar 8, 2025

In the same way, <i></i> tags do not get converted to italics in .docx

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