From a1ec9e405197726e62aea1508cb3c9587463f9bc Mon Sep 17 00:00:00 2001 From: "quentin.moutte.etu" Date: Wed, 24 Jul 2024 18:42:52 +0200 Subject: [PATCH] add a storeRegex for MicInlineDelimiter --- src/Microdown/MicInlineDelimiter.class.st | 29 +++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/src/Microdown/MicInlineDelimiter.class.st b/src/Microdown/MicInlineDelimiter.class.st index 3f346ca4..1699abed 100644 --- a/src/Microdown/MicInlineDelimiter.class.st +++ b/src/Microdown/MicInlineDelimiter.class.st @@ -10,7 +10,8 @@ Class { #name : 'MicInlineDelimiter', #superclass : 'Object', #classVars : [ - 'DelimiterDictionary' + 'DelimiterDictionary', + 'RegexDictionary' ], #pools : [ 'MicMicrodownSharedPool' @@ -28,8 +29,9 @@ MicInlineDelimiter class >> all [ { #category : 'private utilities' } MicInlineDelimiter class >> allRegex [ - ^ ((MicInlineDelimiter all collect: [ :each | each markupAsRegex]) joinUsing: '|') asRegex - + + RegexDictionary ifNil: [ self initializeRegex ]. + ^ (RegexDictionary values joinUsing: '|') asRegex ] { #category : 'accessing' } @@ -40,17 +42,27 @@ MicInlineDelimiter class >> at: markup [ { #category : 'initialization' } MicInlineDelimiter class >> initialize [ +