mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Further hack docs Markdown for Spark
This commit is contained in:
@@ -321,6 +321,13 @@ Handlebars.registerHelper('better_markdown', function(fn) {
|
||||
return result;
|
||||
};
|
||||
|
||||
// This is a tower of terrible hacks.
|
||||
// Replace Spark annotations <$...> ... </$...> with HTML comments, and
|
||||
// space out the comments on their own lines. This keeps them from
|
||||
// interfering with Markdown's paragraph parsing.
|
||||
// Really, running Markdown multiple times on the same string is just a
|
||||
// bad idea.
|
||||
input = input.replace(/<(\/?\$.*?)>/g, '<!--$1-->');
|
||||
input = input.replace(/<!--.*?-->/g, '\n\n$&\n\n');
|
||||
|
||||
var hashedBlocks = {};
|
||||
@@ -370,6 +377,8 @@ Handlebars.registerHelper('better_markdown', function(fn) {
|
||||
return hashedBlocks[a];
|
||||
});
|
||||
|
||||
output = output.replace(/<!--(\/?\$.*?)-->/g, '<$1>');
|
||||
|
||||
return output;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user