Skip to content

Commit

Permalink
Handle escaped character references in protocol comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Cirras committed Nov 14, 2024
1 parent f42095a commit 33d582d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Generated code now sets `EoWriter.string_sanitization_mode` during serialization.
- For more information, see
[Chunked Reading: Sanitization](https://github.com/Cirras/eo-protocol/blob/master/docs/chunks.md#sanitization).
- Escaped character references appearing in docstrings and downstream generated documentation.

## [1.1.1] - 2024-08-22

Expand Down
3 changes: 2 additions & 1 deletion protocol_code_generator/util/xml_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from xml.etree.ElementTree import Element
from html import unescape


def get_instructions(element):
Expand Down Expand Up @@ -32,7 +33,7 @@ def get_text(element):
raise RuntimeError(f'Unexpected text content "{text}"')
result = text

return result if result else None
return unescape(result) if result else None


def get_string_attribute(element, name, default_value=None):
Expand Down

0 comments on commit 33d582d

Please sign in to comment.