From 6344dd3405ff18bc427842ac0e518e903ec28b46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Moreau?= <cedric.moreau@monemprunt.com> Date: Fri, 8 Apr 2022 16:51:37 +0200 Subject: [PATCH] fix: other keywords can now safely be used in a TX comment as well --- app/lib/common-libs/parsers/block.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/lib/common-libs/parsers/block.ts b/app/lib/common-libs/parsers/block.ts index 04798f164..38a707a52 100644 --- a/app/lib/common-libs/parsers/block.ts +++ b/app/lib/common-libs/parsers/block.ts @@ -50,27 +50,27 @@ export class BlockParser extends GenericParser { { prop: "membersCount", regexp: CommonConstants.BLOCK.MEMBERS_COUNT }, { prop: "identities", - regexp: /Identities:\n([\s\S]*)Joiners/, + regexp: /Identities:\n([\s\S]*?)Joiners/, parser: splitAndMatch("\n", CommonConstants.IDENTITY.INLINE), }, { prop: "joiners", - regexp: /Joiners:\n([\s\S]*)Actives/, + regexp: /Joiners:\n([\s\S]*?)Actives/, parser: splitAndMatch("\n", CommonConstants.BLOCK.JOINER), }, { prop: "actives", - regexp: /Actives:\n([\s\S]*)Leavers/, + regexp: /Actives:\n([\s\S]*?)Leavers/, parser: splitAndMatch("\n", CommonConstants.BLOCK.ACTIVE), }, { prop: "leavers", - regexp: /Leavers:\n([\s\S]*)Excluded/, + regexp: /Leavers:\n([\s\S]*?)Excluded/, parser: splitAndMatch("\n", CommonConstants.BLOCK.LEAVER), }, { prop: "revoked", - regexp: /Revoked:\n([\s\S]*)Excluded/, + regexp: /Revoked:\n([\s\S]*?)Excluded/, parser: splitAndMatch("\n", CommonConstants.BLOCK.REVOCATION), }, { @@ -80,12 +80,12 @@ export class BlockParser extends GenericParser { }, { prop: "certifications", - regexp: /Certifications:\n([\s\S]*)Transactions/, + regexp: /Certifications:\n([\s\S]*?)Transactions/, parser: splitAndMatch("\n", CommonConstants.CERT.OTHER.INLINE), }, { prop: "transactions", - regexp: /Transactions:\n([\s\S]*)/, + regexp: /Transactions:\n([\s\S]*)/, // No need for greedy "?" regexp capture, "Transaction" parsing is different from previous multiline fields parser: extractTransactions, }, { prop: "inner_hash", regexp: CommonConstants.BLOCK.INNER_HASH }, -- GitLab