Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested clauses in markdown_cicero do not parse properly #323

Closed
jeromesimeon opened this issue Sep 11, 2020 · 1 comment
Closed

Nested clauses in markdown_cicero do not parse properly #323

jeromesimeon opened this issue Sep 11, 2020 · 1 comment
Assignees
Labels

Comments

@jeromesimeon
Copy link
Member

Describe the bug
When parsing a markdown with cicero extension, the parser does not handle a clause contains another clause properly.

To Reproduce

In the following test, notice the end of the outer clause and the trailing ending clause as a text node.

bash-3.2$ cat test/data/nestedclause2.tem.md
{{#clause payment}}
Payment. As consideration in full for the rights granted herein, Licensee shall pay Licensor a one-time fee in the amount of "forty two" (42) upon execution of this Agreement, payable as follows: "wire transfer".
{{#clause foo}}
This clause is nested.
{{/clause}}
And contains more text.
{{/clause}}
bash-3.2$ markus transform --from markdown_cicero --to ciceromark --input test/data/nestedclause2.tem.md 
<-to ciceromark --input test/data/nestedclause2.tem.md 
7:27:53 PM - info:
{
  "$class": "org.accordproject.commonmark.Document",
  "xmlns": "http://commonmark.org/xml/1.0",
  "nodes": [
    {
      "$class": "org.accordproject.ciceromark.Clause",
      "name": "payment",
      "nodes": [
        {
          "$class": "org.accordproject.commonmark.Paragraph",
          "nodes": [
            {
              "$class": "org.accordproject.commonmark.Text",
              "text": "Payment. As consideration in full for the rights granted herein, Licensee shall pay Licensor a one-time fee in the amount of "forty two" (42) upon execution of this Agreement, payable as follows: "wire transfer"."
            }
          ]
        }, 
        {
          "$class": "org.accordproject.ciceromark.Clause",
          "name": "foo",
          "nodes": [
            {
              "$class": "org.accordproject.commonmark.Paragraph",
              "nodes": [
                {
                  "$class": "org.accordproject.commonmark.Text",
                  "text": "This clause is nested."
                }
              ]
            }
          ]
        }
      ]
    }, 
    {
      "$class": "org.accordproject.commonmark.Paragraph",
      "nodes": [
        {
          "$class": "org.accordproject.commonmark.Text",
          "text": "And contains more text."
        }, 
        {
          "$class": "org.accordproject.commonmark.Softbreak"
        }, 
        {
          "$class": "org.accordproject.commonmark.Text",
          "text": "{{/clause}}"
        }
      ]
    }
  ]
}

Related

@jeromesimeon jeromesimeon self-assigned this Sep 11, 2020
jeromesimeon added a commit to jeromesimeon/markdown-transform that referenced this issue Sep 11, 2020
Signed-off-by: Jerome Simeon <jeromesimeon@me.com>
jeromesimeon added a commit that referenced this issue Sep 11, 2020
Signed-off-by: Jerome Simeon <jeromesimeon@me.com>
@jeromesimeon
Copy link
Member Author

Fixed in #324

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant