Does Pivotal use a 3rd party library/gem for the Markdown functionality in Tracker?
I'm consuming the API with a rails app and would like to display descriptions as they appear in Tracker. If you are using custom code, is it code that can be shared?
I'm currently using BlueCloth, but since Tracker's implementation of Markdown deviates from the spec it is not displaying consistently.
http://daringfireball.net/projects/ma...
Thanks!
I'm currently using BlueCloth, but since Tracker's implementation of Markdown deviates from the spec it is not displaying consistently.
http://daringfireball.net/projects/ma...
Thanks!
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
The company marked this question as answered.
-
Inappropriate?As you noticed, Tracker at this point does not follow a standard Markdown or Markup syntax. We have an internal markup that just supports bold and italic. We do plan to move to standard Markup or Markdown syntax as some point, but we don't have a timeframe on when yet. All of our markup is currently done in JavaScript. I included the JS code we use below:
Element.cleanupText = function(text) {
if (text == null){
return "";
}
text = ((""+text).htmlEscape());
text = text.replace(/(^|\W)\*([^\n*]+)\*($|\W)/g, "$1$2$3");
text = text.replace(/(^|\W)_([^_]+)_($|\W)/g, "$1$2$3");
text = text.replace(/\n/g, "
");
return text;
}; -
Inappropriate?Mark, thanks for your reply. I modified your code to create a jQuery plugin, and also included the insertion of the expected markup. I've got a blue-ridge test for the plugin too if you want it.
jQuery.fn.pivotalMarkdown = function()
{
$(this).each(function()
{
var html = $(this).html()
.replace(/(^|\W)\*([^\n*]+)\*($|\W)/g, "$1<strong>$2</strong>$3")
.replace(/(^|\W)_([^_]+)_($|\W)/g, "$1<em>$2</em>$3")
.replace(/\n/g, "<br>")
.replace(/(<br>)\s*/mg, "$1");
$(this).html(html);
});
return this;
};
Loading Profile...


