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

tdl.format() does not escape quotes in docstrings #187

Closed
goodmami opened this issue Oct 15, 2018 · 0 comments
Closed

tdl.format() does not escape quotes in docstrings #187

goodmami opened this issue Oct 15, 2018 · 0 comments
Milestone

Comments

@goodmami
Copy link
Member

Consider how the following renders invalid TDL:

>>> print(tdl.format(
...     tdl.TypeDefinition(
...         tdl.TypeIdentifier('a'),
...         tdl.TypeIdentifier('b'),
...         docstring='inner-triple-quote""" final quotes"')))
a := b
  """
  inner-triple-quote""" final quotes"
  """.

As long as we always format docstrings with newlines after the docstring contents, one or two final quotes are fine, but if the newline and spacing is dropped they will need to be escaped. Triple-quotes inside the docstring always need to be escaped (at least one of the quotes does).

@goodmami goodmami added this to the v0.9.0 milestone Oct 15, 2018
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