pl2html 0.5.1__tar.gz → 0.6.0__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.
- {pl2html-0.5.1 → pl2html-0.6.0}/PKG-INFO +1 -1
- pl2html-0.6.0/pl2html/__init__.py +1 -0
- {pl2html-0.5.1 → pl2html-0.6.0}/pl2html/compiler.py +8 -1
- {pl2html-0.5.1 → pl2html-0.6.0}/pyproject.toml +1 -1
- pl2html-0.5.1/pl2html/__init__.py +0 -1
- {pl2html-0.5.1 → pl2html-0.6.0}/README.md +0 -0
- {pl2html-0.5.1 → pl2html-0.6.0}/pl2html/formats.py +0 -0
- {pl2html-0.5.1 → pl2html-0.6.0}/pl2html/styles.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '0.6.0'
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from html import escape as _escape
|
|
2
|
+
|
|
1
3
|
from polars import (
|
|
2
4
|
DataFrame as _DataFrame,
|
|
3
5
|
DataType as _DataType,
|
|
@@ -104,8 +106,13 @@ def _build_cell_expr(
|
|
|
104
106
|
|
|
105
107
|
def _build_html_skeleton(visible_columns: list[str]) -> tuple[_Expr, _Expr]:
|
|
106
108
|
header_parts = ['<table>', ' <thead>\n <tr>']
|
|
109
|
+
|
|
107
110
|
for c in visible_columns:
|
|
108
|
-
|
|
111
|
+
# NOTE: quote=False allows names like `Alice's "score"` to render naturally.
|
|
112
|
+
# This is safe ONLY because the string is confined strictly inside text nodes (<th>).
|
|
113
|
+
# DO NOT reuse these variables within HTML attributes.
|
|
114
|
+
header_parts.append(f' <th>{_escape(c, quote=False)}</th>')
|
|
115
|
+
|
|
109
116
|
header_parts.append(' </tr>\n </thead>\n <tbody>')
|
|
110
117
|
|
|
111
118
|
html_header = _lit('\n'.join(header_parts) + '\n')
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '0.5.1'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|