jamestalmage / supports-hyperlinks

Detect whether a terminal emulator supports hyperlinks
MIT License
54 stars 13 forks source link

feat: support Netlify #11

Closed ehmicky closed 3 years ago

ehmicky commented 3 years ago

This adds support for Netlify.

Netlify build logs supports some ANSI sequences using ansi_up which supports OSC hyperlinks.

However, Netlify sets the CI enviroment variable, which makes this library return false.

This PR adds support for Netlify by detecting it with the NETLIFY environment variable.

jamestalmage commented 3 years ago

@ehmicky - I'm going to assume you've verified this works with Netlify

ehmicky commented 3 years ago

Hi @jamestalmage, absolutely!

Every Netlify build is defining this NETLIFY environment variable. OSC hyperlinks are supported in the Netlify build logs :+1:

jamestalmage commented 3 years ago

Perfect. Thank you!

ehmicky commented 3 years ago

:tada:

For future reference, this is an example of using hyperlinks in Netlify build logs.

Netlify build logs is using ansi_up to convert ANSI sequences to HTML. It seems like there is a bug with OSC hyperlinks when the text includes a space. I filed an issue in https://github.com/drudru/ansi_up/issues/65

jamestalmage commented 3 years ago

Published as 2.2.0

ehmicky commented 3 years ago

Thanks!

FYI, the bug above got fixed :+1: