Skip to content

Commit

Permalink
fix: make regexp more robust
Browse files Browse the repository at this point in the history
new regexp:

```regexp
/^<!-- metadata_id = (.*) -->$/m
```
  • Loading branch information
jamacku committed Apr 26, 2023
1 parent eba607d commit e8b95de
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ export default class MetadataController {
this.schema = {
id: verifiedID,
template: {
before: '\n\n<!-- ',
after: ' -->',
before: '^<!-- ',
after: ' -->$',
},
};

this.regexp = new RegExp(
`${this.schema.template.before}${verifiedID} = (.*)${this.schema.template.after}`
`${this.schema.template.before}${verifiedID} = (.*)${this.schema.template.after}`,
'm'
);
}

Expand Down

0 comments on commit e8b95de

Please sign in to comment.