diff --git a/documentation/examples/embedded_block.coffee b/documentation/examples/embedded_block.coffee new file mode 100644 index 0000000000..5ca5626ede --- /dev/null +++ b/documentation/examples/embedded_block.coffee @@ -0,0 +1,5 @@ +``` +function time() { + return `The time is ${new Date().toLocaleTimeString()}`; +} +``` diff --git a/documentation/examples/embedded_escaped.coffee b/documentation/examples/embedded_escaped.coffee new file mode 100644 index 0000000000..0eba110b41 --- /dev/null +++ b/documentation/examples/embedded_escaped.coffee @@ -0,0 +1,3 @@ +markdown = `function () { + return \`In Markdown, write code like \\\`this\\\`\`; +}` diff --git a/documentation/index.html.js b/documentation/index.html.js index 495201c269..e4d122b8c8 100644 --- a/documentation/index.html.js +++ b/documentation/index.html.js @@ -878,6 +878,19 @@ Block use backticks to pass it straight through.

<%= codeFor('embedded', 'hi()') %> +

+ Escape backticks with backslashes: \` becomes `. +

+

+ Escape backslashes before backticks with more backslashes: \\\` + becomes \`. +

+ <%= codeFor('embedded_escaped', 'markdown()') %> +

+ You can also embed blocks of JavaScript using triple backticks. That's easier + than escaping backticks, if you need them inside your JavaScript block. +

+ <%= codeFor('embedded_block', 'time()') %>