1-
21import type { EditorState } from "@codemirror/state" ;
32import { Decoration } from "@codemirror/view" ;
43import type { Client } from "../client.ts" ;
5- import { fileName , isBuiltinPath } from "@silverbulletmd/silverbullet/lib/resolve" ;
4+ import {
5+ fileName ,
6+ isBuiltinPath ,
7+ } from "@silverbulletmd/silverbullet/lib/resolve" ;
68import {
79 encodePageURI ,
810 encodeRef ,
@@ -30,9 +32,10 @@ export interface WikiLinkProcessorOptions {
3032}
3133
3234export function processWikiLink ( options : WikiLinkProcessorOptions ) : any [ ] {
33- const { from, to, match, matchFrom, matchTo, client, state, callback } = options ;
35+ const { from, to, match, matchFrom, matchTo, client, state, callback } =
36+ options ;
3437 const widgets : any [ ] = [ ] ;
35-
38+
3639 const { leadingTrivia, stringRef, alias, trailingTrivia } = match ;
3740 const ref = parseToRef ( stringRef ) ;
3841
@@ -43,7 +46,9 @@ export function processWikiLink(options: WikiLinkProcessorOptions): any[] {
4346 } else if ( ref . path === "" || isBuiltinPath ( ref . path ) ) {
4447 linkStatus = "default" ;
4548 } else if (
46- Array . from ( client . clientSystem . allKnownFiles ) . some ( ( file ) => file === ref . path )
49+ Array . from ( client . clientSystem . allKnownFiles ) . some ( ( file ) =>
50+ file === ref . path
51+ )
4752 ) {
4853 linkStatus = "default" ;
4954 } else if ( client . fullSyncCompleted || client . clientSystem . knownFilesLoaded ) {
@@ -57,7 +62,7 @@ export function processWikiLink(options: WikiLinkProcessorOptions): any[] {
5762 } [ linkStatus ] ;
5863
5964 const renderingSyntax = client . ui . viewState . uiOptions . markdownSyntaxRendering ;
60-
65+
6166 if ( isCursorInRange ( state , [ from , to ] ) || renderingSyntax ) {
6267 // Only attach a CSS class, then get out
6368 if ( linkStatus !== "default" ) {
0 commit comments