@@ -67,31 +67,40 @@ export class TextParsing {
6767
6868 // Remove dataview cleanup keys if defined
6969 if ( this . settings . dataviewCleanupKeys ) {
70- const keys = this . settings . dataviewCleanupKeys . split ( "," ) . map ( key => key . trim ( ) ) ;
70+ const keys = this . settings . dataviewCleanupKeys
71+ . split ( "," )
72+ . map ( ( key ) => key . trim ( ) ) ;
7173 for ( const key of keys ) {
7274 if ( key ) {
7375 // Match any value after the key (including dates, text, tags, etc.)
7476 // Allow spaces around key, ::, and value
7577 // Allow tags (#) in both key and value
76- const keyPattern = new RegExp ( `\\[\\s*(?:#)?${ key } (?:#[^\\s:\\]]+)*\\s*::\\s*([^\\]]*)\\s*\\]` , "g" ) ;
78+ const keyPattern = new RegExp (
79+ `\\[\\s*(?:#)?${ key } (?:#[^\\s:\\]]+)*\\s*::\\s*([^\\]]*)\\s*\\]` ,
80+ "g" ,
81+ ) ;
7782 text = text . replace ( keyPattern , "" ) ;
7883 }
7984 }
8085 }
8186
8287 // Remove Moment.js format patterns if defined
8388 if ( this . settings . momentFormatCleanupPatterns ) {
84- const patterns = this . settings . momentFormatCleanupPatterns . split ( "," ) . map ( pattern => pattern . trim ( ) ) ;
89+ const patterns = this . settings . momentFormatCleanupPatterns
90+ . split ( "," )
91+ . map ( ( pattern ) => pattern . trim ( ) ) ;
8592 for ( const pattern of patterns ) {
8693 if ( pattern ) {
8794 try {
8895 // Extract the prefix (text and emojis in brackets) and the Moment.js format
8996 const prefixMatch = pattern . match ( / ^ \[ ( .* ?) \] / ) ;
9097 const prefix = prefixMatch ? prefixMatch [ 1 ] : "" ;
91- const momentFormat = prefixMatch ? pattern . slice ( prefixMatch [ 0 ] . length ) : pattern ;
98+ const momentFormat = prefixMatch
99+ ? pattern . slice ( prefixMatch [ 0 ] . length )
100+ : pattern ;
92101
93102 // Convert Moment.js format to regex pattern
94- let regexPattern = momentFormat
103+ const regexPattern = momentFormat
95104 . replace ( / Y Y Y Y / g, "\\d{4}" )
96105 . replace ( / M M / g, "\\d{2}" )
97106 . replace ( / D D / g, "\\d{2}" )
@@ -101,13 +110,16 @@ export class TextParsing {
101110 . replace ( / T / g, "T" ) ;
102111
103112 // Create the full pattern with optional prefix
104- const fullPattern = prefix ?
105- new RegExp ( `${ prefix } \\s*${ regexPattern } ` , "g" ) :
106- new RegExp ( regexPattern , "g" ) ;
113+ const fullPattern = prefix
114+ ? new RegExp ( `${ prefix } \\s*${ regexPattern } ` , "g" )
115+ : new RegExp ( regexPattern , "g" ) ;
107116
108117 text = text . replace ( fullPattern , "" ) ;
109118 } catch ( e ) {
110- console . warn ( `Invalid Moment.js format pattern: ${ pattern } ` , e ) ;
119+ console . warn (
120+ `Invalid Moment.js format pattern: ${ pattern } ` ,
121+ e ,
122+ ) ;
111123 }
112124 }
113125 }
0 commit comments