-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Internal links don't work on ODT writer #4358
Labels
Comments
Here goes the code of my Lua filter, if it helps. local function getBookmarkById(id)
local bookmarkStart = '<text:bookmark-start text:name=\"' .. id .. '\"/>'
local bookmarkEnd = '<text:bookmark-end text:name=\"' .. id .. '\"/>'
return bookmarkStart, bookmarkEnd
end
local function putMarksOnContent(textContent, id)
local markStart, markEnd = getBookmarkById(id)
local newContent = {}
table.insert(newContent, pandoc.RawInline("opendocument", markStart))
for i,el in pairs(textContent) do
table.insert(newContent, el)
end
table.insert(newContent, pandoc.RawInline("opendocument", markEnd))
return newContent
end
function Header (hx)
if FORMAT == 'odt' then
hx.content = putMarksOnContent(hx.content, hx.attr.identifier)
end
return hx
end |
I've added a repository with some lua filters that workaround problems in ODT writer. Internal links are treated by |
Any points here? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I convert from markdown to ODT all the internal links (to headings) get broken. Example: using the following markdown file (named
test.md
):And the command below (pandoc 2.1.1):
Gives me an ODT file without the internal link. Looking inside the file, in
content.xml
, I found this:Pandoc is not creating the anchor on the Heading, so any link points to nothing. The correct link would be something like this:
To temporarily address this, I've written a Lua filter, that corrects the links using
RawInline
elements with formatopendocument
(as suggested by @jgm in this discussion ). But I think internal links are a common feature that needs to work in ODT "natively", without filters.I've searched in pandoc-discuss and the issues, but it seems that there isn't much discussion about this.
The text was updated successfully, but these errors were encountered: