Skip to content

Instantly share code, notes, and snippets.

@torque
Created October 29, 2012 15:16
Show Gist options
  • Save torque/3974121 to your computer and use it in GitHub Desktop.
Save torque/3974121 to your computer and use it in GitHub Desktop.
YEP
function HURR(sub,sel,act)
for x = 1,#sub do
local line = sub[x]
if line.class == "dialogue" then
if line.text:match("^{.-\\i1.-}") and line.text:match("{.-\\i0?.-}$") then
line.text = line.text:gsub("{\\i[01]?}","")
line.text = line.text:gsub("^({.-)\\i1(.-})","%1%2")
line.text = line.text:gsub("({.-)\\i0?(.-})$","%1%2")
line.style = line.style.." italic"
sub[x] = line
end
end
end
end
aegisub.register_macro("Strip Italics","HURR DURR", HURR)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment