Skip to content

Block level multiline extensions #2663

Answered by UziTech
epszaw asked this question in Q&A
Discussion options

You must be logged in to vote

Looks like blockRe matches the beginning of src even when @block is not at the start of src because of the m flag, so it consumes before.

You should be able to get it to work with

const blockRe = /^@block\[(?<type>[^\]]*)](?<body>[^]*?)@end_block\n*/gs;

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@epszaw
Comment options

Answer selected by epszaw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants