Skip to content

Commit

Permalink
1.220.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectricS01 committed Oct 28, 2024
1 parent 975809b commit f75fc5d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/assets/stile.css
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,8 @@ input {
background-color: #2627dc80;
}

ul {
ul,
ol {
margin: 0;
}

Expand Down
24 changes: 16 additions & 8 deletions src/components/CustomMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
@click="handleClick(part)"
>
<span v-if="check(index)" v-html="part" />
<span
v-if="!check(index)"
v-markdown
style="word-wrap: break-word; white-space: pre-wrap"
>
<span v-if="!check(index)" v-markdown class="custom-message">
{{ part }}
</span>
</span>
Expand Down Expand Up @@ -60,9 +56,9 @@ let editShownPosition = { x: 0, y: 0 }
const check = (index) => {
const parts = props.message.messageContents
.split(/(<@\d+>)/g)
.split(/(\n|<@\d+>)/g)
.filter((part) => part !== "")
if (parts[index].startsWith("<@")) {
if (parts[index].startsWith("<@") || parts[index] === "\n") {
return true
}
}
Expand All @@ -84,16 +80,28 @@ const showEdited = () => {
const messageParts = computed(() => {
const parts = props.message.messageContents
.split(/(<@\d+>)/g)
.split(/(\n|<@\d+>)/g)
.filter((part) => part !== "")
return parts.map((part) => {
if (part.startsWith("<@")) {
const userId = part.match(/\d+/)[0]
return `<span @click="handleUserMentionClick(${userId})" class="mention">@${
props.findUser(userId).username
}</span>`
} else if (part === "\n") {
return "<br />"
}
return part
})
})
</script>

<style>
.custom-message {
ul,
ol {
padding: 0;
margin: 4px 0 4px 16px;
}
}
</style>
7 changes: 6 additions & 1 deletion src/views/BetterComms/Account.vue
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@
<router-link to="/">ElectricS01</router-link>
</div>
<div class="settings-spacer" />
<div>Version: 1.220.2</div>
<div>Version: 1.220.3</div>
<div class="settings-spacer" />
<div>Backend name: {{ serverName }}</div>
</div>
Expand Down Expand Up @@ -953,6 +953,11 @@
<li>Update Collider to latest version</li>
</ul>
<div class="settings-spacer" />
<h2 class="settings-text">1.174 User Profile Links</h2>
<div class="settings-spacer" />
<ul>
<li v-markdown>Users can now share their User Profile with the new `/user/:id` route</li>
</ul>
</div>
<div v-else-if="page === 'admin'" class="settings-page-container">
<h2 class="settings-text">Admin panel</h2>
Expand Down

0 comments on commit f75fc5d

Please sign in to comment.