Skip to content

Commit

Permalink
Do not prefer SVG when the output is ODT or docx
Browse files Browse the repository at this point in the history
Closes: #27
  • Loading branch information
tarleb committed Aug 14, 2024
1 parent 1d9aa2c commit de7151b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions _extensions/diagram/diagram.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ elseif PANDOC_VERSION < '3.1.4' then
warn '@on'
end

local io = require 'io'
local pandoc = require 'pandoc'
local system = require 'pandoc.system'
local utils = require 'pandoc.utils'
local stringify = utils.stringify
Expand Down Expand Up @@ -248,8 +250,8 @@ local default_engines = {
local function format_options (name)
local pdf2svg = name ~= 'latex' and name ~= 'context'
local preferred_mime_types = pandoc.List{'application/pdf', 'image/png'}
-- Prefer SVG for non-PDF output formats
if pdf2svg then
-- Prefer SVG for non-PDF output formats, except for Office formats
if pdf2svg and name ~= 'docx' and name ~= 'odt' then
preferred_mime_types:insert(1, 'image/svg+xml')
end
return {
Expand Down

0 comments on commit de7151b

Please sign in to comment.