diff --git a/lib/marked.js b/lib/marked.js
index 21c5573dbc..b29fda9924 100644
--- a/lib/marked.js
+++ b/lib/marked.js
@@ -469,7 +469,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.