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

Commas are sometimes appended to comments #181

Closed
dranjan opened this issue Mar 24, 2022 · 0 comments · Fixed by #182
Closed

Commas are sometimes appended to comments #181

dranjan opened this issue Mar 24, 2022 · 0 comments · Fixed by #182

Comments

@dranjan
Copy link

dranjan commented Mar 24, 2022

Here's a simple repro:

import tomlkit

doc_str = """
[A]
B = [
    # Here's a comment.
    "C",
]
"""

doc = tomlkit.parse(doc_str)
deps = doc['A']['B'].multiline(True)
deps.append('D')
print(doc.as_string())

This is the output:

[A]
B = [
    # Here's a comment.,
    "C",
    "D",
]

The "Here's a comment" comment has a comma appended to it. (Expected behavior: exactly the same output, but without the comma appended to the comment.)

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