AztecEditor-iOS
AztecEditor-iOS copied to clipboard
captionStyler not used
According to the comment here, the captionStyler is a closure that "will be executed whenever the TextView needs to set the base style for a caption". We are told we can "Override this to customize the caption styling."
However, overriding the captionStyler appears to have no effect. In fact, I couldn't find anywhere in the TextView class where captionStyler is even accessed again.
To Reproduce
- Set the
captionStyleron aTextView. - Add an attachment with a caption.
Expected behavior
The caption is styled according to the captionStyler.
Actual Behavior The caption uses the default style.
Also interested to know if there is a different working way to style captions?
After some more looking around, it appears that the caption format is set by the FigcaptionFormatter in apply(to attributes: [NSAttributedStringKey: Any], andStore representation: HTMLRepresentation?), where it is hardcoded to color .gray and size defaultSize - 2.
I can create a custom FigcaptionFormatter subclass and override this function, but I don't see a way use this subclass in the TextView since singleLineParagraphFormatters is private and constant.