aboutsummaryrefslogtreecommitdiffstats
path: root/macros/garret.restyler.lua
diff options
context:
space:
mode:
Diffstat (limited to 'macros/garret.restyler.lua')
-rw-r--r--macros/garret.restyler.lua10
1 files changed, 3 insertions, 7 deletions
diff --git a/macros/garret.restyler.lua b/macros/garret.restyler.lua
index 043ee1e..8620f70 100644
--- a/macros/garret.restyler.lua
+++ b/macros/garret.restyler.lua
@@ -5,14 +5,10 @@ script_version = "2.1.0"
script_namespace = "garret.restyler"
local haveDepCtrl, DependencyControl, depctrl = pcall(require, "l0.DependencyControl")
-local karaskel, cleantags
if haveDepCtrl then
depctrl = DependencyControl {
--feed="TODO",
- {"karaskel", "cleantags"}
}
- kara, clean = depctrl:requireModules()
-else
include("karaskel.lua")
include("cleantags.lua")
end
@@ -49,15 +45,15 @@ end
function main(sub, sel)
local _, styles = karaskel.collect_head(sub, false)
- local config.new_style = "Default"
- local new_style = styles[config.new_style]
+ local new_style_name = "Default"
+ local new_style = styles[new_style_name]
for h, i in ipairs(sel) do
-- TODO: automatically exclude styles (also configurable)
local line = sub[i]
local old_style = styles[line.style] -- reinventing the wheel a bit here, since karaskel can do this with preproc_line_size (line.styleref), but it also adds loads of other crap we don't care about for the same functionality in the end, so ¯\_(ツ)_/¯
local italic = get_new(old_style.italic, new_style.italic)
local align = get_new(old_style.align, new_style.align)
- line.style = config.new_style
+ line.style = new_style_name
line.text = add_tags(line.text, italic, align)
sub[i] = line
end