Skip to content

Commit

Permalink
fix(frontend): 장식 추가로 일부 태그를 추가할 수 없음
Browse files Browse the repository at this point in the history
  • Loading branch information
noridev committed Jan 8, 2024
1 parent 4aa054e commit 425fc4a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG_CHERRYPICK.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ Misskey의 전체 변경 사항을 확인하려면, [CHANGELOG.md#2023xx](CHANGE
# 릴리즈 노트
이 문서는 CherryPick의 변경 사항만 포함합니다.

## 4.x.x
출시일: unreleased<br>
기반 Misskey 버전: 2023.x.x<br>
Misskey의 전체 변경 사항을 확인하려면, [CHANGELOG.md#2023xx](CHANGELOG.md#2023xx) 문서를 참고하십시오.

### Client
- Fix: 장식 추가로 일부 태그를 추가할 수 없음

---

## 4.6.0
출시일: 2024/1/08<br>
기반 Misskey 버전: 2023.12.2<br>
Expand Down
6 changes: 3 additions & 3 deletions packages/frontend/src/scripts/mfm-function-picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function add(textArea: HTMLInputElement | HTMLTextAreaElement, textRef: Ref<stri
if (tag === 'center') textRef.value = `${textRef.value.substring(0, caretStart)}<center></center>${textRef.value.substring(caretEnd)}`;
if (tag === 'plain') textRef.value = `${textRef.value.substring(0, caretStart)}<plain></plain>${textRef.value.substring(caretEnd)}`;
if (tag === 'inlinecode') textRef.value = textRef.value.substring(0, caretStart) + '``' + textRef.value.substring(caretEnd);
if (tag === 'inlineblock') textRef.value = textRef.value.substring(0, caretStart) + '```' + '\n' + '\n' + '```' + textRef.value.substring(caretEnd);
if (tag === 'blockcode') textRef.value = textRef.value.substring(0, caretStart) + '```' + '\n' + '\n' + '```' + textRef.value.substring(caretEnd);
if (tag === 'mathinline') textRef.value = textRef.value.substring(0, caretStart) + '\\(\\)' + textRef.value.substring(caretEnd);
if (tag === 'mathblock') textRef.value = textRef.value.substring(0, caretStart) + '\\(\\\\ \\)' + textRef.value.substring(caretEnd);
} else {
Expand All @@ -83,7 +83,7 @@ function add(textArea: HTMLInputElement | HTMLTextAreaElement, textRef: Ref<stri
if (tag === 'center') textRef.value = `${textRef.value.substring(0, caretStart)}<center>${textRef.value.substring(caretStart, caretEnd)}</center>${textRef.value.substring(caretEnd)}`;
if (tag === 'plain') textRef.value = `${textRef.value.substring(0, caretStart)}<plain>${textRef.value.substring(caretStart, caretEnd)}</plain>${textRef.value.substring(caretEnd)}`;
if (tag === 'inlinecode') textRef.value = textRef.value.substring(0, caretStart) + '`' + textRef.value.substring(caretStart, caretEnd) + '`' + textRef.value.substring(caretEnd);
if (tag === 'inlineblock') textRef.value = textRef.value.substring(0, caretStart) + '```' + '\n' + textRef.value.substring(caretStart, caretEnd) + '\n' + '```' + textRef.value.substring(caretEnd);
if (tag === 'blockcode') textRef.value = textRef.value.substring(0, caretStart) + '```' + '\n' + textRef.value.substring(caretStart, caretEnd) + '\n' + '```' + textRef.value.substring(caretEnd);
if (tag === 'mathinline') textRef.value = textRef.value.substring(0, caretStart) + '\\(' + textRef.value.substring(caretStart, caretEnd) + '\\)' + textRef.value.substring(caretEnd);
if (tag === 'mathblock') textRef.value = textRef.value.substring(0, caretStart) + '\\(' + textRef.value.substring(caretStart, caretEnd) + '\\\\ \\)' + textRef.value.substring(caretEnd);
}
Expand All @@ -101,7 +101,7 @@ function add(textArea: HTMLInputElement | HTMLTextAreaElement, textRef: Ref<stri
? 2
: type.includes('inlinecode')
? -9
: type.includes('inlineblock')
: type.includes('blockcode')
? -5
: type.includes('mathinline')
? -8
Expand Down

0 comments on commit 425fc4a

Please sign in to comment.