Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JM-Mendez/ba2a298c05da2cd10bc7096a4b72ae2e to your computer and use it in GitHub Desktop.
Save JM-Mendez/ba2a298c05da2cd10bc7096a4b72ae2e to your computer and use it in GitHub Desktop.
[Trello bold support] Add support for bold and emphasized Markdown in #Trello card titles using a User Script.
// ==UserScript==
// @name Trello card title Markdown
// @version 0.4.0
// @homepage https://gist.github.com/gorbiz/6062481
// @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(/\*\*(.+?)\*\*/g, '<strong>$1</strong>')
.replace(/\*(.+?)\*/g, '<em>$1</em>')
.replace(/~~(.+?)~~/g, '<strike>$1</strike>')
.replace(/\`(.+?)\`/g, '<code>$1</code>');
}
setTimeout(markdownAll, 500);
}
markdownAll();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment