Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/keenwrite.git

Use new instanceof syntax

AuthorDaveJarvis <email>
Date2021-05-23 10:28:24 GMT-0700
Commit97e93dfa4a9ac75bd96b76302946a46fef287d41
Parent6fab3f2
Delta12 lines added, 2 lines removed, 10-line increase
src/main/resources/com/keenwrite/preview/webview.css
}
+/* EMAIL ***/
+div.email {
+ padding: 0 1.5em;
+ text-align: left;
+ text-indent: 0;
+ border-style: solid;
+ border-width: 0.05em;
+ border-radius: .25em;
+ background-color: #f8f8f8;
+}
+
src/main/java/com/keenwrite/preview/DomConverter.java
@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 ) );
}