Remove strip-formatting patch
This commit is contained in:
parent
53b9790142
commit
1c6d88fc31
|
@ -65,17 +65,6 @@ module StatusesHelper
|
||||||
embedded_view? ? '_blank' : nil
|
embedded_view? ? '_blank' : nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def text_formatting_classes
|
|
||||||
case current_user&.setting_strip_formatting
|
|
||||||
when 'none', nil
|
|
||||||
'rich-text rich-blocks'
|
|
||||||
when 'blocks'
|
|
||||||
'rich-text'
|
|
||||||
when 'all'
|
|
||||||
nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def fa_visibility_icon(status)
|
def fa_visibility_icon(status)
|
||||||
case status.visibility
|
case status.visibility
|
||||||
when 'public'
|
when 'public'
|
||||||
|
|
|
@ -835,9 +835,7 @@ body > [data-popper-placement] {
|
||||||
margin: -3px 0 0;
|
margin: -3px 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
p,
|
p {
|
||||||
pre,
|
|
||||||
blockquote {
|
|
||||||
margin-bottom: 22px;
|
margin-bottom: 22px;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
unicode-bidi: plaintext;
|
unicode-bidi: plaintext;
|
||||||
|
@ -847,175 +845,6 @@ body > [data-popper-placement] {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
h1,
|
|
||||||
h2,
|
|
||||||
h3,
|
|
||||||
h4,
|
|
||||||
h5 {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
blockquote {
|
|
||||||
white-space: normal;
|
|
||||||
|
|
||||||
p:last-child {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ul,
|
|
||||||
ol {
|
|
||||||
p {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:not(.rich-text) {
|
|
||||||
del {
|
|
||||||
text-decoration: none;
|
|
||||||
|
|
||||||
&::before,
|
|
||||||
&::after {
|
|
||||||
content: '~~';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
code {
|
|
||||||
font-family: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
u {
|
|
||||||
text-decoration: none;
|
|
||||||
|
|
||||||
&::before,
|
|
||||||
&::after {
|
|
||||||
content: '__';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
h1::before {
|
|
||||||
content: '# ';
|
|
||||||
}
|
|
||||||
|
|
||||||
h2::before {
|
|
||||||
content: '## ';
|
|
||||||
}
|
|
||||||
|
|
||||||
h3::before {
|
|
||||||
content: '### ';
|
|
||||||
}
|
|
||||||
|
|
||||||
h4::before {
|
|
||||||
content: '#### ';
|
|
||||||
}
|
|
||||||
|
|
||||||
h5::before {
|
|
||||||
content: '##### ';
|
|
||||||
}
|
|
||||||
|
|
||||||
b,
|
|
||||||
strong {
|
|
||||||
&::before,
|
|
||||||
&::after {
|
|
||||||
content: '**';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
em,
|
|
||||||
i {
|
|
||||||
&::before,
|
|
||||||
&::after {
|
|
||||||
content: '*';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:not(.rich-blocks) {
|
|
||||||
blockquote {
|
|
||||||
position: relative;
|
|
||||||
padding-left: 1em;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
blockquote::before {
|
|
||||||
position: absolute;
|
|
||||||
content: '>\a>\a>\a>\a>\a>\a>\a>\a>\a>\a>\a>\a>\a>\a>\a>\a>\a>\a>\a>\a>\a>\a>\a>\a>\a>\a>\a>\a>\a>\a';
|
|
||||||
white-space: pre-wrap;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
li::before {
|
|
||||||
position: absolute;
|
|
||||||
content: '*';
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
li {
|
|
||||||
position: relative;
|
|
||||||
padding-left: 1em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.rich-text {
|
|
||||||
h1,
|
|
||||||
h2 {
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
h3,
|
|
||||||
h4,
|
|
||||||
h5 {
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
b,
|
|
||||||
strong {
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
em,
|
|
||||||
i {
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub {
|
|
||||||
font-size: smaller;
|
|
||||||
text-align: sub;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.rich-blocks {
|
|
||||||
h1,
|
|
||||||
h2 {
|
|
||||||
font-size: 18px;
|
|
||||||
}
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
blockquote {
|
|
||||||
padding-left: 10px;
|
|
||||||
border-left: 3px solid $darker-text-color;
|
|
||||||
color: $darker-text-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul,
|
|
||||||
ol {
|
|
||||||
margin-left: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
ul {
|
|
||||||
list-style-type: disc;
|
|
||||||
}
|
|
||||||
|
|
||||||
ol {
|
|
||||||
list-style-type: decimal;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: $secondary-text-color;
|
color: $secondary-text-color;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
|
@ -23,10 +23,6 @@ module HasUserSettings
|
||||||
settings['web.auto_play']
|
settings['web.auto_play']
|
||||||
end
|
end
|
||||||
|
|
||||||
def setting_strip_formatting
|
|
||||||
settings['strip_formatting']
|
|
||||||
end
|
|
||||||
|
|
||||||
def setting_default_sensitive
|
def setting_default_sensitive
|
||||||
settings['default_sensitive']
|
settings['default_sensitive']
|
||||||
end
|
end
|
||||||
|
|
|
@ -51,13 +51,11 @@ class InitialStateSerializer < ActiveModel::Serializer
|
||||||
store[:use_blurhash] = object.current_account.user.setting_use_blurhash
|
store[:use_blurhash] = object.current_account.user.setting_use_blurhash
|
||||||
store[:use_pending_items] = object.current_account.user.setting_use_pending_items
|
store[:use_pending_items] = object.current_account.user.setting_use_pending_items
|
||||||
store[:show_trends] = Setting.trends && object.current_account.user.setting_trends
|
store[:show_trends] = Setting.trends && object.current_account.user.setting_trends
|
||||||
store[:strip_formatting] = object.current_account.user.setting_strip_formatting
|
|
||||||
else
|
else
|
||||||
store[:auto_play_gif] = Setting.auto_play_gif
|
store[:auto_play_gif] = Setting.auto_play_gif
|
||||||
store[:display_media] = Setting.display_media
|
store[:display_media] = Setting.display_media
|
||||||
store[:reduce_motion] = Setting.reduce_motion
|
store[:reduce_motion] = Setting.reduce_motion
|
||||||
store[:use_blurhash] = Setting.use_blurhash
|
store[:use_blurhash] = Setting.use_blurhash
|
||||||
store[:strip_formatting] = Setting.strip_formatting
|
|
||||||
end
|
end
|
||||||
|
|
||||||
store[:disabled_account_id] = object.disabled_account.id.to_s if object.disabled_account
|
store[:disabled_account_id] = object.disabled_account.id.to_s if object.disabled_account
|
||||||
|
|
|
@ -8,7 +8,6 @@ class REST::PreferencesSerializer < ActiveModel::Serializer
|
||||||
attribute :reading_default_sensitive_media, key: 'reading:expand:media'
|
attribute :reading_default_sensitive_media, key: 'reading:expand:media'
|
||||||
attribute :reading_default_sensitive_text, key: 'reading:expand:spoilers'
|
attribute :reading_default_sensitive_text, key: 'reading:expand:spoilers'
|
||||||
attribute :reading_autoplay_gifs, key: 'reading:autoplay:gifs'
|
attribute :reading_autoplay_gifs, key: 'reading:autoplay:gifs'
|
||||||
attribute :reading_strip_formatting, key: 'reading:formatting:strip'
|
|
||||||
|
|
||||||
def posting_default_privacy
|
def posting_default_privacy
|
||||||
object.user.setting_default_privacy
|
object.user.setting_default_privacy
|
||||||
|
@ -33,8 +32,4 @@ class REST::PreferencesSerializer < ActiveModel::Serializer
|
||||||
def reading_autoplay_gifs
|
def reading_autoplay_gifs
|
||||||
object.user.setting_auto_play_gif
|
object.user.setting_auto_play_gif
|
||||||
end
|
end
|
||||||
|
|
||||||
def reading_strip_formatting
|
|
||||||
object.user.setting_strip_formatting
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
= ff.input :'web.reduce_motion', wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_reduce_motion')
|
= ff.input :'web.reduce_motion', wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_reduce_motion')
|
||||||
= ff.input :'web.disable_swiping', wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_disable_swiping')
|
= ff.input :'web.disable_swiping', wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_disable_swiping')
|
||||||
= ff.input :'web.use_system_font', wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_system_font_ui')
|
= ff.input :'web.use_system_font', wrapper: :with_label, label: I18n.t('simple_form.labels.defaults.setting_system_font_ui')
|
||||||
= ff.input :strip_formatting, collection: ['none', 'blocks', 'all'], wrapper: :with_floating_label, include_blank: false, label_method: lambda { |value| safe_join([I18n.t("statuses.strip_formatting.#{value}"), content_tag(:span, I18n.t("statuses.strip_formatting.#{value}_long"), class: 'hint')]) }, required: false, as: :radio_buttons, collection_wrapper_tag: 'ul', item_wrapper_tag: 'li', hint: false
|
|
||||||
|
|
||||||
%h4= t 'appearance.discovery'
|
%h4= t 'appearance.discovery'
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
= account_action_button(status.account)
|
= account_action_button(status.account)
|
||||||
|
|
||||||
.status__content.emojify{ class: text_formatting_classes, data: ({ spoiler: current_account&.user&.setting_expand_spoilers ? 'expanded' : 'folded' } if status.spoiler_text?) }<
|
.status__content.emojify{ data: ({ spoiler: current_account&.user&.setting_expand_spoilers ? 'expanded' : 'folded' } if status.spoiler_text?) }<
|
||||||
- if status.spoiler_text?
|
- if status.spoiler_text?
|
||||||
%p<
|
%p<
|
||||||
%span.p-summary> #{prerender_custom_emojis(h(status.spoiler_text), status.emojis)}
|
%span.p-summary> #{prerender_custom_emojis(h(status.spoiler_text), status.emojis)}
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
%span.display-name__account
|
%span.display-name__account
|
||||||
= acct(status.account)
|
= acct(status.account)
|
||||||
= fa_icon('lock') if status.account.locked?
|
= fa_icon('lock') if status.account.locked?
|
||||||
.status__content.emojify{ class: text_formatting_classes, data: ({ spoiler: current_account&.user&.setting_expand_spoilers ? 'expanded' : 'folded' } if status.spoiler_text?) }<
|
.status__content.emojify{ data: ({ spoiler: current_account&.user&.setting_expand_spoilers ? 'expanded' : 'folded' } if status.spoiler_text?) }<
|
||||||
- if status.spoiler_text?
|
- if status.spoiler_text?
|
||||||
%p<
|
%p<
|
||||||
%span.p-summary> #{prerender_custom_emojis(h(status.spoiler_text), status.emojis)}
|
%span.p-summary> #{prerender_custom_emojis(h(status.spoiler_text), status.emojis)}
|
||||||
|
|
|
@ -1541,13 +1541,6 @@ en-DG:
|
||||||
show_older: Show older
|
show_older: Show older
|
||||||
show_thread: Show thread
|
show_thread: Show thread
|
||||||
sign_in_to_participate: Sign in to participate in the conversation
|
sign_in_to_participate: Sign in to participate in the conversation
|
||||||
strip_formatting:
|
|
||||||
all: All
|
|
||||||
all_long: Strip all advanced formatting
|
|
||||||
blocks: Block elements
|
|
||||||
blocks_long: Strip formatting for title headers and block quotes
|
|
||||||
none: None
|
|
||||||
none_long: Do not strip any formatting supported by Mastodon
|
|
||||||
title: '%{name}: "%{quote}"'
|
title: '%{name}: "%{quote}"'
|
||||||
visibilities:
|
visibilities:
|
||||||
direct: Direct
|
direct: Direct
|
||||||
|
|
|
@ -1541,13 +1541,6 @@ en-LN:
|
||||||
show_older: Show older
|
show_older: Show older
|
||||||
show_thread: Show thread
|
show_thread: Show thread
|
||||||
sign_in_to_participate: Sign in to participate in the conversation
|
sign_in_to_participate: Sign in to participate in the conversation
|
||||||
strip_formatting:
|
|
||||||
all: All
|
|
||||||
all_long: Strip all advanced formatting
|
|
||||||
blocks: Block elements
|
|
||||||
blocks_long: Strip formatting for title headers and block quotes
|
|
||||||
none: None
|
|
||||||
none_long: Do not strip any formatting supported by Mastodon
|
|
||||||
title: '%{name}: "%{quote}"'
|
title: '%{name}: "%{quote}"'
|
||||||
visibilities:
|
visibilities:
|
||||||
direct: Direct
|
direct: Direct
|
||||||
|
|
|
@ -1541,13 +1541,6 @@ en-SQ:
|
||||||
show_older: Show older
|
show_older: Show older
|
||||||
show_thread: Show thread
|
show_thread: Show thread
|
||||||
sign_in_to_participate: Sign in to participate in the conversation
|
sign_in_to_participate: Sign in to participate in the conversation
|
||||||
strip_formatting:
|
|
||||||
all: All
|
|
||||||
all_long: Strip all advanced formatting
|
|
||||||
blocks: Block elements
|
|
||||||
blocks_long: Strip formatting for title headers and block quotes
|
|
||||||
none: None
|
|
||||||
none_long: Do not strip any formatting supported by Mastodon
|
|
||||||
title: '%{name}: "%{quote}"'
|
title: '%{name}: "%{quote}"'
|
||||||
visibilities:
|
visibilities:
|
||||||
direct: Direct
|
direct: Direct
|
||||||
|
|
|
@ -211,7 +211,6 @@ en-DG:
|
||||||
setting_noindex: Opt-out of search engine indexing
|
setting_noindex: Opt-out of search engine indexing
|
||||||
setting_reduce_motion: Reduce motion in animations
|
setting_reduce_motion: Reduce motion in animations
|
||||||
setting_show_application: Disclose application used to send toots
|
setting_show_application: Disclose application used to send toots
|
||||||
setting_strip_formatting: Strip formatting
|
|
||||||
setting_system_font_ui: Use system's default font
|
setting_system_font_ui: Use system's default font
|
||||||
setting_theme: Site theme
|
setting_theme: Site theme
|
||||||
setting_trends: Show today's trends
|
setting_trends: Show today's trends
|
||||||
|
|
|
@ -211,7 +211,6 @@ en-LN:
|
||||||
setting_noindex: Opt-out of search engine indexing
|
setting_noindex: Opt-out of search engine indexing
|
||||||
setting_reduce_motion: Reduce motion in animations
|
setting_reduce_motion: Reduce motion in animations
|
||||||
setting_show_application: Disclose application used to send toots
|
setting_show_application: Disclose application used to send toots
|
||||||
setting_strip_formatting: Strip formatting
|
|
||||||
setting_system_font_ui: Use system's default font
|
setting_system_font_ui: Use system's default font
|
||||||
setting_theme: Site theme
|
setting_theme: Site theme
|
||||||
setting_trends: Show today's trends
|
setting_trends: Show today's trends
|
||||||
|
|
|
@ -211,7 +211,6 @@ en-SQ:
|
||||||
setting_noindex: Opt-out of search engine indexing
|
setting_noindex: Opt-out of search engine indexing
|
||||||
setting_reduce_motion: Reduce motion in animations
|
setting_reduce_motion: Reduce motion in animations
|
||||||
setting_show_application: Disclose application used to send toots
|
setting_show_application: Disclose application used to send toots
|
||||||
setting_strip_formatting: Strip formatting
|
|
||||||
setting_system_font_ui: Use system's default font
|
setting_system_font_ui: Use system's default font
|
||||||
setting_theme: Site theme
|
setting_theme: Site theme
|
||||||
setting_trends: Show today's trends
|
setting_trends: Show today's trends
|
||||||
|
|
|
@ -20,7 +20,6 @@ defaults: &defaults
|
||||||
trends: true
|
trends: true
|
||||||
trends_as_landing_page: true
|
trends_as_landing_page: true
|
||||||
trendable_by_default: false
|
trendable_by_default: false
|
||||||
strip_formatting: 'none'
|
|
||||||
reserved_usernames:
|
reserved_usernames:
|
||||||
- admin
|
- admin
|
||||||
- support
|
- support
|
||||||
|
|
|
@ -22,7 +22,6 @@ class MoveUserSettings < ActiveRecord::Migration[6.1]
|
||||||
disable_swiping: 'web.disable_swiping',
|
disable_swiping: 'web.disable_swiping',
|
||||||
show_application: 'show_application',
|
show_application: 'show_application',
|
||||||
system_font_ui: 'web.use_system_font',
|
system_font_ui: 'web.use_system_font',
|
||||||
strip_formatting: 'strip_formatting',
|
|
||||||
aggregate_reblogs: 'aggregate_reblogs',
|
aggregate_reblogs: 'aggregate_reblogs',
|
||||||
advanced_layout: 'web.advanced_layout',
|
advanced_layout: 'web.advanced_layout',
|
||||||
use_blurhash: 'web.use_blurhash',
|
use_blurhash: 'web.use_blurhash',
|
||||||
|
|
|
@ -81,10 +81,7 @@ class Sanitize
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
protocols: {
|
protocols: {},
|
||||||
'a' => { 'href' => HTTP_PROTOCOLS },
|
|
||||||
'blockquote' => { 'cite' => HTTP_PROTOCOLS },
|
|
||||||
},
|
|
||||||
|
|
||||||
transformers: [
|
transformers: [
|
||||||
CLASS_WHITELIST_TRANSFORMER,
|
CLASS_WHITELIST_TRANSFORMER,
|
||||||
|
|
Loading…
Reference in a new issue