Compare commits
1 Commits
80728af574
...
93f0ac2955
Author | SHA1 | Date | |
---|---|---|---|
93f0ac2955 |
@ -1 +0,0 @@
|
|||||||
Fix a bug where mentioning a user twice will not fill the mention into the textarea
|
|
@ -1 +0,0 @@
|
|||||||
Make MentionsLine aware of line breaking by non-br elements
|
|
@ -44,10 +44,6 @@ const PostStatusModal = {
|
|||||||
methods: {
|
methods: {
|
||||||
closeModal () {
|
closeModal () {
|
||||||
this.$store.dispatch('closePostStatusModal')
|
this.$store.dispatch('closePostStatusModal')
|
||||||
},
|
|
||||||
resetAndClose () {
|
|
||||||
this.$store.dispatch('resetPostStatusModal')
|
|
||||||
this.$store.dispatch('closePostStatusModal')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<PostStatusForm
|
<PostStatusForm
|
||||||
class="panel-body"
|
class="panel-body"
|
||||||
v-bind="params"
|
v-bind="params"
|
||||||
@posted="resetAndClose"
|
@posted="closeModal"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
@ -8,27 +8,6 @@ import HashtagLink from 'src/components/hashtag_link/hashtag_link.vue'
|
|||||||
|
|
||||||
import './rich_content.scss'
|
import './rich_content.scss'
|
||||||
|
|
||||||
const MAYBE_LINE_BREAKING_ELEMENTS = [
|
|
||||||
'blockquote',
|
|
||||||
'br',
|
|
||||||
'hr',
|
|
||||||
'ul',
|
|
||||||
'ol',
|
|
||||||
'li',
|
|
||||||
'p',
|
|
||||||
'table',
|
|
||||||
'tbody',
|
|
||||||
'td',
|
|
||||||
'th',
|
|
||||||
'thead',
|
|
||||||
'tr',
|
|
||||||
'h1',
|
|
||||||
'h2',
|
|
||||||
'h3',
|
|
||||||
'h4',
|
|
||||||
'h5'
|
|
||||||
]
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RichContent, The Über-powered component for rendering Post HTML.
|
* RichContent, The Über-powered component for rendering Post HTML.
|
||||||
*
|
*
|
||||||
@ -187,22 +166,25 @@ export default {
|
|||||||
!(children && typeof children[0] === 'string' && children[0].match(/^\s/))
|
!(children && typeof children[0] === 'string' && children[0].match(/^\s/))
|
||||||
? lastSpacing
|
? lastSpacing
|
||||||
: ''
|
: ''
|
||||||
if (MAYBE_LINE_BREAKING_ELEMENTS.includes(Tag)) {
|
switch (Tag) {
|
||||||
// all the elements that can cause a line change
|
case 'br':
|
||||||
currentMentions = null
|
|
||||||
} else if (Tag === 'img') { // replace images with StillImage
|
|
||||||
return ['', [mentionsLinePadding, renderImage(opener)], '']
|
|
||||||
} else if (Tag === 'a' && this.handleLinks) { // replace mentions with MentionLink
|
|
||||||
if (fullAttrs.class && fullAttrs.class.includes('mention')) {
|
|
||||||
// Handling mentions here
|
|
||||||
return renderMention(attrs, children)
|
|
||||||
} else {
|
|
||||||
currentMentions = null
|
currentMentions = null
|
||||||
}
|
break
|
||||||
} else if (Tag === 'span') {
|
case 'img': // replace images with StillImage
|
||||||
if (this.handleLinks && fullAttrs.class && fullAttrs.class.includes('h-card')) {
|
return ['', [mentionsLinePadding, renderImage(opener)], '']
|
||||||
return ['', children.map(processItem), '']
|
case 'a': // replace mentions with MentionLink
|
||||||
}
|
if (!this.handleLinks) break
|
||||||
|
if (fullAttrs.class && fullAttrs.class.includes('mention')) {
|
||||||
|
// Handling mentions here
|
||||||
|
return renderMention(attrs, children)
|
||||||
|
} else {
|
||||||
|
currentMentions = null
|
||||||
|
break
|
||||||
|
}
|
||||||
|
case 'span':
|
||||||
|
if (this.handleLinks && fullAttrs.class && fullAttrs.class.includes('h-card')) {
|
||||||
|
return ['', children.map(processItem), '']
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (children !== undefined) {
|
if (children !== undefined) {
|
||||||
|
@ -10,9 +10,6 @@ const postStatus = {
|
|||||||
},
|
},
|
||||||
closePostStatusModal (state) {
|
closePostStatusModal (state) {
|
||||||
state.modalActivated = false
|
state.modalActivated = false
|
||||||
},
|
|
||||||
resetPostStatusModal (state) {
|
|
||||||
state.params = null
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
@ -21,9 +18,6 @@ const postStatus = {
|
|||||||
},
|
},
|
||||||
closePostStatusModal ({ commit }) {
|
closePostStatusModal ({ commit }) {
|
||||||
commit('closePostStatusModal')
|
commit('closePostStatusModal')
|
||||||
},
|
|
||||||
resetPostStatusModal ({ commit }) {
|
|
||||||
commit('resetPostStatusModal')
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user