Merge branch 'kb_development' into kb_migration
This commit is contained in:
commit
3e1b4108ed
6 changed files with 84 additions and 5 deletions
|
@ -515,7 +515,9 @@ class Status extends ImmutablePureComponent {
|
|||
let emojiReactionsBar = null;
|
||||
if (!this.props.withoutEmojiReactions && status.get('emoji_reactions')) {
|
||||
const emojiReactions = status.get('emoji_reactions');
|
||||
emojiReactionsBar = <StatusEmojiReactionsBar emojiReactions={emojiReactions} status={status} onEmojiReact={this.props.onEmojiReact} onUnEmojiReact={this.props.onUnEmojiReact} />;
|
||||
if (emojiReactions.size > 0) {
|
||||
emojiReactionsBar = <StatusEmojiReactionsBar emojiReactions={emojiReactions} status={status} onEmojiReact={this.props.onEmojiReact} onUnEmojiReact={this.props.onUnEmojiReact} />;
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
@ -6,6 +6,7 @@ import Icon from 'mastodon/components/icon';
|
|||
const tooltips = defineMessages({
|
||||
mentions: { id: 'notifications.filter.mentions', defaultMessage: 'Mentions' },
|
||||
favourites: { id: 'notifications.filter.favourites', defaultMessage: 'Favourites' },
|
||||
emojiReactions: { id: 'notifications.filter.emoji_reactions', defaultMessage: 'Emoji reactions' },
|
||||
boosts: { id: 'notifications.filter.boosts', defaultMessage: 'Boosts' },
|
||||
polls: { id: 'notifications.filter.polls', defaultMessage: 'Poll results' },
|
||||
follows: { id: 'notifications.filter.follows', defaultMessage: 'Follows' },
|
||||
|
@ -79,7 +80,7 @@ class FilterBar extends React.PureComponent {
|
|||
onClick={this.onClick('emoji_reaction')}
|
||||
title={intl.formatMessage(tooltips.emojiReactions)}
|
||||
>
|
||||
<Icon id='star' fixedWidth />
|
||||
<Icon id='smile-o' fixedWidth />
|
||||
</button>
|
||||
<button
|
||||
className={selectedFilter === 'reblog' ? 'active' : ''}
|
||||
|
|
|
@ -197,7 +197,9 @@ class DetailedStatus extends ImmutablePureComponent {
|
|||
let emojiReactionsBar = null;
|
||||
if (status.get('emoji_reactions')) {
|
||||
const emojiReactions = status.get('emoji_reactions');
|
||||
emojiReactionsBar = <StatusEmojiReactionsBar emojiReactions={emojiReactions} status={status} onEmojiReact={this.props.onEmojiReact} onUnEmojiReact={this.props.onUnEmojiReact} />;
|
||||
if (emojiReactions.size > 0) {
|
||||
emojiReactionsBar = <StatusEmojiReactionsBar emojiReactions={emojiReactions} status={status} onEmojiReact={this.props.onEmojiReact} onUnEmojiReact={this.props.onUnEmojiReact} />;
|
||||
}
|
||||
}
|
||||
|
||||
if (status.get('application')) {
|
||||
|
|
|
@ -1269,7 +1269,7 @@ body > [data-popper-placement] {
|
|||
margin: 8px 0 2px 4px;
|
||||
|
||||
.emoji-reactions-bar__button {
|
||||
background: lighten($ui-base-color, 16%);
|
||||
background: lighten($ui-base-color, 12%);
|
||||
border: 0;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
.account__header__bio,
|
||||
.status__content__text,
|
||||
.e-content,
|
||||
.reply-indicator__content {
|
||||
|
@ -12,6 +13,32 @@
|
|||
}
|
||||
}
|
||||
|
||||
code, pre {
|
||||
border: 1px solid $ui-primary-color;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
code {
|
||||
margin: 0 4px;
|
||||
}
|
||||
|
||||
pre {
|
||||
padding: 4px 8px;
|
||||
|
||||
span.ellipsis::after {
|
||||
content: "";
|
||||
}
|
||||
|
||||
span.invisible {
|
||||
display: inline;
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
width: inherit;
|
||||
height: inherit;
|
||||
position: static;
|
||||
}
|
||||
}
|
||||
|
||||
blockquote {
|
||||
padding-left: 10px;
|
||||
border-left: 3px solid $darker-text-color;
|
||||
|
|
|
@ -43,7 +43,13 @@ class TextFormatter
|
|||
end
|
||||
end
|
||||
|
||||
html = simple_format(html, {}, sanitize: false).delete("\n") if multiline?
|
||||
# line first letter for blockquote
|
||||
p 'DEBUG ' + html.gsub(/^gt;/, '>')
|
||||
html = markdownify(html.gsub(/^>/, '>'))
|
||||
|
||||
# html = simple_format(html, {}, sanitize: false).delete("\n") if multiline?
|
||||
html = html.delete("\n")
|
||||
p html
|
||||
|
||||
html.html_safe # rubocop:disable Rails/OutputSafety
|
||||
end
|
||||
|
@ -155,4 +161,45 @@ class TextFormatter
|
|||
def preloaded_accounts?
|
||||
preloaded_accounts.present?
|
||||
end
|
||||
|
||||
def markdownify(html)
|
||||
# not need filter_html because escape is already done
|
||||
@htmlobj ||= MyMarkdownHTML.new(
|
||||
filter_html: false,
|
||||
hard_wrap: true
|
||||
)
|
||||
@markdown ||= Redcarpet::Markdown.new(@htmlobj,
|
||||
autolink: false,
|
||||
tables: false,
|
||||
underline: true,
|
||||
disable_indented_code_blocks: false,
|
||||
fenced_code_blocks: true,
|
||||
highlight: false
|
||||
)
|
||||
@markdown.render(html)
|
||||
end
|
||||
|
||||
class MyMarkdownHTML < Redcarpet::Render::HTML
|
||||
def link(link, title, content)
|
||||
nil
|
||||
end
|
||||
|
||||
def block_code(code, language)
|
||||
"<pre>#{process_program_code(code)}</pre>"
|
||||
end
|
||||
|
||||
def codespan(code)
|
||||
"<code>#{process_program_code(code)}</code>"
|
||||
end
|
||||
|
||||
def header(text, header_level)
|
||||
"<p>#{text}</p>"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def process_program_code(code)
|
||||
code.gsub(/\n/, '<br>')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue