python-fragments 0.25__tar.gz → 0.26__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_fragments-0.25 → python_fragments-0.26}/PKG-INFO +1 -1
- {python_fragments-0.25 → python_fragments-0.26}/fragments/grammar.py +3 -1
- {python_fragments-0.25 → python_fragments-0.26}/pyproject.toml +1 -1
- {python_fragments-0.25 → python_fragments-0.26}/python_fragments.egg-info/PKG-INFO +1 -1
- {python_fragments-0.25 → python_fragments-0.26}/tests/test_grammar.py +13 -0
- {python_fragments-0.25 → python_fragments-0.26}/README.md +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/__init__.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/ast_nodes.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/cli.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/html/__init__.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/html/elements.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/loader.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/__init__.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/based_proxy.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/__init__.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/code_actions.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/completion.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/definition.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/diagnostics.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/document_highlight.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/document_symbols.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/folding_range.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/hover.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/inlay_hints.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/lifecycle.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/references.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/rename.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/semantic_tokens.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/signature_help.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/file_state.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/message_queue.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/pyright_notification_handlers/__init__.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/pyright_notification_handlers/capability.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/pyright_notification_handlers/configuration.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/pyright_notification_handlers/diagnostics.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/types.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/source.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/transpiler.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/fragments/types.py +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/python_fragments.egg-info/SOURCES.txt +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/python_fragments.egg-info/dependency_links.txt +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/python_fragments.egg-info/entry_points.txt +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/python_fragments.egg-info/requires.txt +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/python_fragments.egg-info/top_level.txt +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/setup.cfg +0 -0
- {python_fragments-0.25 → python_fragments-0.26}/tests/test_source_map.py +0 -0
|
@@ -269,7 +269,9 @@ def expect_children(source: Source) -> tuple[Source, list[ASTHTMLChild]]:
|
|
|
269
269
|
while not source.remaining().startswith("</"):
|
|
270
270
|
source, child = expect_child(source)
|
|
271
271
|
children.append(child)
|
|
272
|
-
|
|
272
|
+
source_after_whitespace, _ = source.eat_whitespace()
|
|
273
|
+
if not source_after_whitespace.remaining().startswith("{{"):
|
|
274
|
+
source = source_after_whitespace
|
|
273
275
|
return source, children
|
|
274
276
|
|
|
275
277
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "python-fragments"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.26"
|
|
8
8
|
description = "Modern HTML template rendering in Python"
|
|
9
9
|
authors = [{ name = "The Running Algorithm", email = "services@therunningalgorithm.info" }]
|
|
10
10
|
readme = "README.md"
|
|
@@ -362,6 +362,19 @@ def test_html_text_multiline_before_child_element():
|
|
|
362
362
|
]))
|
|
363
363
|
|
|
364
364
|
|
|
365
|
+
def test_whitespace_between_adjacent_interpolations_is_preserved():
|
|
366
|
+
source = Source.from_string("<><p>{{ a }} {{ b }}</p></>")
|
|
367
|
+
source, fragment = grammar.expect_fragment(source)
|
|
368
|
+
assert source.at_end()
|
|
369
|
+
assert _transpiled(fragment) == _transpiled(ASTFragment(-1, -1, [
|
|
370
|
+
ASTHTMLElement(-1, -1, "p", {}, [
|
|
371
|
+
ASTInterpolation(-1, -1, "a", 1, 1),
|
|
372
|
+
ASTHTMLText(-1, -1, " "),
|
|
373
|
+
ASTInterpolation(-1, -1, "b", 1, 1),
|
|
374
|
+
], False)
|
|
375
|
+
]))
|
|
376
|
+
|
|
377
|
+
|
|
365
378
|
# ---------------------------------------------------------------------------
|
|
366
379
|
# Full integration (updated for new AST structure)
|
|
367
380
|
# ---------------------------------------------------------------------------
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/completion.py
RENAMED
|
File without changes
|
{python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/definition.py
RENAMED
|
File without changes
|
{python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/diagnostics.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/hover.py
RENAMED
|
File without changes
|
{python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/inlay_hints.py
RENAMED
|
File without changes
|
{python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/lifecycle.py
RENAMED
|
File without changes
|
{python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/references.py
RENAMED
|
File without changes
|
{python_fragments-0.25 → python_fragments-0.26}/fragments/lsp/client_message_handlers/rename.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_fragments-0.25 → python_fragments-0.26}/python_fragments.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|