diff --git a/frontend_tests/node_tests/echo.js b/frontend_tests/node_tests/echo.js
index d3c6582060..1698b00dab 100644
--- a/frontend_tests/node_tests/echo.js
+++ b/frontend_tests/node_tests/echo.js
@@ -110,7 +110,8 @@ var bugdown_data = JSON.parse(fs.readFileSync(path.join(__dirname, '../../zerver
{input: 'hello there', expected: '
hello there
'},
{input: 'hello **bold** for you', expected: 'hello bold for you
'},
{input: '__hello__', expected: '__hello__
'},
- {input: '\n```\nfenced code\n```\n\nand then after\n', expected: '\n\n\nand then after
'},
+ {input: '\n```\nfenced code\n```\n\nand then after\n',
+ expected: '\n\n\nand then after
'},
{input: '* a\n* list \n* here',
expected: ''},
{input: 'Some text first\n* a\n* list \n* here\n\nand then after',
diff --git a/requirements/common.txt b/requirements/common.txt
index 4d4ee65986..77b6d6c570 100644
--- a/requirements/common.txt
+++ b/requirements/common.txt
@@ -13,7 +13,7 @@ MarkupSafe==0.23
Pillow==3.3.0
# Needed for markdown processing
-Pygments==2.0.2
+Pygments==2.1.3
# Needed for building complex DB queries
SQLAlchemy==0.7.8
diff --git a/static/js/fenced_code.js b/static/js/fenced_code.js
index ffdc4a0dcb..087dea0b13 100644
--- a/static/js/fenced_code.js
+++ b/static/js/fenced_code.js
@@ -35,7 +35,7 @@ function wrap_code(code) {
while (code.length > 2 && code.substr(code.length - 2) === '\n\n') {
code = code.substring(0, code.length - 1);
}
- return '' + escape_func(code) + '
\n';
+ return '' + escape_func(code) + '
\n';
}
function wrap_quote(text) {
diff --git a/zerver/fixtures/bugdown-data.json b/zerver/fixtures/bugdown-data.json
index c7c4dae853..24e568f859 100644
--- a/zerver/fixtures/bugdown-data.json
+++ b/zerver/fixtures/bugdown-data.json
@@ -3,7 +3,7 @@
{
"name": "codeblock_hilite",
"input": "Hamlet said:\n~~~~.python \ndef speak(self):\n x = 1\n~~~~",
- "expected_output": "Hamlet said:
\ndef speak(self):\n x = 1\n
",
+ "expected_output": "Hamlet said:
\ndef speak(self):\n x = 1\n
",
"bugdown_matches_marked": false
},
{
@@ -15,19 +15,19 @@
{
"name": "codeblock_multiline",
"input": "Hamlet once said\n~~~~\ndef func():\n x = 1\n\n y = 2\n\n z = 3\n~~~~\nAnd all was good.",
- "expected_output": "Hamlet once said
\ndef func():\n x = 1\n\n y = 2\n\n z = 3\n
\n\n\nAnd all was good.
",
+ "expected_output": "Hamlet once said
\ndef func():\n x = 1\n\n y = 2\n\n z = 3\n
\n\n\nAnd all was good.
",
"bugdown_matches_marked": true
},
{
"name": "codeblock_backticks",
"input": "\n```\nfenced code\n```\n\n```inline code```\n",
- "expected_output": "\n\n\ninline code
",
+ "expected_output": "\n\n\ninline code
",
"bugdown_matches_marked": true
},
{
"name": "hanging_multi_codeblock",
"input": "Hamlet said:\n~~~~\ndef speak(self):\n x = 1\n# Comment to make this code block longer to test Trac #1162\n~~~~\n\nThen he mentioned ````y = 4 + x**2```` and\n~~~~\ndef foobar(self):\n return self.baz()",
- "expected_output": "Hamlet said:
\ndef speak(self):\n x = 1\n# Comment to make this code block longer to test Trac #1162\n
\n\n\nThen he mentioned y = 4 + x**2 and
\ndef foobar(self):\n return self.baz()\n
",
+ "expected_output": "Hamlet said:
\ndef speak(self):\n x = 1\n# Comment to make this code block longer to test Trac #1162\n
\n\n\nThen he mentioned y = 4 + x**2 and
\ndef foobar(self):\n return self.baz()\n
",
"bugdown_matches_marked": true
},
{
@@ -45,7 +45,7 @@
{
"name": "complexly_nested_quote",
"input": "I heard about this second hand...\n~~~ quote\n\nHe said:\n~~~ quote\nThe customer is complaining.\n\nThey looked at this code:\n``` \ndef hello(): print 'hello\n```\nThey would prefer:\n~~~\ndef hello()\n puts 'hello'\nend\n~~~\n\nPlease advise.\n~~~\n\nShe said:\n~~~ quote\nJust send them this:\n```\necho \"hello\n\"\n```\n~~~",
- "expected_output": "I heard about this second hand...
\n\nHe said:
\n\nThe customer is complaining.
\nThey looked at this code:
\ndef hello(): print 'hello\n
\n\n\nThey would prefer:
\n
\ndef hello()
\n puts 'hello'
\nend
\n
\nPlease advise.
\nShe said:\n~~~ quote\nJust send them this:\n```\necho "hello\n"\n```\n
",
+ "expected_output": "I heard about this second hand...
\n\nHe said:
\n\nThe customer is complaining.
\nThey looked at this code:
\ndef hello(): print 'hello\n
\n\n\nThey would prefer:
\n
\ndef hello()
\n puts 'hello'
\nend
\n
\nPlease advise.
\nShe said:\n~~~ quote\nJust send them this:\n```\necho "hello\n"\n```\n
",
"bugdown_matches_marked": false
},
{
@@ -57,7 +57,7 @@
{
"name": "dangerous_block",
"input": "``` one ```\n\n``` two ```\n\n~~~~\nx = 1",
- "expected_output": "one
\ntwo
\n",
+ "expected_output": "one
\ntwo
\n",
"bugdown_matches_marked": true
},
{
@@ -87,7 +87,7 @@
{
"name": "ulist_codeblock",
"input": "~~~\nint x = 3\n* 4;\n~~~",
- "expected_output": "",
+ "expected_output": "",
"bugdown_matches_marked": true
},
{
@@ -225,7 +225,7 @@
{
"name": "safe_html_in_code",
"input": "~~~\nstay normal
",
- "expected_output": "",
+ "expected_output": "",
"bugdown_matches_marked": true
},
{