AIO 編輯器
TextStyle
文字樣式載體 mark。
以 span 承載行內樣式屬性的基底 mark——Color、FontFamily、FontSize 都把樣式掛在此 mark 上,停用它會連帶使三者失效。
- config key:
AioEditorCoreExtension.TextStyle - 來源:
@tiptap/extension-text-style
載入途徑:跟隨 features 宣告:FontSizeSelect、FontSizeIncrease、FontSizeDecrease、FontFamily、TextColor。按鈕未宣告但要保留能力 → include: [AioEditorCoreExtension.TextStyle]。
排除影響(exclude: [TextStyle]): 依賴它的 Color、FontFamily、FontSize 功能將靜默失效; 以 extraExtensions 補上同名 extension(textStyle)即為替換。
選項
| 欄位 | 型別 | 預設值 | 說明 |
|---|---|---|---|
HTMLAttributes | Record<string, any> | {} | 渲染輸出時附加之 HTML 屬性 |
mergeNestedSpanStyles | boolean | false | 解析巢狀 span 時是否把外層樣式合併進內層 |
Commands
| Command | 說明 |
|---|---|
removeEmptyTextStyle() | 移除不帶任何樣式屬性的空 textStyle mark |