Replies: 1 comment
-
After searching a code base, I found out that shiki exports |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm currently building a code block extension for Tiptap using Shiki as a syntax highlighter.
To map shiki's tokens to prosemirror decorations, I'm using
codeToTokens
method that returns stream ofThemedToken
s.One of the property of
ThemedToken
is afontStyle
, which indeed has type signature ofFontStyle
enum.FontStyle
enum has following 5 members:NotSet
,None
,Italic
,Bold
,Underline
. Last three values' meaning are clear, but I'm not sure what doesNotSet
andNone
means.Currently I'm assuming that
NotSet
means the font style is not defined, so the renderer should not set any font style properties and let the node naturally inherits the styles from its parent. AndNone
means that the font style is literally "none", so the renderer should reset the corresponding font style properties to their default values which forces node renders as a normal text even if the parent node's font style isBold
orItalic
or something.I'm attaching the code that I'm using now for a better understanding.
Beta Was this translation helpful? Give feedback.
All reactions