Fix importing blueprint from community (#44104)

This commit is contained in:
Bram Kragten 2020-12-10 16:45:57 +01:00 committed by GitHub
parent d9a86c1145
commit 0da312b6f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -108,10 +108,10 @@ def _extract_blueprint_from_community_topic(
if block_syntax not in ("auto", "yaml"):
continue
block_content = block_content.strip()
block_content = html.unescape(block_content.strip())
try:
data = yaml.parse_yaml(html.unescape(block_content))
data = yaml.parse_yaml(block_content)
except HomeAssistantError:
if block_syntax == "yaml":
raise

View file

@ -173,6 +173,7 @@ async def test_fetch_blueprint_from_community_url(hass, aioclient_mock, communit
imported_blueprint.blueprint.metadata["source_url"]
== "https://community.home-assistant.io/t/test-topic/123/2"
)
assert "gt;" not in imported_blueprint.raw_data
@pytest.mark.parametrize(