diff --git a/docs/changelog.md b/docs/changelog.md index 1bec8a1e..96145cfc 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,6 +1,13 @@ ITables ChangeLog ================= +1.6.3 (2023-12-10) +------------------ + +**Changed** +- HTML in table columns is supported ([#213](https://github.com/mwouts/itables/issues/213)) + + 1.6.2 (2023-10-07) ------------------ diff --git a/itables/javascript.py b/itables/javascript.py index e601972b..761783d1 100644 --- a/itables/javascript.py +++ b/itables/javascript.py @@ -144,7 +144,7 @@ def _table_header( # Generate table head using pandas.to_html(), see issue 63 pattern = re.compile(r".*(.*)", flags=re.MULTILINE | re.DOTALL) try: - html_header = df.head(0).to_html() + html_header = df.head(0).to_html(escape=False) except AttributeError: # Polars DataFrames html_header = pd.DataFrame(data=[], columns=df.columns).to_html() diff --git a/itables/version.py b/itables/version.py index 211dd9d4..6557b260 100644 --- a/itables/version.py +++ b/itables/version.py @@ -1,3 +1,3 @@ """ITables' version number""" -__version__ = "1.6.2" +__version__ = "1.6.3" diff --git a/tests/test_html_in_table_header.py b/tests/test_html_in_table_header.py new file mode 100644 index 00000000..eb09d853 --- /dev/null +++ b/tests/test_html_in_table_header.py @@ -0,0 +1,9 @@ +import pandas as pd + +from itables import to_html_datatable + + +def test_html_in_table_header(df=pd.DataFrame({"B": [1]})): + html = to_html_datatable(df) + print(html) + assert "B" in html