diff --git a/markup.py b/markup.py index 058530a..220ca34 100755 --- a/markup.py +++ b/markup.py @@ -246,6 +246,11 @@ def macro_round(ctx: MarkupContext, n: str, digits: Optional[str] = None) -> str return str(res) +def macro_cat(ctx: MarkupContext, *text: str) -> str: + "Concatenates all arguments." + return ''.join(text) + + @functools.cache def default_context(): c = MarkupContext() @@ -253,6 +258,8 @@ def default_context(): c.register_macro("choose", macro_choose) c.register_macro("round", macro_round) + c.register_macro("cat", macro_cat) + return c