Skip to content

Commit

Permalink
NOMERGE: YRE: Assume URLs with image file extension in <script> are N…
Browse files Browse the repository at this point in the history
…OT embedded
  • Loading branch information
davidfstr committed Sep 5, 2023
1 parent 89e1265 commit 01fb29a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/crystal/doc/html/soup.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ def replace_url_in_old_attr_value(url: str, old_attr_value: str) -> str:
return
title = None
type_title = 'Script Reference'
embedded = PROBABLE_EMBEDDED_URL_RE.search(relative_url) is not None
embedded = False # FIXME
#embedded = PROBABLE_EMBEDDED_URL_RE.search(relative_url) is not None
links.append(HtmlLink.create_from_complex_tag(
tag, html, 'string', type_title, title, embedded,
relative_url, replace_url_in_old_attr_value))
Expand Down
4 changes: 2 additions & 2 deletions tests/test_parse_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def test_recognizes_javascript_with_absolute_or_site_relative_url() -> None:
assert 'http://example.com/poster.png' == link.relative_url
assert 'Script Reference' == link.type_title
assert None == link.title
assert True == link.embedded
#assert True == link.embedded # FIXME

(_, ()) = _parse_html_and_links(
"""<script type="x-json">["http://example.com/"]</script>""".encode('utf-8'),
Expand All @@ -349,7 +349,7 @@ def test_recognizes_javascript_with_absolute_or_site_relative_url() -> None:
assert '//poster.png' == link.relative_url
assert 'Script Reference' == link.type_title
assert None == link.title
assert True == link.embedded
#assert True == link.embedded # FIXME

(_, ()) = _parse_html_and_links(
"""<script type="x-json">["//home.html"]</script>""".encode('utf-8'),
Expand Down

0 comments on commit 01fb29a

Please sign in to comment.