Fix list item indentation [ci-skip]

This fixes the formatting of list items that include code snippets and
multiple paragraphs.
This commit is contained in:
Jonathan Hefner 2020-12-23 15:14:18 -06:00
parent c008a36492
commit 384c0d4b2f
7 changed files with 259 additions and 238 deletions

View File

@ -615,23 +615,40 @@ Defaults to `'signed cookie'`.
```ruby
config.action_dispatch.rescue_responses = {
'ActionController::RoutingError' => :not_found,
'AbstractController::ActionNotFound' => :not_found,
'ActionController::MethodNotAllowed' => :method_not_allowed,
'ActionController::UnknownHttpMethod' => :method_not_allowed,
'ActionController::NotImplemented' => :not_implemented,
'ActionController::UnknownFormat' => :not_acceptable,
'ActionController::InvalidAuthenticityToken' => :unprocessable_entity,
'ActionController::InvalidCrossOriginRequest' => :unprocessable_entity,
'ActionDispatch::Http::Parameters::ParseError' => :bad_request,
'ActionController::BadRequest' => :bad_request,
'ActionController::ParameterMissing' => :bad_request,
'Rack::QueryParser::ParameterTypeError' => :bad_request,
'Rack::QueryParser::InvalidParameterError' => :bad_request,
'ActiveRecord::RecordNotFound' => :not_found,
'ActiveRecord::StaleObjectError' => :conflict,
'ActiveRecord::RecordInvalid' => :unprocessable_entity,
'ActiveRecord::RecordNotSaved' => :unprocessable_entity
'ActionController::RoutingError'
=> :not_found,
'AbstractController::ActionNotFound'
=> :not_found,
'ActionController::MethodNotAllowed'
=> :method_not_allowed,
'ActionController::UnknownHttpMethod'
=> :method_not_allowed,
'ActionController::NotImplemented'
=> :not_implemented,
'ActionController::UnknownFormat'
=> :not_acceptable,
'ActionController::InvalidAuthenticityToken'
=> :unprocessable_entity,
'ActionController::InvalidCrossOriginRequest'
=> :unprocessable_entity,
'ActionDispatch::Http::Parameters::ParseError'
=> :bad_request,
'ActionController::BadRequest'
=> :bad_request,
'ActionController::ParameterMissing'
=> :bad_request,
'Rack::QueryParser::ParameterTypeError'
=> :bad_request,
'Rack::QueryParser::InvalidParameterError'
=> :bad_request,
'ActiveRecord::RecordNotFound'
=> :not_found,
'ActiveRecord::StaleObjectError'
=> :conflict,
'ActiveRecord::RecordInvalid'
=> :unprocessable_entity,
'ActiveRecord::RecordNotSaved'
=> :unprocessable_entity
}
```
@ -990,6 +1007,7 @@ text/javascript image/svg+xml application/postscript application/x-shockwave-fla
```
* `config.active_storage.service_urls_expire_in` determines the default expiry of URLs generated by:
* `ActiveStorage::Blob#url`
* `ActiveStorage::Blob#service_url_for_direct_upload`
* `ActiveStorage::Variant#url`
@ -1013,6 +1031,7 @@ text/javascript image/svg+xml application/postscript application/x-shockwave-fla
* `config.active_storage.resolve_model_to_route` can be used to globally change how Active Storage files are delivered.
Allowed values are:
* `:rails_storage_redirect`: Redirect to signed, short-lived service URLs.
* `:rails_storage_proxy`: Proxy files by downloading them.

View File

