Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

チャンネルとメンションのフロントでの埋込み置換をやめる #4379

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { ChannelId } from '/@/types/entity-ids'
import apis, { buildFilePathForPost, formatResizeError } from '/@/lib/apis'
import { replace as embedInternalLink } from '/@/lib/markdown/internalLinkEmbedder'
import useChannelPath from '/@/composables/useChannelPath'
import { computed, ref, unref } from 'vue'
import { nullUuid } from '/@/lib/basic/uuid'
Expand Down Expand Up @@ -93,23 +92,10 @@ const usePostMessage = (
bothChannelsMapInitialFetchPromise.value
])

const embededText = embedInternalLink(state.text, {
getUser: findUserByName,
getGroup: getUserGroupByName,
getChannel: path => {
try {
const id = channelPathToId(path.split('/'), channelTree.value)
return { id }
} catch {
return undefined
}
}
})

const dummyFileUrls = state.attachments.map(() =>
buildFilePathForPost(nullUuid)
)
const dummyText = createContent(embededText, dummyFileUrls)
const dummyText = createContent(state.text, dummyFileUrls)
if (countLength(dummyText) > MESSAGE_MAX_LENGTH) {
addErrorToast('メッセージが長すぎます')
return
Expand All @@ -124,7 +110,7 @@ const usePostMessage = (
})

await apis.postMessage(cId, {
content: createContent(embededText, fileUrls)
content: createContent(state.text, fileUrls)
})

clearState()
Expand Down
168 changes: 0 additions & 168 deletions src/lib/markdown/internalLinkEmbedder.ts

This file was deleted.

124 changes: 0 additions & 124 deletions tests/unit/lib/markdown/internalLinkEmbedder.spec.ts

This file was deleted.

Loading