Re: meta-data in the VTT file header, a strawman proposal

On Mon, Apr 23, 2012 at 12:41 PM, David Singer <singer@apple.com> wrote:

> > If you specify that continuation lines always have *exactly* one U+0020
> space character added (instead of one or more of any whitespace, as in
> 822), then you can tell the difference: you just remove the one space.
>  That's how patch files work.
>
> Unless you add a space to all the lines that started with a space, as
> well, you can't tell the difference between added and original spaces.
>

(That's what I said: you add exactly one space to every line, so removing
exactly one space gives you the original line.  Anyway, the escaped,
period-terminated approach seems to be ironing out better.)

On Sat, Apr 21, 2012 at 1:10 AM, Silvia Pfeiffer
<silviapfeiffer1@gmail.com>wrote:

> Something like:
>
> 1.
> Name-vaue pairs of header metadata are given with a name-string
> separated from the value by a colon.
> No control characters or separators are allowed in the name value.
> No white space is allowed between the name and the colon (?).
>
> 2.
> If the value is a single "|" character, the value is multi-line,
> starting on the next line and ends with a line that only contains a
> single dot.
> The newline just before the dot-line is also not part of the value.
>
>
> A quick-and-dirty ABF could be:
>
> metadata-header = field-name ":" field-value
> field-name = token
> field-value = ("|" *TEXT CRLF "." CRLF) | (*TEXT without CRLF)
>

(I'm not sure; it looks more or less right, but reading ABFs has always
given me a headache.)

Some other details:

Presumably, whitespace between the colon and a single-line value would be
stripped, eg.

Key:     Value

would result in "Key" = "Value".  If you have significant leading
whitespace in the value you want to preserve, or if you need to encode the
string "|" itself, then switch to the block format:

Key: |
    Value
.

Key: |
|
.

-- 
Glenn Maynard

Received on Monday, 23 April 2012 23:00:48 UTC