Closed bhelsel closed 1 month ago
Thanks, I need to check because unless I dreamt it, it was working.
See https://github.com/mcanouil/quarto-highlight-text/blob/main/example.qmd which uses all formats.
The CI rendered PowerPoint does indeed not have the white coloured font when background is coloured as well.
Thanks for the report!
Since I am not an expert in OpenXML and that there is nothing consistent between Word and PowerPoint, I am not sure when I'll be willing to take another shot at this. (It's quite laborious/tedious to work on Microsoft files).
Thanks for checking! It took me a while to diagnose it, but the solution I came up with to solve it was simple after I explored the XML of the PowerPoint. Within your lua filter, I switched the order of the following code in the highlight_openxml_pptx
(lines 90-95).
Instead of bg_colour and then colour as in your code above, add the colour first and then the bg_colour second. I haven't tested it within Microsoft Word, so I can only verify that it worked for me with PowerPoint.
if colour ~= nil then
spec = spec .. '<a:solidFill><a:srgbClr val="' .. colour:gsub("^#", "") .. '" /></a:solidFill>'
end
if bg_colour ~= nil then
spec = spec .. '<a:highlight><a:srgbClr val="' .. bg_colour:gsub("^#", "") .. '" /></a:highlight>'
end
Thanks that is helpful!
No worries, the OpenXML code in Microsoft Word is 100% different for some reasons ...
@bhelsel Thanks for the helpful insight on the order of the two elements. It's now fixed and available in the 1.0.0 release the extension.
Hi Mickaël,
Thanks for making a great Quarto extension! I see the highlight text feature as valuable as I just came across needing to use it in my PowerPoint (pptx) presentation. I was experimenting with your lua filter and noticed that it wasn't picking up both the bg_colour and colour attributes when both were specified. It would do the bg_colour but did not add the colour attribute. I explored the code within the lua filter and noticed that switching the order of the bg_colour and colour in the
highlight_openxml_pptx
function solved it for me. It looks like the colour attribute may be specified first in the PowerPoint pptx XML files.https://github.com/mcanouil/quarto-highlight-text/blob/07bc13e2487085075e909bb36d6a8adfe7e8ffef/_extensions/highlight-text/highlight-text.lua#L90-L95