@ -271,6 +271,7 @@ Action Cable JavaScript API:
- ActionCable.WebSocket = MyWebSocket
+ ActionCable.adapters.WebSocket = MyWebSocket
```
```diff
- ActionCable.logger = myLogger
+ ActionCable.adapters.logger = myLogger
@ -285,6 +286,7 @@ Action Cable JavaScript API:
- ActionCable.startDebugging()
+ ActionCable.logger.enabled = true
```
```diff
- ActionCable.stopDebugging()
+ ActionCable.logger.enabled = false
@ -1764,12 +1766,12 @@ this gem such as `whitelist_attributes` or `mass_assignment_sanitizer` options.
* Rails 4.0 requires that scopes use a callable object such as a Proc or lambda:
```ruby
```ruby
scope :active, where(active: true)
# becomes
scope :active, -> { where active: true }
```
```
* Rails 4.0 has deprecated `ActiveRecord::Fixtures` in favor of `ActiveRecord::FixtureSet`.
@ -1795,15 +1797,15 @@ this gem such as `whitelist_attributes` or `mass_assignment_sanitizer` options.
* Rails 4.0 has changed to default join table for `has_and_belongs_to_many` relations to strip the common prefix off the second table name. Any existing `has_and_belongs_to_many` relationship between models with a common prefix must be specified with the `join_table` option. For example:
```ruby
CatalogCategory < ActiveRecord::Base
```ruby
CatalogCategory < ActiveRecord::Base
has_and_belongs_to_many :catalog_products, join_table: 'catalog_categories_catalog_products'
end
end
CatalogProduct < ActiveRecord::Base
CatalogProduct < ActiveRecord::Base
has_and_belongs_to_many :catalog_categories, join_table: 'catalog_categories_catalog_products'
end
```
end
```
* Note that the prefix takes scopes into account as well, so relations between `Catalog::Category` and `Catalog::Product` or `Catalog::Category` and `CatalogProduct` need to be updated similarly.
@ -1817,30 +1819,30 @@ Rails 4.0 extracted Active Resource to its own gem. If you still need the featur
* Rails 4.0 has changed `ActiveModel::Serializers::JSON.include_root_in_json` default value to `false`. Now, Active Model Serializers and Active Record objects have the same default behavior. This means that you can comment or remove the following option in the `config/initializers/wrap_parameters.rb` file:
```ruby
# Disable root element in JSON by default.
# ActiveSupport.on_load(:active_record) do
# self.include_root_in_json = false
# end
```
```ruby
# Disable root element in JSON by default.
# ActiveSupport.on_load(:active_record) do
# self.include_root_in_json = false
# end
```
### Action Pack
* Rails 4.0 introduces `ActiveSupport::KeyGenerator` and uses this as a base from which to generate and verify signed cookies (among other things). Existing signed cookies generated with Rails 3.x will be transparently upgraded if you leave your existing `secret_token` in place and add the new `secret_key_base`.
```ruby
```ruby
# config/initializers/secret_token.rb
Myapp::Application.config.secret_token = 'existing secret token'
Myapp::Application.config.secret_key_base = 'new secret key base'
```
```
Please note that you should wait to set `secret_key_base` until you have 100% of your userbase on Rails 4.x and are reasonably sure you will not need to rollback to Rails 3.x. This is because cookies signed based on the new `secret_key_base` in Rails 4.x are not backwards compatible with Rails 3.x. You are free to leave your existing `secret_token` in place, not set the new `secret_key_base`, and ignore the deprecation warnings until you are reasonably sure that your upgrade is otherwise complete.
Please note that you should wait to set `secret_key_base` until you have 100% of your userbase on Rails 4.x and are reasonably sure you will not need to rollback to Rails 3.x. This is because cookies signed based on the new `secret_key_base` in Rails 4.x are not backwards compatible with Rails 3.x. You are free to leave your existing `secret_token` in place, not set the new `secret_key_base`, and ignore the deprecation warnings until you are reasonably sure that your upgrade is otherwise complete.
If you are relying on the ability for external applications or JavaScript to be able to read your Rails app's signed session cookies (or signed cookies in general) you should not set `secret_key_base` until you have decoupled these concerns.
If you are relying on the ability for external applications or JavaScript to be able to read your Rails app's signed session cookies (or signed cookies in general) you should not set `secret_key_base` until you have decoupled these concerns.
* Rails 4.0 encrypts the contents of cookie-based sessions if `secret_key_base` has been set. Rails 3.x signed, but did not encrypt, the contents of cookie-based session. Signed cookies are "secure" in that they are verified to have been generated by your app and are tamper-proof. However, the contents can be viewed by end users, and encrypting the contents eliminates this caveat/concern without a significant performance penalty.
Please read [Pull Request #9978](https://github.com/rails/rails/pull/9978) for details on the move to encrypted session cookies.
Please read [Pull Request #9978](https://github.com/rails/rails/pull/9978) for details on the move to encrypted session cookies.
* Rails 4.0 removed the `ActionController::Base.asset_path` option. Use the assets pipeline feature.
@ -1865,36 +1867,36 @@ or `link_to_unless`).
* Rails 4.0 raises an `ArgumentError` if clashing named routes are defined. This can be triggered by explicitly defined named routes or by the `resources` method. Here are two examples that clash with routes named `example_path`:
```ruby
```ruby
get 'one' => 'test#example', as: :example
get 'two' => 'test#example', as: :example
```
```
```ruby
```ruby
resources :examples
get 'clashing/:id' => 'test#example', as: :example
```
```
In the first case, you can simply avoid using the same name for multiple
routes. In the second, you can use the `only` or `except` options provided by
the `resources` method to restrict the routes created as detailed in the
[Routing Guide](routing.html#restricting-the-routes-created).
In the first case, you can simply avoid using the same name for multiple
routes. In the second, you can use the `only` or `except` options provided by
the `resources` method to restrict the routes created as detailed in the
[Routing Guide](routing.html#restricting-the-routes-created).
* Rails 4.0 also changed the way unicode character routes are drawn. Now you can draw unicode character routes directly. If you already draw such routes, you must change them, for example:
```ruby
get Rack::Utils.escape('こんにちは'), controller: 'welcome', action: 'index'
```
```ruby
get Rack::Utils.escape('こんにちは'), controller: 'welcome', action: 'index'
```
becomes
becomes
```ruby
get 'こんにちは', controller: 'welcome', action: 'index'
```
```ruby
get 'こんにちは', controller: 'welcome', action: 'index'
```
* Rails 4.0 requires that routes using `match` must specify the request method. For example:
```ruby
```ruby
# Rails 3.x
match '/' => 'root#index'
@ -1903,29 +1905,29 @@ get 'こんにちは', controller: 'welcome', action: 'index'
# or
get '/' => 'root#index'
```
```
* Rails 4.0 has removed `ActionDispatch::BestStandardsSupport` middleware, `<!DOCTYPE html>` already triggers standards mode per https://msdn.microsoft.com/en-us/library/jj676915(v=vs.85).aspx and ChromeFrame header has been moved to `config.action_dispatch.default_headers`.
Remember you must also remove any references to the middleware from your application code, for example:
Remember you must also remove any references to the middleware from your application code, for example:
```ruby
# Raise exception
config.middleware.insert_before(Rack::Lock, ActionDispatch::BestStandardsSupport)
```
```ruby
# Raise exception
config.middleware.insert_before(Rack::Lock, ActionDispatch::BestStandardsSupport)
```
Also check your environment settings for `config.action_dispatch.best_standards_support` and remove it if present.
Also check your environment settings for `config.action_dispatch.best_standards_support` and remove it if present.
* Rails 4.0 allows configuration of HTTP headers by setting `config.action_dispatch.default_headers`. The defaults are as follows:
```ruby
```ruby
config.action_dispatch.default_headers = {
'X-Frame-Options' => 'SAMEORIGIN',
'X-XSS-Protection' => '1; mode=block'
}
```
```
Please note that if your application is dependent on loading certain pages in a `<frame>` or `<iframe>`, then you may need to explicitly set `X-Frame-Options` to `ALLOW-FROM ...` or `ALLOWALL`.
Please note that if your application is dependent on loading certain pages in a `<frame>` or `<iframe>`, then you may need to explicitly set `X-Frame-Options` to `ALLOW-FROM ...` or `ALLOWALL`.
* In Rails 4.0, precompiling assets no longer automatically copies non-JS/CSS assets from `vendor/assets` and `lib/assets`. Rails application and engine developers should put these assets in `app/assets` or configure `config.assets.precompile`.
@ -1965,9 +1967,9 @@ The order in which helpers from more than one directory are loaded has changed i
* `assets:precompile:primary` and `assets:precompile:all` have been removed. Use `assets:precompile` instead.
* The `config.assets.compress` option should be changed to `config.assets.js_compressor` like so for instance:
```ruby
config.assets.js_compressor = :uglifier
```
```ruby
config.assets.js_compressor = :uglifier
```
### sass-rails