mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-11 13:48:40 +00:00
Fix test error #1297
This commit is contained in:
parent
c0b3187029
commit
7c1e968d41
@ -1,10 +1,9 @@
|
||||
const ALLOW_MANY = ['by', 'url', 'genre', 'license'];
|
||||
import { defaultCode } from './user_pattern_utils.mjs';
|
||||
|
||||
export function getMetadata(raw_code) {
|
||||
if (raw_code == null) {
|
||||
console.error('could not extract metadata from missing pattern code');
|
||||
raw_code = defaultCode;
|
||||
raw_code = '';
|
||||
}
|
||||
const comment_regexp = /\/\*([\s\S]*?)\*\/|\/\/(.*)$/gm;
|
||||
const comments = [...raw_code.matchAll(comment_regexp)].map((c) => (c[1] || c[2] || '').trim());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user