Best practice for parsing multiline statements? #663
-
I have created https://github.com/webuni/commonmark-table-extension extension, but I'm not satisfied with it's implementation. The whole parsing logic is in the method Table::finalize. The greatest pain is replacement of the previous element in the method TableParser::parse. Is there any better way to parse complex and multiline structures? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You could try looking at how the Perhaps you can use a similar approach for tables? |
Beta Was this translation helpful? Give feedback.
-
I'm closing this due to inactivity. We can certainly reopen it if needed though. |
Beta Was this translation helpful? Give feedback.
You could try looking at how the
ListParser
works. It works by identifying lines which are list items. If the current container isn't aListBlock
, it'll create that on-the-fly and add the item to it.Perhaps you can use a similar approach for tables?