kopia lustrzana https://github.com/nextcloud/social
Uses the 'he' library to decode HTML entities form composer's content.
Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>pull/597/head
rodzic
5303d2692b
commit
a1d2489332
|
@ -35,6 +35,7 @@
|
|||
"nextcloud-auth": "0.0.3",
|
||||
"tributejs": "^3.7.3",
|
||||
"twemoji": "^12.0.1",
|
||||
"he": "^1.2.0",
|
||||
"uuid": "^3.3.3",
|
||||
"v-tooltip": "^3.0.0-alpha.11",
|
||||
"vue": "^2.6.10",
|
||||
|
|
|
@ -392,6 +392,7 @@ import Avatar from 'nextcloud-vue/dist/Components/Avatar'
|
|||
import PopoverMenu from 'nextcloud-vue/dist/Components/PopoverMenu'
|
||||
import EmojiPicker from 'vue-emoji-picker'
|
||||
import VueTribute from 'vue-tribute'
|
||||
import he from 'he'
|
||||
import CurrentUserMixin from './../mixins/currentUserMixin'
|
||||
import FocusOnCreate from '../directives/focusOnCreate'
|
||||
import axios from 'nextcloud-axios'
|
||||
|
@ -757,8 +758,9 @@ export default {
|
|||
}
|
||||
} while (match)
|
||||
|
||||
// Remove all html tags but <br>
|
||||
let content = element.innerHTML.replace(/<(?!br\s*\/?)[^>]+>/gi, '').replace(/<br\s*\/?>/gi, '\n').trim()
|
||||
// Remove all html tags but </div> (wich we turn in newlines) and decode the remaining html entities
|
||||
let content = contentHtml.replace(/<(?!\/div)[^>]+>/gi, '').replace(/<\/div>/gi, '\n').trim()
|
||||
content = he.decode(content)
|
||||
|
||||
let data = {
|
||||
content: content,
|
||||
|
|
Ładowanie…
Reference in New Issue