diff --git a/CHANGELOG.md b/CHANGELOG.md index 02e63e4..0e7af15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to htmltools for Python will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [UNRELEASED] + + + ## [0.5.3] 2024-07-18 * HTML tags in docstrings are now escaped. (#90) diff --git a/htmltools/__init__.py b/htmltools/__init__.py index 3bc59e1..e9e243e 100644 --- a/htmltools/__init__.py +++ b/htmltools/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.5.3" +__version__ = "0.5.3.9000" from . import svg, tags from ._core import TagAttrArg # pyright: ignore[reportUnusedImport] # noqa: F401 diff --git a/htmltools/_core.py b/htmltools/_core.py index d2feb9d..2beee8d 100644 --- a/htmltools/_core.py +++ b/htmltools/_core.py @@ -460,7 +460,7 @@ def _normalize_attr_value(x: TagAttrValue) -> Optional[str]: return "" if isinstance(x, (int, float)): return str(x) - if isinstance(x, (HTML, str)): + if isinstance(x, (HTML, str)): # type: ignore[reportUnnecessaryIsInstance] return x raise TypeError( f"Invalid type for attribute: {type(x)}." @@ -1512,7 +1512,7 @@ def as_html_tags( Render the dependency as a ``TagList()``. """ d = self.as_dict(lib_prefix=lib_prefix, include_version=include_version) - metas = [Tag("meta", **m) for m in self.meta] + metas = [Tag("meta", **m) for m in d["meta"]] links = [Tag("link", **s) for s in d["stylesheet"]] scripts = [Tag("script", **s) for s in d["script"]] return TagList(*metas, *links, *scripts, self.head)