From 2ae46b474211541c72aeb420744f28becf2a64ca Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 22 Aug 2014 14:51:08 -0400 Subject: [PATCH] REMOVE: Auto quoting confused more people than it helped. --- .../discourse/dialects/autoquote_dialect.js | 23 ------------------- test/javascripts/lib/markdown-test.js.es6 | 9 -------- 2 files changed, 32 deletions(-) delete mode 100644 app/assets/javascripts/discourse/dialects/autoquote_dialect.js diff --git a/app/assets/javascripts/discourse/dialects/autoquote_dialect.js b/app/assets/javascripts/discourse/dialects/autoquote_dialect.js deleted file mode 100644 index e58e6b4ced0..00000000000 --- a/app/assets/javascripts/discourse/dialects/autoquote_dialect.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - If a line contains a single quote, convert it to a blockquote. For example: - - "My fake plants died because I did not pretend to water them." - - Would be: - -
My fake plants died because I did not pretend to water them.
- -**/ -Discourse.Dialect.registerInline('"', function(str, match, prev) { - - // Make sure we're on a line boundary - var last = prev[prev.length - 1]; - if (typeof last === "string") { return; } - - if (str.length > 2 && str.charAt(0) === '"' && str.charAt(str.length-1) === '"') { - var inner = str.substr(1, str.length-2); - if (inner.indexOf('"') === -1 && inner.indexOf("\n") === -1) { - return [str.length, ['blockquote', inner]]; - } - } -}); diff --git a/test/javascripts/lib/markdown-test.js.es6 b/test/javascripts/lib/markdown-test.js.es6 index 2a06be5ae70..8b513b87028 100644 --- a/test/javascripts/lib/markdown-test.js.es6 +++ b/test/javascripts/lib/markdown-test.js.es6 @@ -30,15 +30,6 @@ test("basic cooking", function() { cooked("brussel sproutes are *awful*.", "

brussel sproutes are awful.

", "it doesn't swallow periods."); }); -test("Auto quoting", function() { - cooked('"My fake plants died because I did not pretend to water them."', - "

My fake plants died because I did not pretend to water them.

", - "it converts single line quotes to blockquotes"); - cooked('"hello\nworld"', "

\"hello
world\"

", "It doesn't convert multi line quotes"); - cooked('"hello "evil" trout"', '

"hello "evil" trout"

', "it doesn't format quotes in the middle of a line"); - cooked('["text"', '

["text"

', "it recognizes leading tag-like text"); -}); - test("Traditional Line Breaks", function() { var input = "1\n2\n3"; cooked(input, "

1
2
3

", "automatically handles trivial newlines");