Skip to content

Commit

Permalink
Modified ghostdown markdown extension to allow for 4+ inline underscores
Browse files Browse the repository at this point in the history
See #1113
- added additional regex rule to replace 4+ underscores with their coded equivalent: _
  • Loading branch information
hansondr authored and bastilian committed Nov 24, 2013
1 parent 038e0cf commit 03be4ab
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion core/client/assets/vendor/showdown/extensions/ghostdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@
'</section>';
});
}
},

// 4 or more inline underscores e.g. Ghost rocks my _____!
{
type: 'lang',
filter: function (text) {
return text.replace(/([^_\n\r])(_{4,})/g, function (match, prefix, underscores) {
return prefix + underscores.replace(/_/g, '&#95;');
});
}
}
];
};
Expand All @@ -32,4 +42,4 @@
}
// Server-side export
if (typeof module !== 'undefined') module.exports = ghostdown;
}());
}());

0 comments on commit 03be4ab

Please sign in to comment.