@@ -687,9 +687,19 @@ local plainrdr = getBaseRenderers(tagproc.toTXT, span_renderers) local htmlSpan = getBaseRenderers(procs, span_renderers).htmlSpan function span_renderers.format(sp,...) - local tags = { strong = 'strong', emph = 'em', strike = 'del', insert = 'ins', literal = 'code', variable = 'var'} + local tags = { + strong = 'strong'; + emph = 'em'; + strike = 'del'; + insert = 'ins'; + literal = 'code'; + variable = 'var'; + super = 'sup'; + sub = 'sub'; + underline = 'u'; + } if sp.style == 'literal' and not opts['fossil-uv'] then addStyle 'code' elseif sp.style == 'strike' or sp.style == 'insert' then addStyle 'editors_markup' @@ -767,9 +777,17 @@ b.origin:fail('%s is an object, not a reference', r.id) end local mctx = b.origin:clone() mctx.invocation = m - return htmlSpan(ct.parse_span(r, mctx),b,s) + local ir = ct.parse_span(r, mctx) + -- even though this happens at render time, it really shouldn't; + -- we pretend this is happening as part of the document job + local j = b.origin.doc.docjob + for fn, ext, state in j:each('hook', 'doc_macro_expand_span') do + local r = fn(j:delegate(ext), ir, b) + if r then ir = r end + end + return htmlSpan(ir, b, s) end function span_renderers.math(m,b,s) addStyle 'math' local spans = {}