From 1eb9720695c52b54cc620c7bbb977939971dda2c Mon Sep 17 00:00:00 2001 From: Edwin Chen Date: Wed, 21 Nov 2012 13:20:49 -0800 Subject: [PATCH] Revert "Add markdown support to the text component: fixes issue #52" This reverts commit f35b88e8b90e1ea645120e9696a95e3ec8d48fd6. --- Gemfile | 3 --- Gemfile.lock | 2 -- app/helpers/tasks_helper.rb | 5 ---- app/views/tasks/show.html.haml | 2 +- db/structure.sql | 5 ---- test/unit/helpers/tasks_helper_test.rb | 36 -------------------------- 6 files changed, 1 insertion(+), 52 deletions(-) diff --git a/Gemfile b/Gemfile index dd9bc4b..73a6246 100644 --- a/Gemfile +++ b/Gemfile @@ -54,9 +54,6 @@ gem 'resque-status' # UUIDs for tasks gem 'uuidtools' -# Markdown -gem 'rdiscount' - # To use ActiveModel has_secure_password gem 'bcrypt-ruby', '~> 3.0.0', :require => 'bcrypt' diff --git a/Gemfile.lock b/Gemfile.lock index aaa5cfb..abc155c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -121,7 +121,6 @@ GEM thor (~> 0.14.6) raindrops (0.10.0) rake (0.9.2.2) - rdiscount (1.6.8) rdoc (3.12) json (~> 1.4) redis (3.0.1) @@ -201,7 +200,6 @@ DEPENDENCIES net-ldap pry rails (= 3.2.1) - rdiscount resque resque-status ruby-aws diff --git a/app/helpers/tasks_helper.rb b/app/helpers/tasks_helper.rb index 0dca607..61f9735 100644 --- a/app/helpers/tasks_helper.rb +++ b/app/helpers/tasks_helper.rb @@ -22,11 +22,6 @@ def interpolate string, data string.html_safe end - # Renders text as markdown - def markdown string - RDiscount.new(string).to_html.html_safe - end - # resolves data items, which can be literals, fields, or nils, to the # appropriate string. Fields are looked up in the fields hash def resolve_data data, fields diff --git a/app/views/tasks/show.html.haml b/app/views/tasks/show.html.haml index 6ff75bc..cf4a0a3 100644 --- a/app/views/tasks/show.html.haml +++ b/app/views/tasks/show.html.haml @@ -39,7 +39,7 @@ %label.error.alert.alert-error{:for => id} Please enter a response. %textarea{:cols => 40, :rows => 5, :name => id, :class => (fr_q.required? ? 'required' : '')} - when :_text - %div= markdown(interpolate(section[:content], @task.data)) + %div= interpolate(section[:content], @task.data) - when :_header %h1= interpolate(section[:content], @task.data) - else diff --git a/db/structure.sql b/db/structure.sql index 55b3a42..66afe97 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -133,7 +133,6 @@ CREATE TABLE `clockwork_raven_task_responses` ( `updated_at` timestamp NULL DEFAULT NULL, `mturk_assignment` varchar(255) DEFAULT NULL, `approved` tinyint(1) DEFAULT NULL, - `source` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), KEY `task_id` (`task_id`), CONSTRAINT `clockwork_raven_task_responses_ibfk_1` FOREIGN KEY (`task_id`) REFERENCES `clockwork_raven_tasks` (`id`) @@ -176,8 +175,4 @@ INSERT INTO clockwork_raven_schema_migrations (version) VALUES ('20120807222553' INSERT INTO clockwork_raven_schema_migrations (version) VALUES ('20120810203402'); -INSERT INTO clockwork_raven_schema_migrations (version) VALUES ('20120911001453'); - -INSERT INTO clockwork_raven_schema_migrations (version) VALUES ('20121010052749'); - INSERT INTO clockwork_raven_schema_migrations (version) VALUES ('20121020214517'); \ No newline at end of file diff --git a/test/unit/helpers/tasks_helper_test.rb b/test/unit/helpers/tasks_helper_test.rb index 1b4520c..571f053 100644 --- a/test/unit/helpers/tasks_helper_test.rb +++ b/test/unit/helpers/tasks_helper_test.rb @@ -28,42 +28,6 @@ class TasksHelperTest < ActionView::TestCase assert_equal expected_output, interpolate(template_string, data) end - test "markdown" do - input = <<-END_IN.strip_heredoc - foo - -

blah

- - # Things - - I want some *things* and some _other things_ and some **important things** - - * foo - * bar - - - END_IN - - expected_output = <<-END_OUT.strip_heredoc -

foo

- -

blah

- -

Things

- -

I want some things and some other things and some important things

- - - - - END_OUT - - assert_dom_equiv expected_output, markdown(input) - end - test "resolve data" do fields = { 'foo' => 'data1',