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)即為替換。

選項

欄位型別預設值說明
HTMLAttributesRecord<string, any>{}渲染輸出時附加之 HTML 屬性
mergeNestedSpanStylesbooleanfalse解析巢狀 span 時是否把外層樣式合併進內層

Commands

Command說明
removeEmptyTextStyle()移除不帶任何樣式屬性的空 textStyle mark