forked from AkkomaGang/akkoma-fe
Polls: Construct an html field during normalization.
This commit is contained in:
parent
7de56a8063
commit
d41c9a717c
2 changed files with 13 additions and 1 deletions
|
@ -17,7 +17,7 @@
|
|||
<span class="result-percentage">
|
||||
{{ percentageForOption(option.votes_count) }}%
|
||||
</span>
|
||||
<span>{{ option.title }}</span>
|
||||
<span v-html="option.title_html"></span>
|
||||
</div>
|
||||
<div
|
||||
class="result-fill"
|
||||
|
@ -75,6 +75,12 @@
|
|||
@import '../../_variables.scss';
|
||||
|
||||
.poll {
|
||||
img.emoji {
|
||||
vertical-align: middle;
|
||||
object-fit: contain;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
.votes {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
|
|
@ -258,6 +258,12 @@ export const parseStatus = (data) => {
|
|||
output.summary_html = addEmojis(escape(data.spoiler_text), data.emojis)
|
||||
output.external_url = data.url
|
||||
output.poll = data.poll
|
||||
if (output.poll) {
|
||||
output.poll.options = (output.poll.options || []).map(field => {
|
||||
field.title_html = addEmojis(field.title, data.emojis)
|
||||
return field
|
||||
})
|
||||
}
|
||||
output.pinned = data.pinned
|
||||
output.muted = data.muted
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue