diff --git a/CHANGELOG.md b/CHANGELOG.md index a65740e..4039c43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ Versions and bullets are arranged chronologically from latest to oldest. +## v1.0.2 + +- Do not replace slash(`/`) in lua modules. + ## v1.0.1 - Fix "TypeError: upgrade_dependencies() got an unexpected keyword argument" diff --git a/setup.py b/setup.py index 1478205..e260502 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="legunto", - version="1.0.1", + version="1.0.2", description="Fetch MediaWiki Scribunto modules from wikis", long_description=long_description, long_description_content_type="text/markdown", diff --git a/src/scribunto/__init__.py b/src/scribunto/__init__.py index 5519cfc..8bb7753 100644 --- a/src/scribunto/__init__.py +++ b/src/scribunto/__init__.py @@ -17,13 +17,6 @@ def search_dependencies(text: str, prefix=None) -> List[str]: def rewrite_requires(text: str, prefix: str) -> str: - # Module:foo/bar -> Module:foo-bar - regex = r'''(?:require|mw\.loadData)\s*\(\s*['"](?:[Mm]odule|모듈):[^'"]+['"]''' # noqa: E501 - - module_names = re.findall(regex, text) - for name in module_names: - text = text.replace(name, name.replace("/", "-")) - # Module:foo -> Module:@en/foo regex = r"""((?:require|mw\.loadData)\s*\(\s*['"](?:[Mm]odule|모듈):)([^'"]+)(['"])""" # noqa: E501 diff --git a/test/scribunto_test.py b/test/scribunto_test.py index ffbccf0..0d2794a 100644 --- a/test/scribunto_test.py +++ b/test/scribunto_test.py @@ -61,7 +61,7 @@ def test_rewrite_requires() -> None: assert actual == expected text = "require('Module:Foo/bar')" - expected = "require('Module:@en/Foo-bar')" + expected = "require('Module:@en/Foo/bar')" actual = scribunto.rewrite_requires(text, 'en') assert actual == expected