Skip to content

Commit 7d0ec2c

Browse files
authored
Update test.html
1 parent f7220a5 commit 7d0ec2c

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

test.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,11 @@ <h2>輸入法模式:</h2>
449449
',': '<', '.': '>', '/': '?',
450450
};
451451

452+
const fullWidthDigits = {
453+
'1': '1', '2': '2', '3': '3', '4': '4', '5': '5',
454+
'6': '6', '7': '7', '8': '8', '9': '9', '0': '0'
455+
};
456+
452457
const textOutput = document.getElementById('text-output');
453458
const mainInput = document.getElementById('main-input');
454459
const candidateDisplay = document.getElementById('candidate-display');
@@ -754,7 +759,8 @@ <h2>輸入法模式:</h2>
754759

755760
displayedCandidates.forEach((candidate, index) => {
756761
const span = document.createElement('span');
757-
const displayIndex = (index === 9) ? '0' : (index + 1).toString();
762+
const digit = (index === 9) ? '0' : (index + 1).toString();
763+
const displayIndex = fullWidthDigits[digit] || digit;
758764
span.textContent = `${displayIndex}. ${candidate}`;
759765
span.style.cursor = 'pointer';
760766
span.style.userSelect = 'none';
@@ -962,8 +968,9 @@ <h2>輸入法模式:</h2>
962968
// 第一個字不顯示數字
963969
suffix = '';
964970
} else if (index < 9) {
965-
// 第二個到第九個顯示數字
966-
suffix = (index + 1).toString();
971+
// 第二個到第九個顯示全形數字
972+
const digit = (index + 1).toString();
973+
suffix = fullWidthDigits[digit];
967974
} else if (index === 9) {
968975
// 第十個顯示全形零
969976
suffix = '0';

0 commit comments

Comments
 (0)