TextKit2 textContentManager(_:shouldEnumerate:options:) leaves gaps in layout

Returning false from NSTextContentManagerDelegate.textContentManager(_:shouldEnumerate:options:) produces huge gaps in my layout instead of showing a continuous block of text.

Instead of omiting the layout of the hidden element, there is a blank space that shows that appears to have the same size in layout as the omitted text element.

Why is this happening and how can I prevent this?

Example:

Really? I can't believe nobody has this issue. It literally still happens just by returning false for some paragraphs from textContentManager(:shouldEnumerate:options:) -> Bool

TextKit2 textContentManager(_:shouldEnumerate:options:) leaves gaps in layout
 
 
Q