works
This commit is contained in:
parent
ab12c6ae0a
commit
30c80119e9
2 changed files with 2 additions and 2 deletions
|
|
@ -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 });
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue