Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/users/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Note that there is currently no guarantee for a stable Markdown formatting style

## **unreleased**

- Removed
- `mdformat.codepoints.ASCII_WHITESPACE` (deprecated since 0.7.20)
- Fixed
- Read UTF-8 from standard input on all systems.
Thank you, [Christopher Prohm](https://github.com/chmp), for the PR.
Expand Down
21 changes: 0 additions & 21 deletions src/mdformat/codepoints/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,10 @@
"UNICODE_PUNCTUATION",
"UNICODE_WHITESPACE",
"ASCII_CTRL",
"ASCII_WHITESPACE",
)


from mdformat.codepoints._unicode_punctuation import UNICODE_PUNCTUATION
from mdformat.codepoints._unicode_whitespace import UNICODE_WHITESPACE

ASCII_CTRL = frozenset(chr(i) for i in range(32)) | frozenset(chr(127))


def __getattr__(name: str) -> frozenset[str]:
"""Attribute getter fallback.

Used during the deprecation period of `ASCII_WHITESPACE`.
"""
if name == "ASCII_WHITESPACE":
import warnings

warnings.warn(
"ASCII_WHITESPACE is deprecated because CommonMark v0.30 no longer "
"defines ASCII whitespace.",
DeprecationWarning,
stacklevel=2,
)
return frozenset({chr(9), chr(10), chr(11), chr(12), chr(13), chr(32)})
raise AttributeError(
f"module {__name__!r} has no attribute {name!r}"
) # pragma: no cover
5 changes: 0 additions & 5 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,6 @@ def test_mdrenderer_no_finalize(tmp_path):
assert finalized == unfinalized + "\n\n[gl ref]: https://gitlab.com\n"


def test_ascii_whitespace_deprecation():
with pytest.warns(DeprecationWarning):
mdformat.codepoints.ASCII_WHITESPACE


def test_import_typing():
"""Try to import mdformat.renderer.typing.

Expand Down