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

メンションの前に:がつくとメンションできない問題を修正 #4399

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
上手く置換されないパターンを潰した
nokhnaton committed Oct 28, 2024
commit 20d1bf3302b9475bb92f81575e1d64b534595d63
4 changes: 3 additions & 1 deletion src/lib/markdown/internalLinkEmbedder.ts
Original file line number Diff line number Diff line change
@@ -2,7 +2,8 @@
* https://github.com/traPtitech/traQ/blob/master/utils/message/replacer.goと同様
*/

const mentionRegex = /:?[@@]([^\s@@]{0,31}[^\s@@:]:?)/g
const mentionRegex =
/([@@]([^\s@@]{0,31}[^\s@@:]))|(:[@@]([^\s@@]{0,31}[^\s@@:]:))/g
const userStartsRegex = /^[@@]([a-zA-Z0-9_-]{1,32})/g
const channelRegex = /[##]([a-zA-Z0-9_/-]+)/g

@@ -114,6 +115,7 @@

const replaceMention = (m: string, getters: Readonly<UserAndGroupGetters>) => {
return m.replace(mentionRegex, s => {
console.log(s)

Check warning on line 118 in src/lib/markdown/internalLinkEmbedder.ts

GitHub Actions / run lint

Unexpected console statement
const isStartsWithColon = s.startsWith(':')

// 始まりと終わりが:なものを除外

Unchanged files with check annotations Beta

FROM --platform=$BUILDPLATFORM node:22.9.0-alpine as build

Check warning on line 1 in Dockerfile

GitHub Actions / Build Preview Image

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
WORKDIR /app
ENV CYPRESS_INSTALL_BINARY=0
COPY --from=build /app/dist /usr/share/caddy
ENV APP_NAME traQ

Check warning on line 22 in Dockerfile

GitHub Actions / Build Preview Image

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
ENV THEME_COLOR #0D67EA

Check warning on line 23 in Dockerfile

GitHub Actions / Build Preview Image

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
# 設定上書き処理用に、.brを消して、元の設定を別のディレクトリに保存しておく
RUN cd /usr/share/caddy && \