mirror of
				https://github.com/redmine/redmine.git
				synced 2025-10-31 18:36:07 +01:00 
			
		
		
		
	Make common_mark the default text formatting for new installations (#34863).
git-svn-id: https://svn.redmine.org/redmine/trunk@21897 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
		| @@ -95,7 +95,7 @@ mail_from: | |||||||
| plain_text_mail: | plain_text_mail: | ||||||
|   default: 0 |   default: 0 | ||||||
| text_formatting: | text_formatting: | ||||||
|   default: textile |   default: common_mark | ||||||
| cache_formatted_text: | cache_formatted_text: | ||||||
|   default: 0 |   default: 0 | ||||||
| wiki_compression: | wiki_compression: | ||||||
|   | |||||||
| @@ -4,6 +4,10 @@ class CreateSettings < ActiveRecord::Migration[4.2] | |||||||
|       t.column "name", :string, :limit => 30, :default => "", :null => false |       t.column "name", :string, :limit => 30, :default => "", :null => false | ||||||
|       t.column "value", :text |       t.column "value", :text | ||||||
|     end |     end | ||||||
|  |  | ||||||
|  |     # Persist text_formatting default setting for new installations | ||||||
|  |     setting = Setting.new(:name => "text_formatting", :value => Setting.text_formatting) | ||||||
|  |     setting.save! | ||||||
|   end |   end | ||||||
|  |  | ||||||
|   def self.down |   def self.down | ||||||
|   | |||||||
| @@ -0,0 +1,8 @@ | |||||||
|  | class EnsureTextFormattingSettingIsStoredInDb < ActiveRecord::Migration[6.1] | ||||||
|  |   def change | ||||||
|  |     unless Setting.where(name: "text_formatting").exists? | ||||||
|  |       setting = Setting.new(:name => "text_formatting", :value => 'textile') | ||||||
|  |       setting.save! | ||||||
|  |     end | ||||||
|  |   end | ||||||
|  | end | ||||||
| @@ -219,7 +219,7 @@ class AttachmentsControllerTest < Redmine::ControllerTest | |||||||
|     get(:show, :params => {:id => a.id}) |     get(:show, :params => {:id => a.id}) | ||||||
|     assert_response :success |     assert_response :success | ||||||
|     assert_equal 'text/html', @response.media_type |     assert_equal 'text/html', @response.media_type | ||||||
|     assert_select 'div.wiki', :html => "<h1>Header 1</h1>\n\n<h2>Header 2</h2>\n\n<h3>Header 3</h3>" |     assert_select 'div.wiki', :html => "<h1>Header 1</h1>\n<h2>Header 2</h2>\n<h3>Header 3</h3>" | ||||||
|   end |   end | ||||||
|  |  | ||||||
|   def test_show_text_file_formatted_textile |   def test_show_text_file_formatted_textile | ||||||
|   | |||||||
| @@ -145,4 +145,9 @@ class SettingTest < ActiveSupport::TestCase | |||||||
|       end |       end | ||||||
|     end |     end | ||||||
|   end |   end | ||||||
|  |  | ||||||
|  |   def test_default_text_formatting_for_new_installations_is_common_mark | ||||||
|  |     assert_equal 'common_mark', Setting.text_formatting | ||||||
|  |     assert_equal 'common_mark', Setting.find_by(:name => 'text_formatting').value | ||||||
|  |   end | ||||||
| end | end | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user