Skip to content

Parse inline Snippet tags - #1293

Closed
danielporterda wants to merge 1 commit into
snippet-source-page-discoveryfrom
snippet-parse-snippet
Closed

Parse inline Snippet tags#1293
danielporterda wants to merge 1 commit into
snippet-source-page-discoveryfrom
snippet-parse-snippet

Conversation

@danielporterda

@danielporterda danielporterda commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What changed

Parses well-formed, self-closing <Snippet ... /> tags into a small syntax model containing raw attributes and source spans.

The parser:

  • supports multiline tags and quoted attributes
  • preserves byte offsets plus line and column information
  • ignores examples inside fenced code, inline code, and MDX comments
  • rejects duplicate attributes and malformed or non-self-closing tags

This PR intentionally does not parse <IfVersion>, interpret snippet source references, or perform semantic validation.

Why

Snippet syntax is independently reviewable from release-condition syntax and from the rules applied to parsed attribute values.

Validation

  • python -m pytest tests/test_snippet_tag_parser.py tests/test_snippet_source_page_discovery.py (9 passed)
  • python -m ruff check scripts/snippets/model.py scripts/snippets/syntax.py tests/test_snippet_tag_parser.py
  • python -m mypy scripts/snippets/model.py scripts/snippets/syntax.py
  • git diff --check

Signed-off-by: danielporterda <daniel.porter@digitalasset.com>
@danielporterda
danielporterda force-pushed the snippet-parse-snippet branch from 64c4cd7 to 3d6cb14 Compare August 7, 2026 15:42
@danielporterda

Copy link
Copy Markdown
Contributor Author

Closing this draft because the inline release-aware snippet stack is being retired. The branch remains available if its implementation is needed later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant