Created
February 10, 2017 17:11
-
-
Save maximeaubaret/0e1a506faa9f3bd1a099c832e83e69de to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Trello card title | |
| // @version 0.4.0 | |
| // @description Add support for bold and emphasized Markdown in card titles | |
| // @match https://trello.com/b/* | |
| // @match http://trello.com/b/* | |
| // ==/UserScript== | |
| function markdownAll() { | |
| var cards = document.getElementsByClassName('list-card-title'); | |
| for (var i = 0; i < cards.length; i++) { | |
| cards[i].innerHTML = cards[i].innerHTML | |
| .replace(/^(.*) ?:/, '<span style="display: block; color: black; font-weight: 500;">$1</span>') // Subject | |
| .replace(/- ([0-9\/]*J)$/, '<span style="font-size: 12px; font-weight: 400; color: #8C8888;">- $1</span>') // Time estimate | |
| .replace(/\*\*(.+?)\*\*/g, '<strong>$1</strong>') | |
| .replace(/\*(.+?)\*/g, '<em>$1</em>') | |
| .replace(/~~(.+?)~~/g, '<strike>$1</strike>') | |
| .replace(/\`(.+?)\`/g, '<code>$1</code>'); | |
| } | |
| } | |
| // Delay execution | |
| setTimeout(markdownAll, 500); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment