pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
py-docutils: add another upstream commit
Module Name: pkgsrc-wip
Committed By: Thomas Klausner <wiz%NetBSD.org@localhost>
Pushed By: wiz
Date: Mon Aug 11 17:28:46 2025 +0200
Changeset: 93e908bb9d81c20b9f918e3f62098a54ba75b6b7
Modified Files:
py-docutils/distinfo
py-docutils/patches/patch-docutils_parsers_rst_states.py
Log Message:
py-docutils: add another upstream commit
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=93e908bb9d81c20b9f918e3f62098a54ba75b6b7
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
py-docutils/distinfo | 2 +-
.../patches/patch-docutils_parsers_rst_states.py | 35 ++++++++++++++++++++--
2 files changed, 34 insertions(+), 3 deletions(-)
diffs:
diff --git a/py-docutils/distinfo b/py-docutils/distinfo
index 6e35654c46..60ab8171f8 100644
--- a/py-docutils/distinfo
+++ b/py-docutils/distinfo
@@ -3,4 +3,4 @@ $NetBSD: distinfo,v 1.33 2025/08/03 10:06:37 wiz Exp $
BLAKE2s (docutils-0.22.tar.gz) = 20d7b105f2af0a2417ab1e3800120565ef7c3fc77da8dd4ebef852624b7b3eaa
SHA512 (docutils-0.22.tar.gz) = 09082eb3bdd5f9b3e977d356740efee47725a50fbaca7bf35c7fddff06003c2b2177a38d160a9956f9e96261f881c0d870c0aa9fef84f90d0cac079ccc73669d
Size (docutils-0.22.tar.gz) = 2277984 bytes
-SHA1 (patch-docutils_parsers_rst_states.py) = b1c6bcd67d117267847d79516711f3c61dd11c3a
+SHA1 (patch-docutils_parsers_rst_states.py) = e355d56f6595f5f5b240f23eccaa7ce9da5677f8
diff --git a/py-docutils/patches/patch-docutils_parsers_rst_states.py b/py-docutils/patches/patch-docutils_parsers_rst_states.py
index 15a69f2ff4..15ffa74b14 100644
--- a/py-docutils/patches/patch-docutils_parsers_rst_states.py
+++ b/py-docutils/patches/patch-docutils_parsers_rst_states.py
@@ -1,15 +1,46 @@
$NetBSD$
https://sourceforge.net/p/docutils/bugs/508/
+https://sourceforge.net/p/docutils/bugs/509/
--- docutils/parsers/rst/states.py.orig 2025-07-29 14:37:37.894344600 +0000
+++ docutils/parsers/rst/states.py
-@@ -331,30 +331,42 @@ class RSTState(StateWS):
+@@ -169,7 +169,6 @@ class RSTStateMachine(StateMachineWS):
+
+
+ class NestedStateMachine(StateMachineWS):
+-
+ """
+ StateMachine run from within other StateMachine runs, to parse nested
+ document structures.
+@@ -177,7 +176,7 @@ class NestedStateMachine(StateMachineWS)
+
+ def run(self, input_lines, input_offset, memo, node, match_titles=True):
+ """
+- Parse `input_lines` and populate a `docutils.nodes.document` instance.
++ Parse `input_lines` and populate `node`.
+
+ Extend `StateMachineWS.run()`: set up document-wide data.
+ """
+@@ -326,35 +325,53 @@ class RSTState(StateWS):
+
+ When a new section is reached that isn't a subsection of the current
+ section, set `self.parent` to the new section's parent section
+- (or the document if the new section is a top-level section).
++ (or the root node if the new section is a top-level section).
+ """
title_styles = self.memo.title_styles
parent_sections = self.parent.section_hierarchy()
- # current section level: (0 document, 1 section, 2 subsection, ...)
+- # current section level: (0 document, 1 section, 2 subsection, ...)
- mylevel = len(parent_sections)
- # Determine the level of the new section:
++ # Adding a new <section> at level "i" is done by appending to
++ # ``parent_sections[i-1].parent``.
++ # However, in nested parsing the root `node` may be a <section>.
++ # Then ``parent_sections[0]`` has no parent and must be discarded:
++ if parent_sections and parent_sections[0].parent is None:
++ parent_sections.pop(0)
++ # current section level: (0 root, 1 section, 2 subsection, ...)
+ oldlevel = len(parent_sections)
+ # new section level:
try: # check for existing title style
Home |
Main Index |
Thread Index |
Old Index