Skip to content

Question: 1.5 - Block that contains block customization #645

Answered by colinodell
joshbruce asked this question in Q&A
Discussion options

You must be logged in to vote

This type of block-within-block is a bit convoluted in 1.x but makes more sense in the upcoming 2.x release (still ~2 months away from release)

In a nutshell, your outer block parser should not be responsible for passing the inner content too. Rather, it should only parse the initial lines and characters that make up that first outer part. There are some methods on the block class in 1.x which control whether a block and any inner blocks might continue into other lines (this was extracted into BlockContinuationParsers in 2.x because the 1.x approach mixed two very different responsibilities in one class)

Take a closer look at ListBlock, particularly:

  • matchesNextLine(): Helps determine if…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by colinodell
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question General questions about the project or usage
2 participants
Converted from issue

This discussion was converted from issue #527 on June 12, 2021 14:01.