aboutsummaryrefslogtreecommitdiffstats
path: root/macros/garret.restyler.lua
diff options
context:
space:
mode:
authorgarret <garret@airmail.cc>2022-06-17 23:19:31 +0100
committergarret <garret@airmail.cc>2022-06-17 23:19:31 +0100
commit36f2d72731191f49743b59aac0d90aeb15630a52 (patch)
tree15161cb0dc9cd2a40569c24d1ae6c9b62061e776 /macros/garret.restyler.lua
parenta9cd2df73f08fd8373d45cdb8dbdb63f5039c59e (diff)
downloadaegisub-scripts-36f2d72731191f49743b59aac0d90aeb15630a52.tar.gz
aegisub-scripts-36f2d72731191f49743b59aac0d90aeb15630a52.tar.bz2
aegisub-scripts-36f2d72731191f49743b59aac0d90aeb15630a52.zip
fix the fix that i did not check
oops
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