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

Loading Lists Inside a Clause #1

Open
apanjain opened this issue Dec 17, 2020 · 0 comments
Open

Loading Lists Inside a Clause #1

apanjain opened this issue Dec 17, 2020 · 0 comments

Comments

@apanjain
Copy link
Owner

Templatemark which is used for creating templates for contracts, provides us with two methods to iterate over lists, olist block (for an ordered list, similarly ulist block for an unordered list) and join block ( a simple implementation of for-loop).
These work fine as long as they are outside a clause block, but when inside the clause,

  • olist is not returning any result at all
  • join is returning items in the list but the output is malformatted.

The documentation is not much detailed and it does not contain examples for accessing elements inside a clause block.

I've also checked the source code on how these blocks are parsed, but no such difference is there.
These are the link to relevant files:-

  1. https://github.com/accordproject/markdown-transform/blob/master/packages/markdown-template/lib/combinators.js
  2. https://github.com/accordproject/markdown-transform/blob/master/packages/markdown-template/lib/toparserrules.js
  3. https://github.com/accordproject/markdown-transform/blob/master/packages/markdown-template/lib/TypeVisitor.js

Although, hardcoding items using the array index does work, and is implemented in the master branch.

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

No branches or pull requests

1 participant