forked from rDrama/rDrama
Merge branch 'master' into mistletoe
commit
5afb143991
|
@ -81,7 +81,7 @@ class CustomRenderer(HTMLRenderer):
|
|||
|
||||
if not user: return f"{space}@{target}"
|
||||
|
||||
return f'''{space}<a href="{user.url}"><img alt="@{username}'s profile picture" loading="lazy" src="/uid/{user.id}/pic" class="pp20">@{user.username}</a>'''
|
||||
return f'''{space}<a href="{user.url}"><img alt="@{user.username}'s profile picture" loading="lazy" src="/uid/{user.id}/pic" class="pp20">@{user.username}</a>'''
|
||||
|
||||
def render_sub_mention(self, token):
|
||||
space = token.target[0]
|
||||
|
|
|
@ -205,7 +205,7 @@ def sanitize(sanitized, noimages=False):
|
|||
for i in re.finditer('" target="_blank">(https://youtube\.com/watch\?v\=(.*?))</a>', sanitized):
|
||||
url = i.group(1)
|
||||
yt_id = i.group(2).split('&')[0].split('%')[0]
|
||||
replacing = f'<a href="{url}" rel="nofollow noopener noreferrer">{url}</a>'
|
||||
replacing = f'<a href="{url}" rel="nofollow noopener noreferrer" target="_blank">{url}</a>'
|
||||
|
||||
params = parse_qs(urlparse(url.replace('&','&')).query)
|
||||
t = params.get('t', params.get('start', [0]))[0]
|
||||
|
|
|
@ -697,7 +697,7 @@ def thumbnail_thread(pid):
|
|||
for chunk in image_req.iter_content(1024):
|
||||
file.write(chunk)
|
||||
|
||||
post.thumburl = "https://" + site + process_image(name, True)
|
||||
post.thumburl = f"https://{site}/" + process_image(name, True)
|
||||
db.add(post)
|
||||
db.commit()
|
||||
db.close()
|
||||
|
|
|
@ -262,11 +262,10 @@ def static_service(path):
|
|||
return resp
|
||||
|
||||
@app.get('/images/<path:path>')
|
||||
@app.get('/IMAGES/<path:path>')
|
||||
@app.get('/hostedimages/<path:path>')
|
||||
@limiter.exempt
|
||||
def images(path):
|
||||
resp = make_response(send_from_directory('images', path.replace('.WEBP','.webp')))
|
||||
resp = make_response(send_from_directory('../images', path.replace('.WEBP','.webp')))
|
||||
resp.headers.remove("Cache-Control")
|
||||
resp.headers.add("Cache-Control", "public, max-age=2628000")
|
||||
if request.path.endswith('.webp'):
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<div class="settings-section rounded">
|
||||
<div class="d-lg-flex">
|
||||
<div class="title w-lg-25">
|
||||
<label for="over18"><a href="{{app.permalink}}" target="_blank">{{app.app_name}}</a></label>
|
||||
<label for="over18"><a href="{{app.permalink}}" {% if v and v.newtab %}target="_blank"{% endif %}>{{app.app_name}}</a></label>
|
||||
</div>
|
||||
<div class="body w-lg-100">
|
||||
<label for="edit-{{app.id}}-author" class="mb-0 w-lg-25">User</label>
|
||||
|
|
|
@ -50,11 +50,11 @@
|
|||
|
||||
{% elif v %}
|
||||
|
||||
<p>Please <a target="_blank" href="/settings/security">verify your email address</a> in order to ensure we can respond to your message if needed. Then, refresh this page.</p>
|
||||
<p>Please <a {% if v and v.newtab %}target="_blank"{% endif %} href="/settings/security">verify your email address</a> in order to ensure we can respond to your message if needed. Then, refresh this page.</p>
|
||||
|
||||
{% else %}
|
||||
|
||||
<p>In order to ensure that we can respond to your message, please first <a href="/signup" target="_blank">sign up</a> or <a href="/login" target="_blank">log in</a> and make sure you have <a target="_blank" href="/settings/security">verified your email address</a>. Then, refresh this page.</p>
|
||||
<p>In order to ensure that we can respond to your message, please first <a href="/signup" {% if v and v.newtab %}target="_blank"{% endif %}>sign up</a> or <a href="/login" {% if v and v.newtab %}target="_blank"{% endif %}>log in</a> and make sure you have <a {% if v and v.newtab %}target="_blank"{% endif %} href="/settings/security">verified your email address</a>. Then, refresh this page.</p>
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
|
Loading…
Reference in New Issue