Support git code syntax in live preview
Add autocrlf values for Windows, Linux, and OS X.
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
# https://help.github.com/articles/dealing-with-line-endings
|
||||
#
|
||||
# For Mac & Linux
|
||||
# git config --global core.autocrlf input
|
||||
#
|
||||
# For windows
|
||||
# git config --global core.autocrlf true
|
||||
#
|
||||
# Set default behaviour, in case users don't have core.autocrlf set.
|
||||
* text=auto
|
||||
|
||||
|
||||
@@ -298,6 +298,8 @@ var makePreviewHtml = function () {
|
||||
}
|
||||
|
||||
var prevTime = new Date().getTime();
|
||||
// Handle gollum file code insertion syntax.
|
||||
text = text.replace(/^[ \t]*``` ?([^:\n\r]+:[^`\n\r]+)```/gm, '``$1``');
|
||||
text = md_to_html( text );
|
||||
|
||||
// Calculate the processing time of the HTML creation.
|
||||
|
||||
Reference in New Issue
Block a user