diff --git a/fix-py314.patch b/fix-py314.patch new file mode 100644 index 0000000..dbfe58f --- /dev/null +++ b/fix-py314.patch @@ -0,0 +1,54 @@ +From 15346cd3a73f108bf11c57907b32737f8365d6bd Mon Sep 17 00:00:00 2001 +From: facelessuser +Date: Mon, 21 Jul 2025 08:56:43 -0600 +Subject: [PATCH] Fix failing cases for Python 3.14 + +New change requires us to monkey patch `locatetagend` to prevent +capturing incomplete tags in code spans. +--- + docs/changelog.md | 6 ++++++ + markdown/htmlparser.py | 14 ++++++++++++++ + 2 files changed, 20 insertions(+) + +Index: markdown-3.8.2/docs/changelog.md +=================================================================== +--- markdown-3.8.2.orig/docs/changelog.md 2025-06-19 19:12:28.000000000 +0200 ++++ markdown-3.8.2/docs/changelog.md 2025-08-12 21:13:46.980036183 +0200 +@@ -10,6 +10,12 @@ + [Python Version Specification]: https://packaging.python.org/en/latest/specifications/version-specifiers/. + See the [Contributing Guide](contributing.md) for details. + ++## [Unreleased] ++ ++### Fixed ++ ++* Fix handling of incomplete HTML tags in code spans in Python 3.14. ++ + ## [3.8.2] - 2025-06-19 + + ### Fixed +Index: markdown-3.8.2/markdown/htmlparser.py +=================================================================== +--- markdown-3.8.2.orig/markdown/htmlparser.py 2025-06-19 19:12:28.000000000 +0200 ++++ markdown-3.8.2/markdown/htmlparser.py 2025-08-12 21:13:46.980214669 +0200 +@@ -69,6 +69,20 @@ + )? + \s* # trailing whitespace + """, re.VERBOSE) ++htmlparser.locatetagend = re.compile(r""" ++ [a-zA-Z][^`\t\n\r\f />]* # tag name ++ [\t\n\r\f /]* # optional whitespace before attribute name ++ (?:(?<=['"\t\n\r\f /])[^`\t\n\r\f />][^\t\n\r\f /=>]* # attribute name ++ (?:= # value indicator ++ (?:'[^']*' # LITA-enclosed value ++ |"[^"]*" # LIT-enclosed value ++ |(?!['"])[^>\t\n\r\f ]* # bare value ++ ) ++ )? ++ [\t\n\r\f /]* # possibly followed by a space ++ )* ++ >? ++""", re.VERBOSE) + + # Match a blank line at the start of a block of text (two newlines). + # The newlines may be preceded by additional whitespace. diff --git a/python-Markdown.changes b/python-Markdown.changes index 9bdcd94..4be5cb2 100644 --- a/python-Markdown.changes +++ b/python-Markdown.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Aug 12 18:28:43 UTC 2025 - Matej Cepl + +- Add fix-py314.patch to fix failing tests on 3.14.* or 3.13.6+ + (gh#Python-Markdown/markdown#1547). + ------------------------------------------------------------------- Wed Aug 6 18:16:02 UTC 2025 - BenoƮt Monin diff --git a/python-Markdown.spec b/python-Markdown.spec index 27bd774..1f94fb5 100644 --- a/python-Markdown.spec +++ b/python-Markdown.spec @@ -36,6 +36,9 @@ Group: Development/Languages/Python URL: https://python-markdown.github.io/ Source: https://files.pythonhosted.org/packages/source/m/markdown/markdown-%{version}.tar.gz Patch0: markdown-3.0-python37.patch +# PATCH-FIX-UPSTREAM fix-py314.patch gh#Python-Markdown/markdown#1547 mcepl@suse.com +# Fix failing cases for Python 3.14 +Patch1: fix-py314.patch BuildRequires: %{python_module base >= 3.8} BuildRequires: %{python_module importlib-metadata >= 4.4 if %python-base < 3.10} BuildRequires: %{python_module pip}