fds
This commit is contained in:
parent
f5100ee41b
commit
86aab0915b
15 changed files with 25 additions and 23 deletions
|
@ -3178,7 +3178,7 @@ small, .small {
|
|||
width: 28px;
|
||||
height: 28px;
|
||||
}
|
||||
.profile-pic-20, .pp20, img[src*="/uid/"] {
|
||||
.profile-pic-20, .pp20, img[src*="/uid/"], img[src*="/pp/"] {
|
||||
margin-right: 0.25rem !important;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
|
@ -4463,7 +4463,7 @@ blockquote p {
|
|||
margin: 1.75rem auto !important;
|
||||
}
|
||||
}
|
||||
.in-comment-image:not(img[src*="/uid/"]), .preview img {
|
||||
.in-comment-image:not(img[src*="/uid/"]):not(img[src*="/pp/"]), .preview img {
|
||||
max-height: 150px !important;
|
||||
max-width: 100% !important;
|
||||
border-radius: 0.2rem !important;
|
||||
|
|
|
@ -54,7 +54,7 @@ def notif_comment(text, autojanny=False):
|
|||
|
||||
def notif_comment2(p):
|
||||
|
||||
search_html = f'%</a> has mentioned you: <a href="/post/{p.id}" rel="nofollow">%'
|
||||
search_html = f'%</a> has mentioned you: <a href="/post/{p.id}">%'
|
||||
|
||||
existing = g.db.query(Comment.id).filter(Comment.author_id == NOTIFICATIONS_ID, Comment.parent_submission == None, Comment.body_html.like(search_html)).first()
|
||||
|
||||
|
|
|
@ -127,11 +127,11 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
|
|||
|
||||
u = get_user(i.group(1), graceful=True)
|
||||
if u:
|
||||
sanitized = sanitized.replace(i.group(0), f'''<p><a href="/id/{u.id}"><img loading="lazy" src="/uid/{u.id}/pic" class="pp20">@{u.username}</a>''', 1)
|
||||
sanitized = sanitized.replace(i.group(0), f'''<p><a href="/id/{u.id}"><img loading="lazy" src="/pp/{u.id}">@{u.username}</a>''', 1)
|
||||
else:
|
||||
sanitized = reddit_regex.sub(r'\1<a href="https://old.reddit.com/\2" rel="nofollow noopener noreferrer">/\2</a>', sanitized)
|
||||
|
||||
sanitized = sub_regex.sub(r'\1<a href="/\2" rel="nofollow noopener noreferrer">/\2</a>', sanitized)
|
||||
sanitized = sub_regex.sub(r'\1<a href="/\2">/\2</a>', sanitized)
|
||||
|
||||
captured = []
|
||||
for i in mention_regex.finditer(sanitized):
|
||||
|
@ -144,7 +144,7 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
|
|||
if noimages:
|
||||
sanitized = sanitized.replace(i.group(0), f'{i.group(1)}<a href="/id/{u.id}">@{u.username}</a>', 1)
|
||||
else:
|
||||
sanitized = sanitized.replace(i.group(0), f'''{i.group(1)}<a href="/id/{u.id}"><img loading="lazy" src="/uid/{u.id}/pic" class="pp20">@{u.username}</a>''', 1)
|
||||
sanitized = sanitized.replace(i.group(0), f'''{i.group(1)}<a href="/id/{u.id}"><img loading="lazy" src="/pp/{u.id}">@{u.username}</a>''', 1)
|
||||
|
||||
|
||||
sanitized = imgur_regex.sub(r'\1_d.webp?maxwidth=9999&fidelity=high', sanitized)
|
||||
|
@ -175,7 +175,7 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
|
|||
soup = BeautifulSoup(sanitized, 'lxml')
|
||||
|
||||
for tag in soup.find_all("img"):
|
||||
if tag.get("src") and tag.get("class") != ['pp20']:
|
||||
if tag.get("src") and not tag["src"].startswith('/pp/'):
|
||||
tag["class"] = "in-comment-image"
|
||||
tag["loading"] = "lazy"
|
||||
tag["data-src"] = tag["src"]
|
||||
|
@ -187,6 +187,7 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
|
|||
tag['referrerpolicy'] = "no-referrer"
|
||||
|
||||
for tag in soup.find_all("a"):
|
||||
del tag["rel"]
|
||||
if tag.get("href"):
|
||||
if not tag["href"].startswith(SITE_FULL) and not tag["href"].startswith('/') and not tag["href"].startswith(SITE_FULL2):
|
||||
tag["target"] = "_blank"
|
||||
|
|
|
@ -884,6 +884,7 @@ def remove_follow(username, v):
|
|||
|
||||
return {"message": "Follower removed!"}
|
||||
|
||||
@app.get("/pp/<id>")
|
||||
@app.get("/uid/<id>/pic")
|
||||
@app.get("/uid/<id>/pic/profile")
|
||||
@app.get("/logged_out/uid/<id>/pic")
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=182"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=30">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=183"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=30">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
html {
|
||||
|
@ -39,7 +39,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=182"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=183"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||
{% endif %}
|
||||
|
||||
</head>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<script src="/static/assets/js/bootstrap.js?v=245"></script>
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=182">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=183">
|
||||
<link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=30">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
|
@ -32,7 +32,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=182">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=183">
|
||||
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ You can use Markdown formatting:
|
|||
<tr>
|
||||
<td>Username Mention</td>
|
||||
<td>@QuadNarca</td>
|
||||
<td><a class="d-inline-block" href="/@QuadNarca"><img alt="@QuadNarca profile picture" loading="lazy" src="/uid/29/pic" class="pp20">@QuadNarca</a></td>
|
||||
<td><a class="d-inline-block" href="/@QuadNarca"><img alt="@QuadNarca profile picture" loading="lazy" src="/pp/29">@QuadNarca</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Subreddit Mention</td>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
{% block content %}
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=182"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=30">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=183"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=30">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
html {
|
||||
|
@ -30,7 +30,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=182"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=183"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||
{% endif %}
|
||||
|
||||
<div class="row justify-content-around">
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
{% endblock %}
|
||||
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=182">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=183">
|
||||
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||
|
||||
</head>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<title>2-Step Login - {{SITE_NAME}}</title>
|
||||
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=182"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=183"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=182"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=30">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=183"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=30">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
html {
|
||||
|
|
|
@ -39,10 +39,10 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=182"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=30">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=183"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=30">
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=182"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=183"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||
{% endif %}
|
||||
</head>
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}Sign up - {{SITE_NAME}}{% endif %}</title>
|
||||
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=182"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=183"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}{{SITE_NAME}}{% endif %}</title>
|
||||
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=182"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=183"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
{% block stylesheets %}
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=182"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=30">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=183"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=30">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
html {
|
||||
|
@ -50,7 +50,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=182">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=183">
|
||||
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue