Skip to content

Commit

Permalink
Merge pull request #17 from volfpeter/16-fix-attribute-quoting
Browse files Browse the repository at this point in the history
Fix attribute quoting in Formatter and bump patch version, fixes #16
  • Loading branch information
volfpeter authored Nov 21, 2024
2 parents 65f47f8 + 8c7de9d commit 701030a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- synchronize

jobs:
Linters:
Tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down
3 changes: 2 additions & 1 deletion htmy/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from pathlib import Path
from typing import TYPE_CHECKING, Any, ClassVar, Generic, TypedDict, cast, overload
from xml.sax.saxutils import escape as xml_escape
from xml.sax.saxutils import quoteattr as xml_quoteattr

from .io import open_file
from .typing import (
Expand Down Expand Up @@ -429,7 +430,7 @@ def format(self, name: str, value: Any) -> str:
See `SkipProperty` for more information.
"""
try:
return f'{self.format_name(name)}="{self.format_value(value)}"'
return f"{self.format_name(name)}={xml_quoteattr(self.format_value(value))}"
except SkipProperty:
return ""

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "htmy"
version = "0.3.3"
version = "0.3.4"
description = "Async, pure-Python rendering engine."
authors = ["Peter Volf <do.volfp@gmail.com>"]
license = "MIT"
Expand Down

0 comments on commit 701030a

Please sign in to comment.