JS parse links snippet