diff --git a/lib/marked.js b/lib/marked.js
index 8fc72b3a3a..873427bca6 100644
--- a/lib/marked.js
+++ b/lib/marked.js
@@ -458,7 +458,7 @@ var inline = {
nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,
strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
- code: /^(`+)([\s\S]*?[^`])\1(?!`)/,
+ code: /^(`+)(\s*)([\s\S]*?[^`]?)\2\1(?!`)/,
br: /^ {2,}\n(?!\s*$)/,
del: noop,
text: /^[\s\S]+?(?=[\\hi ther `` ok ```
`
There is a literal backtick (`) here.
A backtick-delimited string in a code span: `foo`
Please don't use any <blink>
tags.