|
|
@@ -563,7 +563,11 @@ export const RichTextToolbar: React.FC<RichTextToolbarProps> = ({
|
|
563
|
563
|
const toggleFormat = useCallback((tagName: string) => {
|
|
564
|
564
|
if (isTableMode && tableContext) {
|
|
565
|
565
|
// 表格模式:切换单元格样式
|
|
566
|
|
- const styleKey = tagName === 'strong' ? 'bold' : tagName === 'em' ? 'italic' : 'underline';
|
|
|
566
|
+ const tagLower = tagName.toLowerCase();
|
|
|
567
|
+ const styleKey = tagLower === 'strong' || tagLower === 'b' ? 'bold'
|
|
|
568
|
+ : tagLower === 'em' || tagLower === 'i' ? 'italic'
|
|
|
569
|
+ : 'underline';
|
|
|
570
|
+
|
|
567
|
571
|
const currentValue = styleKey === 'bold'
|
|
568
|
572
|
? allSelectedCellsHaveBold
|
|
569
|
573
|
: styleKey === 'italic'
|