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(doc-util): escape dotted keys #34

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Duologic
Copy link
Member

Attempt to fix #16 in doc-util rendering, this is a bit more complex than I anticipated, I've used this example to test various places where dotted keys can be.

local d = import './doc-util/main.libsonnet';

d.render(
  {
    '#': d.pkg('a', 'a', 'a',),
    '#has.a.period': d.val('help1'),
    'has.a.period': null,
    'more.period.keys': {
      '#': d.pkg('more.period.keys', 'c', 'more.period.keys',),
      'also.has.period': {
        '#period': d.val('help2'),
        period: null,
        '#has.a.period': d.val('help3'),
        'has.a.period': null,
      },
    },
    has: {
      a: {
        '#period': d.val('help4'),
        period: null,
        '#has.a.period': d.val('help5'),
        'has.a.period': null,
      },
    },
  }
)

I also don't think people should use dotted keys as they are confusing, but that is another discussion.

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

Successfully merging this pull request may close these issues.

Confusing output for keys with periods in them
1 participant