Fix test error #1297
This commit is contained in:
parent
c0b3187029
commit
7c1e968d41
1 changed files with 1 additions and 2 deletions
|
|
@ -1,10 +1,9 @@
|
||||||
const ALLOW_MANY = ['by', 'url', 'genre', 'license'];
|
const ALLOW_MANY = ['by', 'url', 'genre', 'license'];
|
||||||
import { defaultCode } from './user_pattern_utils.mjs';
|
|
||||||
|
|
||||||
export function getMetadata(raw_code) {
|
export function getMetadata(raw_code) {
|
||||||
if (raw_code == null) {
|
if (raw_code == null) {
|
||||||
console.error('could not extract metadata from missing pattern code');
|
console.error('could not extract metadata from missing pattern code');
|
||||||
raw_code = defaultCode;
|
raw_code = '';
|
||||||
}
|
}
|
||||||
const comment_regexp = /\/\*([\s\S]*?)\*\/|\/\/(.*)$/gm;
|
const comment_regexp = /\/\*([\s\S]*?)\*\/|\/\/(.*)$/gm;
|
||||||
const comments = [...raw_code.matchAll(comment_regexp)].map((c) => (c[1] || c[2] || '').trim());
|
const comments = [...raw_code.matchAll(comment_regexp)].map((c) => (c[1] || c[2] || '').trim());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue