Skip to content

Commit 21f5b50

Browse files
committed
feat: add css property
1 parent 1dcd5b7 commit 21f5b50

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/backend/Backend.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,9 @@ export class BackendCore
9494
let n_raw = undefined
9595
let n_height = undefined
9696
let n_zoom = undefined
97+
let n_css = undefined
9798

98-
const pattern_new = /^(?=\b(?:url|file|background|color|theme|title|raw|height|zoom):)(?=(?:[^`]*?\burl:? +(?<url>[^`\n]*)|))(?=(?:[^`]*?\bfile:? +(?<file>[^`\n]*)|))(?=(?:[^`]*?\bbackground:? +(?<background>[^`\n]*)|))(?=(?:[^`]*?\bcolor:? +(?<color>[^`\n]*)|))(?=(?:[^`]*?\btheme:? +(?<theme>[^`\n]*)|))(?=(?:[^`]*?\btitle:? +(?<title>[^`\n]*)|))(?=(?:[^`]*?\braw:? +(?<raw>[^`\n]*)|))(?=(?:[^`]*?\bheight:? +(?<height>[^`\n]*)|))(?=(?:[^`]*?\bzoom:? +(?<zoom>[^`\n]*)|))(?:.+\n){0,8}.+/
99+
const pattern_new = /^(?=\b(?:url|file|background|color|theme|title|raw|height|zoom|css):)(?=(?:[^`]*?\burl:? +(?<url>[^`\n]*)|))(?=(?:[^`]*?\bfile:? +(?<file>[^`\n]*)|))(?=(?:[^`]*?\bbackground:? +(?<background>[^`\n]*)|))(?=(?:[^`]*?\bcolor:? +(?<color>[^`\n]*)|))(?=(?:[^`]*?\btheme:? +(?<theme>[^`\n]*)|))(?=(?:[^`]*?\btitle:? +(?<title>[^`\n]*)|))(?=(?:[^`]*?\braw:? +(?<raw>[^`\n]*)|))(?=(?:[^`]*?\bheight:? +(?<height>[^`\n]*)|))(?=(?:[^`]*?\bzoom:? +(?<zoom>[^`\n]*)|))(?=(?:[^`]*?\bcss:? +(?<css>[^`]*)|))(?:.+\n){0,9}.+/
99100

100101
if ( data.match( pattern_new ) && data.match( pattern_new ).groups )
101102
{
@@ -109,6 +110,7 @@ export class BackendCore
109110
n_raw = find_new.raw ?? false
110111
n_height = find_new.height ?? 700
111112
n_zoom = find_new.zoom ?? 1
113+
n_css = find_new.css ?? ""
112114
}
113115

114116
/*
@@ -128,13 +130,19 @@ export class BackendCore
128130
if ( n_raw )
129131
{
130132

133+
n_css = n_css.replace( /(\r\n|\n|\r|\||\s)/gm, "" );
134+
131135
const raw_output =
132136
`
133-
url: ${n_url}
134-
height: ${n_height}
135-
zoom: ${n_zoom}
137+
url: ${ n_url }
138+
height: ${ n_height }
139+
zoom: ${ n_zoom }
140+
css: |
141+
${ n_css }
136142
`
137143

144+
console.log( raw_output )
145+
138146
const pnl = SaturynHandleSyntax( plugin, raw_output )
139147
el.appendChild( pnl )
140148
return

0 commit comments

Comments
 (0)