Dave Jarvis' Repositories

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

Spellcheck upon opening file, code clean up

AuthorDaveJarvis <email>
Date2020-07-05 16:43:20 GMT-0700
Commit858310f4a4dec063d4f88f486251e0808a168191
Parent5809075
Delta7 lines added, 2 lines removed, 5-line increase
src/main/java/com/scrivenvar/processors/markdown/ImageLinkExtension.java
// If the direct file name exists, then use it directly.
if( Path.of( url ).toFile().exists() ) {
- return link.withStatus( LinkStatus.VALID ).withUrl( url );
+ return valid( link, url );
}
} catch( final Exception ignored ) {
+ // Try to dynamically resolve the image.
}
getNotifier().clear();
- return link.withStatus( LinkStatus.VALID ).withUrl( url );
+ return valid( link, url );
} catch( final Exception e ) {
getNotifier().notify( "File not found: " + e.getLocalizedMessage() );
}
return link;
+ }
+
+ private ResolvedLink valid( final ResolvedLink link, final String url ) {
+ return link.withStatus( LinkStatus.VALID ).withUrl( url );
}