Open apcamargo opened 2 weeks ago
Thanks for the suggestion although this will create discrepancies with other format.
I'll see what can be done.
By "other format" you mean everything that is not HTML? If that's the case, I don't see any problems in having discrepancies, as we don't expect all the formats to be 100% visually consistent. Having a modern-looking highlight in the HTML would just be an extra.
Just a quick update, I ended up implemented this locally. For now, I couldn't find any negative consequences.
Here's the modified highlight_html
function:
local function highlight_html(span, colour, bg_colour)
if span.attributes['style'] == nil then
span.attributes['style'] = ''
elseif span.attributes['style']:sub(-1) ~= ";" then
span.attributes['style'] = span.attributes['style'] .. ";"
end
if colour ~= nil then
span.attributes['colour'] = nil
span.attributes['color'] = nil
span.attributes['style'] = span.attributes['style'] .. 'color: ' .. colour .. ';'
end
if bg_colour ~= nil then
span.attributes['bg-colour'] = nil
span.attributes['bg-color'] = nil
span.attributes['style'] = span.attributes['style'] .. 'background-color: ' .. bg_colour ..
';border-radius: 3.5px;'
end
return span
end
Just a small suggestion to improve aesthetics. The highlight boxes could have a small radius in the corners, like this:
If subtle, this can improve the visuals. I found this snipped that can be useful (although I think the radius is way to big in the example).