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

Fix smart terms reference syntax #8

Closed
ronaldtse opened this issue Nov 16, 2021 · 1 comment
Closed

Fix smart terms reference syntax #8

ronaldtse opened this issue Nov 16, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ronaldtse
Copy link
Member

Previously, Metanorma smart terms used the syntax of {{term, source}}, but it has flipped, and also became more complex for termbase references ({{<<termbase,clause>>,term}}).

This probably should be fixed in iev-data too.

So we need to flip them with this code.

    def swap_term_refs(string)
      string.gsub(/\{\{\s*([^\}]+)\s*,\s*([^\}]+)\s*\}\}/, '{{<<\2>>,\1}}')
    end
@ronaldtse
Copy link
Member Author

This will also be handled by #6 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant