Giphy - add Markdown format

Enable to paste the GIF directly in a GitHub comment or anywhere else that requires a Markdown syntax

Versión del día 12/9/2019. Echa un vistazo a la versión más reciente.

// ==UserScript==
// @name         Giphy - add Markdown format
// @namespace    http://splintor.wordpress.com/
// @version      0.2
// @description  Enable to paste the GIF directly in a GitHub comment or anywhere else that requires a Markdown syntax
// @author       [email protected]
// @updateUrl    https://gist.github.com/splintor/d17771cf706a5d874222651577be7e8a/raw
// @match        https://giphy.com/gifs/*/links
// ==/UserScript==

(function() {
  'use strict';
  const gifLink = Array.from(document.querySelectorAll('input')).find(i => i.value.endsWith('giphy.gif')).parentNode;
  const markdownTag = gifLink.cloneNode(true);
  markdownTag.firstChild.innerText = 'Markdown Tag';
  const input = markdownTag.querySelector('input');
  input.value = `![image](${input.value})`;
  input.addEventListener('focus', e => e.target.select());
  gifLink.after(markdownTag);
})();
长期地址
遇到问题?请前往 GitHub 提 Issues。