| | @Override |
| | public void head( final Node node, final int depth ) { |
| | - if( node instanceof TextNode ) { |
| | + if( node instanceof final TextNode textNode ) { |
| | final var parent = node.parentNode(); |
| | final var name = parent == null ? "root" : parent.nodeName(); |
| | |
| | if( !("pre".equalsIgnoreCase( name ) || |
| | "code".equalsIgnoreCase( name ) || |
| | "tt".equalsIgnoreCase( name )) ) { |
| | // Calling getWholeText() will return newlines, which must be kept |
| | // to ensure that preformatted text maintains its formatting. |
| | - final var textNode = (TextNode) node; |
| | textNode.text( replace( textNode.getWholeText(), LIGATURES ) ); |
| | } |