This commit is contained in:
Jade (Rose) Rowland 2025-07-28 01:20:42 -04:00
parent ab12c6ae0a
commit 30c80119e9
2 changed files with 2 additions and 2 deletions

View file

@ -125,7 +125,7 @@ function UserPatterns({ context }) {
style={{ display: 'none' }} style={{ display: 'none' }}
type="file" type="file"
multiple multiple
accept="text/plain,application/json" accept="text/plain,text/x-markdown,application/json"
onChange={(e) => importPatterns(e.target.files)} onChange={(e) => importPatterns(e.target.files)}
/> />
import import

View file

@ -197,7 +197,7 @@ export async function importPatterns(fileList) {
if (file.type === 'application/json') { if (file.type === 'application/json') {
const userPatterns = userPattern.getAll(); const userPatterns = userPattern.getAll();
setUserPatterns({ ...userPatterns, ...parseJSON(content) }); setUserPatterns({ ...userPatterns, ...parseJSON(content) });
} else if (file.type === 'text/plain') { } else if (['text/x-markdown', 'text/plain'].includes(file.type)) {
const id = file.name.replace(/\.[^/.]+$/, ''); const id = file.name.replace(/\.[^/.]+$/, '');
userPattern.update(id, { code: content }); userPattern.update(id, { code: content });
} }