diff --git a/package.json b/package.json index fab8eb1b..c8c72d17 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yarle-evernote-to-md", - "version": "3.8.0", + "version": "3.8.1", "description": "Yet Another Rope Ladder from Evernote", "keywords": [ "evernote", diff --git a/src/utils/templates/apply-functions/apply-template-on-block.ts b/src/utils/templates/apply-functions/apply-template-on-block.ts index 4acab6c2..9450fafa 100644 --- a/src/utils/templates/apply-functions/apply-template-on-block.ts +++ b/src/utils/templates/apply-functions/apply-template-on-block.ts @@ -11,14 +11,15 @@ export const applyTemplateOnBlock = ({ }: TemplateBlockSettings): string => { if (value && check()) { return template - .replace(startBlockPlaceholder, '') - .replace(endBlockPlaceholder, '') - .replace(valuePlaceholder, value); + .replace(new RegExp(`${startBlockPlaceholder}`,'g'), '') + .replace(new RegExp(`${endBlockPlaceholder}`,'g'), '') + .replace(new RegExp(`${valuePlaceholder}`,'g'), value); + } return template.replace( new RegExp( - `${startBlockPlaceholder}${M.MATCH_ALL}${endBlockPlaceholder}`, + `${startBlockPlaceholder}([\\D\\d]).*?(?=${endBlockPlaceholder})${endBlockPlaceholder}`, 'g', ), '',