From f610aefd53f158481a53dae8bac4dd75d0ae8818 Mon Sep 17 00:00:00 2001 From: codello Date: Tue, 21 Jan 2025 16:51:15 +0100 Subject: [PATCH 1/2] Clarify Empty Lines As per #50 empty lines are liens that consist only of whitespace characters. These lines are ignored throughout the entire file. --- spec.md | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/spec.md b/spec.md index b0f8182..b634f26 100644 --- a/spec.md +++ b/spec.md @@ -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 = 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). 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 = -``` - ## 2. The File Header The header of a song consists of a sequence of key-value pairs. From fec58d513ac27e6363e9e78cf1e670c442016c8d Mon Sep 17 00:00:00 2001 From: codello Date: Tue, 21 Jan 2025 20:23:02 +0100 Subject: [PATCH 2/2] Add empty lines handling to website --- docs/index.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/index.html b/docs/index.html index 6dfde5d..a672d22 100644 --- a/docs/index.html +++ b/docs/index.html @@ -404,6 +404,8 @@