Skip to content

Best practice for parsing multiline statements? #123

Closed

Description

@hason

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?

Activity

  1. added
    question
    on Jun 19, 2015
  2. colinodell commented on Jun 19, 2015

    @colinodell
    Member

    You could try looking at how the ListParser works. It works by identifying lines which are list items. If the current container isn't a ListBlock, it'll create that on-the-fly and add the item to it.

    Perhaps you can use a similar approach for tables?

  3. colinodell commented on Jul 15, 2015

    @colinodell
    Member

    I'm closing this due to inactivity. We can certainly reopen it if needed though.

  4. locked and limited conversation to collaborators on Jun 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions