mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-12 22:15:27 -04:00
works
This commit is contained in:
@@ -125,7 +125,7 @@ function UserPatterns({ context }) {
|
||||
style={{ display: 'none' }}
|
||||
type="file"
|
||||
multiple
|
||||
accept="text/plain,application/json"
|
||||
accept="text/plain,text/x-markdown,application/json"
|
||||
onChange={(e) => importPatterns(e.target.files)}
|
||||
/>
|
||||
import
|
||||
|
||||
@@ -197,7 +197,7 @@ export async function importPatterns(fileList) {
|
||||
if (file.type === 'application/json') {
|
||||
const userPatterns = userPattern.getAll();
|
||||
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(/\.[^/.]+$/, '');
|
||||
userPattern.update(id, { code: content });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user