Re: hyperlinks

On Sun, Nov 12, 2017 at 2:55 PM, Alice Wonder <alice@domblogger.net> wrote:

> Hello,
>
> In my own WebVTT files I sometimes have hyperlinks.
>
> I put the html style hyperlinks in when the creator of an audio gives one,
> often at the end of the audio.
>
> They work in my own JS that parses cues but they are not standard and some
> WebVTT implementations respond by not showing the cue at all.
>
> Would it be possible to add a hyperlink tag to WebVTT that is "official"
> which WebVTT implementors can choose to handle as just text if they want to
> (e.g. MKV)?
>
> example:
>
> 0:12:14.000 --> 00:12:15.000
> For more information on our fine snake oil, visit
> <a href="https://www.example.com">www.example.com</a>
>
> That's what I do now, and it works in my JS but isn't universal.
>
> My personal suggestion would be:
>
> 0:12:14.000 --> 00:12:15.000
> For more information on our fine snake oil, visit
> <a.https www.example.com>www.example.com</a>
>
> implementations that can not or do not want to support hyperlinks would
> just display the text www.example.com


This is what should happen already per the "cue text parsing rules" [1].
("<a ...>" will be tokenized as a start tag 'a' with the annotation 'href="
https://www.example.com"', and "</a>" as an end tag 'a'. Both tokens will
then be ignored by the parsing steps in [1].)
This can be verified quite easily by checking what VTTCue.getCueAsHTML()
returns. (If implementation don't show the text at all it would seem they
have a bug.)


>
> first string w/o space after first dot is protocol, second is the url -
> using %20 for urls that contain spaces. With a colon instead of space it
> would call a helper application, e.g.
>

Adding a new URL syntax does not seem like a great idea. (URLs are enough
trouble already.) So if adding this, just <a https://www.example.com>...</a>
would seem to be a better way of doing it (i.e the URL as an annotation.)

<a.mailto:user@example.com>user@example.com</a>
>
> Just a thought, and I concede a selfish one.
>
>

/fs


[1] https://w3c.github.io/webvtt/#webvtt-cue-text-parsing-rules

Received on Sunday, 12 November 2017 16:27:46 UTC