diff --git a/docs/client/docs.js b/docs/client/docs.js index c7dc28497e..682f3cfaf8 100644 --- a/docs/client/docs.js +++ b/docs/client/docs.js @@ -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, ''); 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; });