diff --git a/src/small/services/medium_client.py b/src/small/services/medium_client.py index e3b66e6..baf5ccf 100644 --- a/src/small/services/medium_client.py +++ b/src/small/services/medium_client.py @@ -4,6 +4,7 @@ from flask import url_for from small.models.nodes import Page, Paragraph, Text, Image, IFrame, GithubGist +from urllib.parse import quote from datetime import datetime @@ -74,9 +75,12 @@ class MediumClient: gist_id = iframe["href"].split("/")[-1] children = [GithubGist(id=gist_id)] else: + src = quote(iframe["iframeSrc"] or iframe["href"], safe="") + url = url_for("proxy.iframe") + f"?url={src}" + children = [ IFrame( - src=iframe["iframeSrc"] or iframe["href"], + src=url, width=iframe["iframeWidth"], height=iframe["iframeHeight"], ) diff --git a/src/small/static/css/style.css b/src/small/static/css/style.css index 6906d5a..e7d0a2a 100644 --- a/src/small/static/css/style.css +++ b/src/small/static/css/style.css @@ -18,6 +18,24 @@ a:hover { text-decoration: underline; } +a .btn { + display: inline-block; + padding: 10px 20px; + background-color: #1a73e8; + color: #fff; + border-radius: 5px; + text-align: center; + margin-top: 20px; +} + +a .btn:hover { + background-color: #0d6efd; +} + +a .btn:active { + background-color: #0b5ed7; +} + /* Header Styles */ header { border-bottom: 1px solid #e0e0e0; diff --git a/src/small/templates/iframe.html b/src/small/templates/iframe.html new file mode 100644 index 0000000..89105b8 --- /dev/null +++ b/src/small/templates/iframe.html @@ -0,0 +1,6 @@ +
The article you are viewing has embedded external content from {{ url }}
.
For security reasons, this content is blocked by default. You can view the content by clicking the button below.
+ View content +