def md2(s): s = s.replace('a', str(sage_eval('a', globals()))) md(s)
a = 10
%md2 This is a thing.
This is 10 thing.