Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/components/NewMessage/NewMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,14 @@ export default {
}
}

// FIXME upstream: https://github.com/nextcloud-libraries/nextcloud-vue/issues/4492
if (this.hasText) {
const temp = document.createElement('textarea')
temp.innerHTML = this.text.replace(/&/gmi, '&')
this.text = temp.value.replace(/&amp;/gmi, '&').replace(/&lt;/gmi, '<')
.replace(/&gt;/gmi, '>').replace(/&sect;/gmi, '§')
}

if (this.upload) {
// Clear input content from store
this.$store.dispatch('setCurrentMessageInput', { token: this.token, text: '' })
Expand All @@ -521,12 +529,6 @@ export default {
}

if (this.hasText) {
// FIXME upstream: https://github.com/nextcloud-libraries/nextcloud-vue/issues/4492
const temp = document.createElement('textarea')
temp.innerHTML = this.text.replace(/&/gmi, '&amp;')
this.text = temp.value.replace(/&amp;/gmi, '&').replace(/&lt;/gmi, '<')
.replace(/&gt;/gmi, '>').replace(/&sect;/gmi, '§')

const temporaryMessage = await this.$store.dispatch('createTemporaryMessage', {
text: this.text.trim(),
token: this.token,
Expand Down
21 changes: 14 additions & 7 deletions src/components/Quote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ components.
disable-menu />
{{ getDisplayName }}
</div>
<div v-if="isFileShareMessage"
class="quote__main__text">
<NcRichText :text="message"
:arguments="richParameters"
:autolink="true" />
</div>
<blockquote v-else
<!-- file preview-->
<NcRichText v-if="isFileShareMessage"
text="{file}"
class="quote__file-preview"
:arguments="richParameters" />
<!-- text -->
<blockquote v-if="!isFileShareWithoutCaption"
class="quote__main__text">
<p dir="auto">{{ shortenedQuoteMessage }}</p>
</blockquote>
Expand Down Expand Up @@ -175,6 +175,10 @@ export default {
return Object.keys(Object(this.messageParameters)).some(key => key.startsWith('file'))
},

isFileShareWithoutCaption() {
return this.isFileShareMessage && this.message === '{file}'
},

richParameters() {
const richParameters = {}
Object.keys(this.messageParameters).forEach(function(p) {
Expand Down Expand Up @@ -324,6 +328,9 @@ export default {
position: relative;
margin: auto;
}
&__file-preview {
line-height: 0.5 !important;
}
}

</style>