diff --git a/src/formatitko/transform_processor.py b/src/formatitko/transform_processor.py index 5451fc7..ac5def9 100644 --- a/src/formatitko/transform_processor.py +++ b/src/formatitko/transform_processor.py @@ -228,12 +228,12 @@ class TransformProcessor(NOPProcessor): importedDoc = import_md(open(filename, "r").read()) self.transform(importedDoc.content) elif e.attributes["type"] == "module": - matches = re.match(r"^(\w+)(?: as (\w+))?$", e.content[0].text[1:]) + matches = re.match(r"^([\w\.]+)(?: as (\w+))?$", e.content[0].text[1:]) if not matches: raise SyntaxError(f"`{e.content[0].text[1:]}`: invalid syntax") module = importlib.import_module(matches.group(1)) module_name = matches.group(1) if matches.group(2) is None else matches.group(2) - self.context.add_commands_from_module(module, module_name) + self.context.add_commands_from_module(module, "") elif e.attributes["type"] == "metadata": filename = self.context.dir + "/" + e.content[0].text[1:] self.context.add_dep(filename)