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

Allow Empty Lines #68

Merged
merged 2 commits into from
Jan 22, 2025
Merged
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
2 changes: 2 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@ <h3 id="encoding-header" class="padding-top-120"><i class="glyphicon glyphicon-c
<p>File-Container has to be TXT.</p>
<p><b>Why?</b> The TXT files are quite simple and easy to understand for non-coders. You can read them and edit them with a simple txt-editor. That's what made the format so popular in the first place. So even if there are many good mark up languages like xml we keep on using TXT-Files for this decade unless there are good reasons to change that.
</p>
<p>Empty lines are ignored.</p>
<p><b>Why?</b> When editing a TXT file manually empty lines can be helpful to separate different parts of a song. Lines that consist only of whitespace characters are considered empty.</p>

<h3 id="mandatory-attributes" class="padding-top-120"><i
class="glyphicon glyphicon-exclamation-sign"></i> Mandatory Attributes</h3>
Expand Down
14 changes: 3 additions & 11 deletions spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,27 +95,19 @@ Both the header and the body of a file are defined in terms of lines.
A line is a string of text that is terminated with an end-of-line sequence.

```abnf
WSP = <any unicode character with White_Space=yes>
end-of-line = ( CR / LF / CRLF )
empty-line = end-of-line
empty-line = *WSP end-of-line
```

Implementations SHOULD use a single Line Feed (`%x0A`) as line terminator.
Implementations MUST accept the end of input (`EOF`) as a valid line terminator.
Empty lines are ignored throughout the entire file.

> [!CAUTION]
>
> Whether empty lines are allowed or not is currently open for discussion ([#50](https://github.com/UltraStar-Deluxe/format/issues/50)).
> Whether a line that consists only of whitespace is recognized as an empty line has not been decided yet.
Empty lines are ignored throughout the entire file (note that a line consisting only of whitespace characters is considered empty).
Baklap4 marked this conversation as resolved.
Show resolved Hide resolved

Whitespace is used as a separator in many places of the format.
Any unicode character with the property `White_Space=yes` is a valid whitespace character (except for the carriage return `%x0D` and line feed `%x0A` both of which are considered line breaks). See [Wikipedia](https://en.wikipedia.org/wiki/Whitespace_character) for a list of whitespace characters.
In the interests of interoperability implementations SHOULD use ASCII spaces (`%x20`) as whitespace.

```abnf
WSP = <any unicode character with White_Space=yes>
```

## 2. The File Header

The header of a song consists of a sequence of key-value pairs.
Expand Down