diff --git a/pyproject.toml b/pyproject.toml index c914b91..e21d363 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "website-build-tools" -version = "0.1.8" +version = "0.1.9" description = "tools for building websites, used by defelement.org and quadraturerules.org" readme = "README.md" requires-python = ">=3.8.0" diff --git a/test/test_markup.py b/test/test_markup.py index 03e9d02..5ee3eb0 100644 --- a/test/test_markup.py +++ b/test/test_markup.py @@ -7,3 +7,7 @@ def test_code_highlight_cpp(): assert "#<" in code_highlight("#", "cpp") assert "#<" in markup("```cpp\n#\n```\n") + + assert "
    " in markup( + "```python\nfor i in range(10):\n print(i)\n```\n", + ) diff --git a/webtools/__init__.py b/webtools/__init__.py index ca0cfd4..77d22ac 100644 --- a/webtools/__init__.py +++ b/webtools/__init__.py @@ -1,3 +1,3 @@ """Website building tools.""" -__version__ = "0.1.8" +__version__ = "0.1.9" diff --git a/webtools/code_markup.py b/webtools/code_markup.py index ebcdfca..d5e8e08 100644 --- a/webtools/code_markup.py +++ b/webtools/code_markup.py @@ -16,6 +16,7 @@ def _highlight(txt: str, comment_start: str, keywords: typing.List[str]) -> str: """General highlight function.""" out = [] + txt = txt.replace(" ", " ") for line in txt.split("\n"): comment = "" if comment_start in line: