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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pl2html
3
- Version: 0.5.1
3
+ Version: 0.6.0
4
4
  Summary: Add your description here
5
5
  Requires-Dist: polars>=1.42.1
6
6
  Requires-Python: >=3.14
@@ -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
- header_parts.append(f' <th>{c}</th>')
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')
@@ -4,7 +4,7 @@ build-backend = 'uv_build'
4
4
 
5
5
  [project]
6
6
  name = "pl2html"
7
- version = "0.5.1"
7
+ version = "0.6.0"
8
8
  description = "Add your description here"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.14"
@@ -1 +0,0 @@
1
- __version__ = '0.5.1'
File without changes
File without changes
File without changes