Closed Daniyar111 closed 1 year ago
I'm not sure if it's what you were asking for but to get the font size, if it's set as text style, use editor.getAttributes('textStyle').fontSize
.
Please let me know if this is not the answer you are looking for.
In my case the, font size is set as a style but when i try to get it by the following query
editor?.getAttributes("style")
It returns {}
.
Any update on this?
In my case the, font size is set as a style but when i try to get it by the following query
editor?.getAttributes("style")
It returns{}
.Any update on this?
The getAttributes method expects a NodeType or MarkType as an argument (https://tiptap.dev/docs/editor/api/editor#getattributes). That's why your query does not work, there is no such NodeType/MarkType as "style". Please check the previous answer, it should work for you.
What problem are you facing?
I wrote the extension which
setFontSize(value)
, but I need the function which gives fontSizegetFontSize
.. I found someone has been already asked this question, but no any correct answerWhat’s the solution you would like to see?
Is there any idea to make it like:
What alternatives did you consider?
I found just this solution ->
this.editor.isActive('textStyle', { fontSize: 14 })
, but this is not what I needAnything to add? (optional)
No response
Are you sponsoring us?