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

Embedded {{#ulist}} end tag terminates parent {{#ulist}}. #288

Closed
martinhalford opened this issue Aug 17, 2020 · 4 comments
Closed

Embedded {{#ulist}} end tag terminates parent {{#ulist}}. #288

martinhalford opened this issue Aug 17, 2020 · 4 comments
Assignees
Labels

Comments

@martinhalford
Copy link
Member

Describe the bug
Where a {{#ulist}} is embedded inside a parent {{#ulist}} the first {{/ulist}} end tag terminates both {{#ulist}} items.

To Reproduce
Consider the following grammar.

{{#ulist commissions}}
Based on a sale price of $ {{salePrice as "0,0"}} the Commission Amount will be $ {{commissionAmount as "0,0"}} 
Calculated as follows:
{{#ulist lineItems}}
{{description}} being $ {{value as "0,0"}}  
{{/ulist}}
{{/ulist}}

This renders as follows:

-  Based on a sale price of $ 1,650,000 the Commission Amount will be $ 130,000 (including $ 13,000 GST.)
   Calculated as follows:
   -  7% of the property sale between $0 and $500,000 being $ 35,000
   -  8% of the property sale between $500,000 and $1,000,000 being $ 40,000
   -  9% of the property sale between $1,000,000 and $1,500,000 being $ 45,000
   -  A fixed fee of $10,000 for the property sale price over $1,500,000 being $ 10,000

{{/ulist}}

Notice the extraneous {{/ulist}} at the end?

Removing the second {{ulist}} has no effect on the grammar execution when it should.

Expected behaviour

Expect that all {{#ulist}} tags should have a matching {{/ulist}} tag and, therefore, be able have multiple {{#ulist}} elements embedded in parent {{#ulist}} elements.

Additional context
Cicero v0.21.3

@jeromesimeon
Copy link
Member

That's a serious bug in the new parser (most likely originating from the templatemark plugin). I'm labelling this as a critical bug. I'll look at it ASAP.

Thanks for the report!

@jeromesimeon
Copy link
Member

Should now be fixed. See PR #300

@jeromesimeon
Copy link
Member

This very issue also affects markdown-it-cicero in the case where some contract contains nested clauses. I'm reopening for that reason.

@jeromesimeon
Copy link
Member

This very issue also affects markdown-it-cicero in the case where some contract contains nested clauses. I'm reopening for that reason.

Filed as #323

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

2 participants