Skip to content

Commit 66efa60

Browse files
rgommershenryiii
authored andcommitted
Clarify greediness of inline metadata parsing spec
See #1960 for the relevant context. The change to PEP 723 was made in python/peps#3505, which also links to the DPO discussion where this greediness was decided on. Closes #1960
1 parent fcaaf74 commit 66efa60

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎source/specifications/inline-script-metadata.rst‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ metadata:
6767
In circumstances where there is a discrepancy between the text specification
6868
and the regular expression, the text specification takes precedence.
6969

70+
The regular expression intentionally matches greedily, using the last possible
71+
ending line within an uninterrupted sequence of valid embedded content lines.
72+
This permits a standalone ``///`` within embedded content, as in the C# example
73+
above; non-greedy matching would truncate that example. Consequently, apparent
74+
blocks separated only by valid embedded content lines, including ``#``, are
75+
matched as one block, with intervening delimiters included as content. An actual
76+
blank line separates blocks.
77+
7078
Tools MUST NOT read from metadata blocks with types that have not been
7179
standardized by this specification.
7280

0 commit comments

Comments
 (0)