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

Revert "Permit more control characters in comments (#924)" #996

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
## unreleased

- Clarify Unicode and UTF-8 references.
- Relax comment parsing; most control characters are again permitted.
- Allow newline after key/values in inline tables.
- Allow trailing comma in inline tables.
- Clarify where and how dotted keys define tables.
Expand Down
5 changes: 3 additions & 2 deletions toml.abnf
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ newline =/ %x0D.0A ; CRLF

;; Comment

comment = comment-start-symbol *allowed-comment-char
comment-start-symbol = %x23 ; #
allowed-comment-char = %x01-09 / %x0E-7F / non-ascii
non-ascii = %x80-D7FF / %xE000-10FFFF
non-eol = %x09 / %x20-7E / non-ascii

comment = comment-start-symbol *non-eol

;; Key-Value pairs

Expand Down
5 changes: 2 additions & 3 deletions toml.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ key = "value" # This is a comment at the end of a line
another = "# This is not a comment"
```

Comments may contain any Unicode code points except the following control codes
that could cause problems during editing or processing: U+0000, and U+000A to
U+000D.
Control characters other than tab (U+0000 to U+0008, U+000A to U+001F, U+007F)
are not permitted in comments.

## Key/Value Pair

Expand Down