diff options
43 files changed, 7049 insertions, 5111 deletions
diff --git a/.gitlab/ci/reports.gitlab-ci.yml b/.gitlab/ci/reports.gitlab-ci.yml index 52ed85190ec..5fdcdc12fc8 100644 --- a/.gitlab/ci/reports.gitlab-ci.yml +++ b/.gitlab/ci/reports.gitlab-ci.yml @@ -40,22 +40,6 @@ brakeman-sast: semgrep-sast: rules: !reference [".reports:rules:semgrep-sast", rules] -gosec-sast: - variables: - GOPATH: "$CI_PROJECT_DIR/vendor/go" - COMPILE: "false" - GOSEC_GO_PKG_PATH: "$CI_PROJECT_DIR" - SECURE_LOG_LEVEL: "debug" - before_script: - - mkdir -p $GOPATH - - cd workhorse - - go get -d ./... - - cd .. - cache: - paths: - - vendor/go - rules: !reference [".reports:rules:gosec-sast", rules] - .secret-analyzer: extends: .default-retry stage: lint diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index 0581c5d27e6..9b3e2941f93 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -1713,15 +1713,6 @@ - '**/*.rb' - '**/Gemfile' -.reports:rules:gosec-sast: - rules: - - if: $SAST_DISABLED - when: never - - if: $SAST_EXCLUDED_ANALYZERS =~ /gosec/ - when: never - - changes: - - '**/*.go' - .reports:rules:semgrep-sast: rules: - if: $SAST_DISABLED diff --git a/.rubocop.yml b/.rubocop.yml index e2718863a1c..6a62c752338 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -600,6 +600,12 @@ Graphql/EnumNames: - 'app/graphql/**/*' - 'ee/app/graphql/**/*' +Graphql/EnumValues: + Enabled: true + Include: + - 'app/graphql/**/*' + - 'ee/app/graphql/**/*' + # Cops for upgrade to gitlab-styles 3.1.0 RSpec/ImplicitSubject: Enabled: false diff --git a/.rubocop_todo/graphql/enum_values.yml b/.rubocop_todo/graphql/enum_values.yml new file mode 100644 index 00000000000..3984c54a9f2 --- /dev/null +++ b/.rubocop_todo/graphql/enum_values.yml @@ -0,0 +1,37 @@ +--- +Graphql/EnumValues: + Details: grace period + Exclude: + - 'app/graphql/types/alert_management/domain_filter_enum.rb' + - 'app/graphql/types/blob_viewers/type_enum.rb' + - 'app/graphql/types/ci/config/include_type_enum.rb' + - 'app/graphql/types/ci/test_case_status_enum.rb' + - 'app/graphql/types/container_expiration_policy_cadence_enum.rb' + - 'app/graphql/types/container_expiration_policy_keep_enum.rb' + - 'app/graphql/types/container_expiration_policy_older_than_enum.rb' + - 'app/graphql/types/customer_relations/contact_state_enum.rb' + - 'app/graphql/types/customer_relations/organization_state_enum.rb' + - 'app/graphql/types/design_management/design_version_event_enum.rb' + - 'app/graphql/types/issuable_state_enum.rb' + - 'app/graphql/types/merge_request_state_enum.rb' + - 'app/graphql/types/milestone_state_enum.rb' + - 'app/graphql/types/notes/position_type_enum.rb' + - 'app/graphql/types/packages/cleanup/keep_duplicated_package_files_enum.rb' + - 'app/graphql/types/snippets/blob_action_enum.rb' + - 'app/graphql/types/snippets/type_enum.rb' + - 'app/graphql/types/snippets/visibility_scopes_enum.rb' + - 'app/graphql/types/todo_action_enum.rb' + - 'app/graphql/types/todo_state_enum.rb' + - 'app/graphql/types/tree/type_enum.rb' + - 'app/graphql/types/user_state_enum.rb' + - 'app/graphql/types/visibility_levels_enum.rb' + - 'ee/app/graphql/ee/types/list_limit_metric_enum.rb' + - 'ee/app/graphql/types/epic_state_enum.rb' + - 'ee/app/graphql/types/health_status_enum.rb' + - 'ee/app/graphql/types/incident_management/issuable_resource_link_type_enum.rb' + - 'ee/app/graphql/types/iteration_state_enum.rb' + - 'ee/app/graphql/types/move_type_enum.rb' + - 'ee/app/graphql/types/network_policy_kind_enum.rb' + - 'ee/app/graphql/types/security_scanner_type_enum.rb' + - 'ee/app/graphql/types/vulnerability_report_type_enum.rb' + - 'ee/app/graphql/types/vulnerability_sort_enum.rb' diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index 47ff9d7c870..3c1bc23dd9e 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -f75740430e51520d3edcd22065285cec050d2b74 +061bcd50aa4e5bae26265f8f039e6786b059053d diff --git a/app/assets/javascripts/google_tag_manager/index.js b/app/assets/javascripts/google_tag_manager/index.js index 5b0bcfa963b..98c9db1fc9a 100644 --- a/app/assets/javascripts/google_tag_manager/index.js +++ b/app/assets/javascripts/google_tag_manager/index.js @@ -40,6 +40,11 @@ const generateProductInfo = (sku, quantity) => { }; const isSupported = () => Boolean(window.dataLayer) && gon.features?.gitlabGtmDatalayer; +// gon.features.gitlabGtmDatalayer is set by writing +// `push_frontend_feature_flag(:gitlab_gtm_datalayer, type: :ops)` +// to the appropriate controller +// window.dataLayer is set by adding partials to the appropriate view found in +// views/layouts/_google_tag_manager_body.html.haml and _google_tag_manager_head.html.haml const pushEvent = (event, args = {}) => { if (!window.dataLayer) { @@ -287,3 +292,27 @@ export const trackCompanyForm = (aboutYourCompanyType) => { pushEvent('aboutYourCompanyFormSubmit', { aboutYourCompanyType }); }; + +export const saasTrialWelcome = () => { + if (!isSupported()) { + return; + } + + const saasTrialWelcomeButton = document.querySelector('.js-trial-welcome-btn'); + + saasTrialWelcomeButton?.addEventListener('click', () => { + pushEvent('saasTrialWelcome'); + }); +}; + +export const saasTrialContinuousOnboarding = () => { + if (!isSupported()) { + return; + } + + const getStartedButton = document.querySelector('.js-get-started-btn'); + + getStartedButton?.addEventListener('click', () => { + pushEvent('saasTrialContinuousOnboarding'); + }); +}; diff --git a/app/controllers/concerns/product_analytics_tracking.rb b/app/controllers/concerns/product_analytics_tracking.rb index 4f96cc5c895..dfa159ccfd7 100644 --- a/app/controllers/concerns/product_analytics_tracking.rb +++ b/app/controllers/concerns/product_analytics_tracking.rb @@ -6,6 +6,8 @@ module ProductAnalyticsTracking extend ActiveSupport::Concern class_methods do + # TODO: Remove once all the events are migrated to #track_custom_event + # during https://gitlab.com/groups/gitlab-org/-/epics/8641 def track_event(*controller_actions, name:, conditions: nil, destinations: [:redis_hll], &block) custom_conditions = [:trackable_html_request?, *conditions] diff --git a/app/models/container_repository.rb b/app/models/container_repository.rb index c8b8fe5c951..bd75f2631d5 100644 --- a/app/models/container_repository.rb +++ b/app/models/container_repository.rb @@ -6,6 +6,7 @@ class ContainerRepository < ApplicationRecord include EachBatch include Sortable include AfterCommitQueue + include Packages::Destructible WAITING_CLEANUP_STATUSES = %i[cleanup_scheduled cleanup_unfinished].freeze REQUIRING_CLEANUP_STATUSES = %i[cleanup_unscheduled cleanup_scheduled].freeze @@ -34,7 +35,7 @@ class ContainerRepository < ApplicationRecord numericality: { greater_than_or_equal_to: 0 }, allow_nil: false - enum status: { delete_scheduled: 0, delete_failed: 1 } + enum status: { delete_scheduled: 0, delete_failed: 1, delete_ongoing: 2 } enum expiration_policy_cleanup_status: { cleanup_unscheduled: 0, cleanup_scheduled: 1, cleanup_unfinished: 2, cleanup_ongoing: 3 } enum migration_skipped_reason: { @@ -285,6 +286,10 @@ class ContainerRepository < ApplicationRecord all end + class << self + alias_method :pending_destruction, :delete_scheduled # needed by Packages::Destructible + end + def skip_import(reason:) self.migration_skipped_reason = reason @@ -514,6 +519,14 @@ class ContainerRepository < ApplicationRecord end end + def set_delete_ongoing_status + update_columns(status: :delete_ongoing, delete_started_at: Time.zone.now) + end + + def set_delete_scheduled_status + update_columns(status: :delete_scheduled, delete_started_at: nil) + end + def migration_in_active_state? migration_state.in?(ACTIVE_MIGRATION_STATES) end diff --git a/app/services/clusters/applications/check_upgrade_progress_service.rb b/app/services/clusters/applications/check_upgrade_progress_service.rb deleted file mode 100644 index c4fd234b302..00000000000 --- a/app/services/clusters/applications/check_upgrade_progress_service.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -module Clusters - module Applications - class CheckUpgradeProgressService < BaseHelmService - def execute - return unless app.updating? - - case phase - when ::Gitlab::Kubernetes::Pod::SUCCEEDED - on_success - when ::Gitlab::Kubernetes::Pod::FAILED - on_failed - else - check_timeout - end - rescue ::Kubeclient::HttpError => e - app.make_update_errored!("Kubernetes error: #{e.message}") unless app.update_errored? - end - - private - - def on_success - app.make_installed! - ensure - remove_pod - end - - def on_failed - app.make_update_errored!(errors || 'Update silently failed') - ensure - remove_pod - end - - def check_timeout - if timed_out? - begin - app.make_update_errored!('Update timed out') - ensure - remove_pod - end - else - ::ClusterWaitForAppUpdateWorker.perform_in( - ::ClusterWaitForAppUpdateWorker::INTERVAL, app.name, app.id) - end - end - - def timed_out? - Time.current.utc - app.updated_at.to_time.utc > ::ClusterWaitForAppUpdateWorker::TIMEOUT - end - - def remove_pod - helm_api.delete_pod!(pod_name) - rescue StandardError - # no-op - end - - def phase - helm_api.status(pod_name) - end - - def errors - helm_api.log(pod_name) - end - - def pod_name - @pod_name ||= patch_command.pod_name - end - end - end -end diff --git a/app/views/registrations/welcome/show.html.haml b/app/views/registrations/welcome/show.html.haml index fe455f4a0bc..283659875ef 100644 --- a/app/views/registrations/welcome/show.html.haml +++ b/app/views/registrations/welcome/show.html.haml @@ -7,7 +7,6 @@ = render "layouts/one_trust" = render "layouts/bizible" = render "layouts/google_tag_manager_body" - .row.gl-flex-grow-1 .d-flex.gl-flex-direction-column.gl-align-items-center.gl-w-full.gl-px-5.gl-pb-5 .edit-profile.login-page.d-flex.flex-column.gl-align-items-center diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index c28f4a899b2..4ff496e5305 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -147,6 +147,15 @@ :weight: 1 :idempotent: false :tags: [] +- :name: container_repository_delete:container_registry_delete_container_repository + :worker_name: ContainerRegistry::DeleteContainerRepositoryWorker + :feature_category: :container_registry + :has_external_dependencies: false + :urgency: :low + :resource_boundary: :unknown + :weight: 1 + :idempotent: true + :tags: [] - :name: cronjob:admin_email :worker_name: AdminEmailWorker :feature_category: :source_code_management diff --git a/app/workers/cluster_wait_for_app_update_worker.rb b/app/workers/cluster_wait_for_app_update_worker.rb index e96e03ae249..084e8b41a49 100644 --- a/app/workers/cluster_wait_for_app_update_worker.rb +++ b/app/workers/cluster_wait_for_app_update_worker.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# DEPRECATED +# +# To be removed by https://gitlab.com/gitlab-org/gitlab/-/issues/366573 class ClusterWaitForAppUpdateWorker # rubocop:disable Scalability/IdempotentWorker include ApplicationWorker @@ -14,9 +17,5 @@ class ClusterWaitForAppUpdateWorker # rubocop:disable Scalability/IdempotentWork loggable_arguments 0 - def perform(app_name, app_id) - find_application(app_name, app_id) do |app| - ::Clusters::Applications::CheckUpgradeProgressService.new(app).execute - end - end + def perform(app_name, app_id); end end diff --git a/app/workers/container_registry/delete_container_repository_worker.rb b/app/workers/container_registry/delete_container_repository_worker.rb new file mode 100644 index 00000000000..1f94b1b9e71 --- /dev/null +++ b/app/workers/container_registry/delete_container_repository_worker.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +module ContainerRegistry + class DeleteContainerRepositoryWorker + include ApplicationWorker + include LimitedCapacity::Worker + include Gitlab::Utils::StrongMemoize + extend ::Gitlab::Utils::Override + + data_consistency :always + queue_namespace :container_repository_delete + feature_category :container_registry + urgency :low + worker_resource_boundary :unknown + idempotent! + + MAX_CAPACITY = 2 + CLEANUP_TAGS_SERVICE_PARAMS = { + 'name_regex_delete' => '.*', + 'container_expiration_policy' => true # to avoid permissions checks + }.freeze + + def perform_work + return unless next_container_repository + + result = delete_tags + log_delete_tags_service_result(next_container_repository, result) + + if result[:status] == :error || next_container_repository.tags_count != 0 + return next_container_repository.set_delete_scheduled_status + end + + next_container_repository.destroy! + rescue StandardError => exception + next_container_repository&.set_delete_scheduled_status + + Gitlab::ErrorTracking.log_exception(exception, class: self.class.name) + end + + def remaining_work_count + ::ContainerRepository.delete_scheduled.limit(max_running_jobs + 1).count + end + + def max_running_jobs + MAX_CAPACITY + end + + private + + def delete_tags + service = Projects::ContainerRepository::CleanupTagsService.new( + container_repository: next_container_repository, + params: CLEANUP_TAGS_SERVICE_PARAMS + ) + service.execute + end + + def next_container_repository + strong_memoize(:next_container_repository) do + ContainerRepository.transaction do + # we don't care about the order + repository = ContainerRepository.next_pending_destruction(order_by: nil) + + repository&.tap(&:set_delete_ongoing_status) + end + end + end + + def log_delete_tags_service_result(container_repository, delete_tags_service_result) + logger.info( + structured_payload( + project_id: container_repository.project_id, + container_repository_id: container_repository.id, + container_repository_path: container_repository.path, + tags_size_before_delete: delete_tags_service_result[:original_size], + deleted_tags_size: delete_tags_service_result[:deleted_size] + ) + ) + end + end +end diff --git a/app/workers/database/batched_background_migration/execution_worker.rb b/app/workers/database/batched_background_migration/execution_worker.rb new file mode 100644 index 00000000000..341e509c9c6 --- /dev/null +++ b/app/workers/database/batched_background_migration/execution_worker.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +module Database + module BatchedBackgroundMigration + class ExecutionWorker # rubocop:disable Scalability/IdempotentWorker + include Gitlab::Utils::StrongMemoize + + INTERVAL_VARIANCE = 5.seconds.freeze + + def perform(database_name, migration_id) + self.database_name = database_name + + Gitlab::Database::SharedModel.using_connection(base_model.connection) do + migration = find_migration(migration_id) + + break unless migration + + run(migration) if migration.active? && migration.interval_elapsed?(variance: INTERVAL_VARIANCE) + end + end + + private + + attr_accessor :database_name + + def base_model + strong_memoize(:base_model) do + Gitlab::Database.database_base_models[database_name] + end + end + + def find_migration(id) + Gitlab::Database::BackgroundMigration::BatchedMigration.find_executable(id, connection: base_model.connection) + end + + def run(migration) + Gitlab::Database::BackgroundMigration::BatchedMigrationRunner.new(connection: base_model.connection) + .run_migration_job(migration) + end + end + end +end diff --git a/app/workers/database/batched_background_migration/single_database_worker.rb b/app/workers/database/batched_background_migration/single_database_worker.rb index cfbd44ba397..0c7c51d5c0a 100644 --- a/app/workers/database/batched_background_migration/single_database_worker.rb +++ b/app/workers/database/batched_background_migration/single_database_worker.rb @@ -58,14 +58,7 @@ module Database break unless self.class.enabled? && active_migration with_exclusive_lease(active_migration.interval) do - # Now that we have the exclusive lease, reload migration in case another process has changed it. - # This is a temporary solution until we have better concurrency handling around job execution - # - # We also have to disable this cop, because ApplicationRecord aliases reset to reload, but our database - # models don't inherit from ApplicationRecord - active_migration.reload # rubocop:disable Cop/ActiveRecordAssociationReload - - run_active_migration if active_migration.active? && active_migration.interval_elapsed?(variance: INTERVAL_VARIANCE) + run_active_migration end end end @@ -77,7 +70,7 @@ module Database end def run_active_migration - Gitlab::Database::BackgroundMigration::BatchedMigrationRunner.new(connection: base_model.connection).run_migration_job(active_migration) + Database::BatchedBackgroundMigration::ExecutionWorker.new.perform(self.class.tracking_database, active_migration.id) end def base_model diff --git a/config/sidekiq_queues.yml b/config/sidekiq_queues.yml index eff83e3f3c4..d6a9983a816 100644 --- a/config/sidekiq_queues.yml +++ b/config/sidekiq_queues.yml @@ -109,6 +109,8 @@ - 1 - - container_repository - 1 +- - container_repository_delete + - 1 - - create_commit_signature - 2 - - create_github_webhook diff --git a/db/migrate/20221020124018_add_delete_started_at_to_container_repositories.rb b/db/migrate/20221020124018_add_delete_started_at_to_container_repositories.rb new file mode 100644 index 00000000000..c225d9cc343 --- /dev/null +++ b/db/migrate/20221020124018_add_delete_started_at_to_container_repositories.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddDeleteStartedAtToContainerRepositories < Gitlab::Database::Migration[2.0] + def change + add_column :container_repositories, + :delete_started_at, + :datetime_with_timezone, + null: true, + default: nil + end +end diff --git a/db/migrate/20221025105205_add_status_and_id_index_to_container_repositories.rb b/db/migrate/20221025105205_add_status_and_id_index_to_container_repositories.rb new file mode 100644 index 00000000000..380ffd2e484 --- /dev/null +++ b/db/migrate/20221025105205_add_status_and_id_index_to_container_repositories.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddStatusAndIdIndexToContainerRepositories < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_container_repositories_on_status_and_id' + + def up + add_concurrent_index :container_repositories, [:status, :id], name: INDEX_NAME, where: 'status IS NOT NULL' + end + + def down + remove_concurrent_index :container_repositories, [:status, :id], name: INDEX_NAME + end +end diff --git a/db/schema_migrations/20221020124018 b/db/schema_migrations/20221020124018 new file mode 100644 index 00000000000..6f6c76eb531 --- /dev/null +++ b/db/schema_migrations/20221020124018 @@ -0,0 +1 @@ +c4b296345f45b6184e04181708eb2f55a1b3a621f331b75173b33b0036c3176f
\ No newline at end of file diff --git a/db/schema_migrations/20221025105205 b/db/schema_migrations/20221025105205 new file mode 100644 index 00000000000..4003f74aa11 --- /dev/null +++ b/db/schema_migrations/20221025105205 @@ -0,0 +1 @@ +80daa2f50ae9f8c0dee206ed9d45eb04884e14a0331475cb8c9a2d57f4c86ef5
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 416bdd9bf2f..2c69d2baea8 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -14140,6 +14140,7 @@ CREATE TABLE container_repositories ( migration_aborted_in_state text, migration_plan text, last_cleanup_deleted_tags_count integer, + delete_started_at timestamp with time zone, CONSTRAINT check_05e9012f36 CHECK ((char_length(migration_plan) <= 255)), CONSTRAINT check_13c58fe73a CHECK ((char_length(migration_state) <= 255)), CONSTRAINT check_97f0249439 CHECK ((char_length(migration_aborted_in_state) <= 255)) @@ -28688,6 +28689,8 @@ CREATE INDEX index_container_repositories_on_project_id_and_id ON container_repo CREATE UNIQUE INDEX index_container_repositories_on_project_id_and_name ON container_repositories USING btree (project_id, name); +CREATE INDEX index_container_repositories_on_status_and_id ON container_repositories USING btree (status, id) WHERE (status IS NOT NULL); + CREATE INDEX index_container_repository_on_name_trigram ON container_repositories USING gin (name gin_trgm_ops); CREATE UNIQUE INDEX index_content_blocked_states_on_container_id_commit_sha_path ON content_blocked_states USING btree (container_identifier, commit_sha, path); diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index fa72f4f8ea3..7a7fc7b0403 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -20669,6 +20669,7 @@ Status of a container repository. | Value | Description | | ----- | ----------- | | <a id="containerrepositorystatusdelete_failed"></a>`DELETE_FAILED` | Delete Failed status. | +| <a id="containerrepositorystatusdelete_ongoing"></a>`DELETE_ONGOING` | Delete Ongoing status. | | <a id="containerrepositorystatusdelete_scheduled"></a>`DELETE_SCHEDULED` | Delete Scheduled status. | ### `ContainerRepositoryTagSort` diff --git a/glfm_specification/output_example_snapshots/snapshot_spec.html b/glfm_specification/output_example_snapshots/snapshot_spec.html index c78d41e1392..da33abf8a29 100644 --- a/glfm_specification/output_example_snapshots/snapshot_spec.html +++ b/glfm_specification/output_example_snapshots/snapshot_spec.html @@ -59,59 +59,69 @@ in an indented code block. (Note, however, that internal tabs are passed through as literal tabs, not expanded to spaces.)</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="77:1-82:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">→foo→baz→→bim</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><pre><code>foo→baz→→bim</span> -<span id="LC4" class="line" lang="plaintext"></code></pre></span></code></pre> +<pre data-sourcepos="77:1-79:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">→foo→baz→→bim</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="84:1-89:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> →foo→baz→→bim</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><pre><code>foo→baz→→bim</span> -<span id="LC4" class="line" lang="plaintext"></code></pre></span></code></pre> +<pre data-sourcepos="81:1-84:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>foo→baz→→bim</span> +<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="91:1-98:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> a→a</span> -<span id="LC2" class="line" lang="plaintext"> ὐ→a</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><pre><code>a→a</span> -<span id="LC5" class="line" lang="plaintext">ὐ→a</span> -<span id="LC6" class="line" lang="plaintext"></code></pre></span></code></pre> +<pre data-sourcepos="86:1-88:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> →foo→baz→→bim</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="90:1-93:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>foo→baz→→bim</span> +<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="95:1-98:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> a→a</span> +<span id="LC2" class="line" lang="plaintext"> ὐ→a</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="100:1-104:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>a→a</span> +<span id="LC2" class="line" lang="plaintext">ὐ→a</span> +<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="100:1-102:38" dir="auto">In the following example, a continuation paragraph of a list +<p data-sourcepos="106:1-108:38" dir="auto">In the following example, a continuation paragraph of a list item is indented with a tab; this has exactly the same effect as indentation with four spaces would:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="104:1-115:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> - foo</span> +<pre data-sourcepos="110:1-114:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> - foo</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">→bar</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><ul></span> -<span id="LC6" class="line" lang="plaintext"><li></span> -<span id="LC7" class="line" lang="plaintext"><p>foo</p></span> -<span id="LC8" class="line" lang="plaintext"><p>bar</p></span> -<span id="LC9" class="line" lang="plaintext"></li></span> -<span id="LC10" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC3" class="line" lang="plaintext">→bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="116:1-123:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>foo</p></span> +<span id="LC4" class="line" lang="plaintext"><p>bar</p></span> +<span id="LC5" class="line" lang="plaintext"></li></span> +<span id="LC6" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="117:1-129:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> +<pre data-sourcepos="125:1-129:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">→→bar</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><ul></span> -<span id="LC6" class="line" lang="plaintext"><li></span> -<span id="LC7" class="line" lang="plaintext"><p>foo</p></span> -<span id="LC8" class="line" lang="plaintext"><pre><code> bar</span> -<span id="LC9" class="line" lang="plaintext"></code></pre></span> -<span id="LC10" class="line" lang="plaintext"></li></span> -<span id="LC11" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC3" class="line" lang="plaintext">→→bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="131:1-139:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>foo</p></span> +<span id="LC4" class="line" lang="plaintext"><pre><code> bar</span> +<span id="LC5" class="line" lang="plaintext"></code></pre></span> +<span id="LC6" class="line" lang="plaintext"></li></span> +<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="131:1-138:36" dir="auto">Normally the <code>></code> that begins a block quote may be followed +<p data-sourcepos="141:1-148:36" dir="auto">Normally the <code>></code> that begins a block quote may be followed optionally by a space, which is not considered part of the content. In the following case <code>></code> is followed by a tab, which is treated as if it were expanded into three spaces. @@ -120,92 +130,106 @@ delimiter, <code>foo</code> is considered to be indented six spaces inside the block quote context, so we get an indented code block starting with two spaces.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="140:1-147:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">>→→foo</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><blockquote></span> -<span id="LC4" class="line" lang="plaintext"><pre><code> foo</span> -<span id="LC5" class="line" lang="plaintext"></code></pre></span> -<span id="LC6" class="line" lang="plaintext"></blockquote></span></code></pre> +<pre data-sourcepos="150:1-152:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">>→→foo</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="149:1-158:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">-→→foo</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><ul></span> -<span id="LC4" class="line" lang="plaintext"><li></span> -<span id="LC5" class="line" lang="plaintext"><pre><code> foo</span> -<span id="LC6" class="line" lang="plaintext"></code></pre></span> -<span id="LC7" class="line" lang="plaintext"></li></span> -<span id="LC8" class="line" lang="plaintext"></ul></span></code></pre> +<pre data-sourcepos="154:1-159:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><pre><code> foo</span> +<span id="LC3" class="line" lang="plaintext"></code></pre></span> +<span id="LC4" class="line" lang="plaintext"></blockquote></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="161:1-168:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> foo</span> -<span id="LC2" class="line" lang="plaintext">→bar</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><pre><code>foo</span> -<span id="LC5" class="line" lang="plaintext">bar</span> -<span id="LC6" class="line" lang="plaintext"></code></pre></span></code></pre> +<pre data-sourcepos="161:1-163:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">-→→foo</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="165:1-172:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><pre><code> foo</span> +<span id="LC4" class="line" lang="plaintext"></code></pre></span> +<span id="LC5" class="line" lang="plaintext"></li></span> +<span id="LC6" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="170:1-186:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> - foo</span> +<pre data-sourcepos="175:1-178:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> foo</span> +<span id="LC2" class="line" lang="plaintext">→bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="180:1-184:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>foo</span> +<span id="LC2" class="line" lang="plaintext">bar</span> +<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="186:1-190:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> - foo</span> <span id="LC2" class="line" lang="plaintext"> - bar</span> -<span id="LC3" class="line" lang="plaintext">→ - baz</span> -<span id="LC4" class="line" lang="plaintext">.</span> +<span id="LC3" class="line" lang="plaintext">→ - baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="192:1-204:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>foo</span> +<span id="LC3" class="line" lang="plaintext"><ul></span> +<span id="LC4" class="line" lang="plaintext"><li>bar</span> <span id="LC5" class="line" lang="plaintext"><ul></span> -<span id="LC6" class="line" lang="plaintext"><li>foo</span> -<span id="LC7" class="line" lang="plaintext"><ul></span> -<span id="LC8" class="line" lang="plaintext"><li>bar</span> -<span id="LC9" class="line" lang="plaintext"><ul></span> -<span id="LC10" class="line" lang="plaintext"><li>baz</li></span> -<span id="LC11" class="line" lang="plaintext"></ul></span> -<span id="LC12" class="line" lang="plaintext"></li></span> -<span id="LC13" class="line" lang="plaintext"></ul></span> -<span id="LC14" class="line" lang="plaintext"></li></span> -<span id="LC15" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC6" class="line" lang="plaintext"><li>baz</li></span> +<span id="LC7" class="line" lang="plaintext"></ul></span> +<span id="LC8" class="line" lang="plaintext"></li></span> +<span id="LC9" class="line" lang="plaintext"></ul></span> +<span id="LC10" class="line" lang="plaintext"></li></span> +<span id="LC11" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="188:1-192:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">#→Foo</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><h1>Foo</h1></span></code></pre> +<pre data-sourcepos="206:1-208:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">#→Foo</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="194:1-198:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*→*→*→</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><hr /></span></code></pre> +<pre data-sourcepos="210:1-212:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>Foo</h1></span></code></pre> <copy-code></copy-code> </div> -<h2 data-sourcepos="201:1-201:22" dir="auto"> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="214:1-216:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*→*→*→</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="218:1-220:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span></code></pre> +<copy-code></copy-code> +</div> +<h2 data-sourcepos="223:1-223:22" dir="auto"> <a id="user-content-insecure-characters" class="anchor" href="#insecure-characters" aria-hidden="true"></a>Insecure characters</h2> -<p data-sourcepos="203:1-204:42" dir="auto">For security reasons, the Unicode character <code>U+0000</code> must be replaced +<p data-sourcepos="225:1-226:42" dir="auto">For security reasons, the Unicode character <code>U+0000</code> must be replaced with the REPLACEMENT CHARACTER (<code>U+FFFD</code>).</p> -<h1 data-sourcepos="206:1-206:20" dir="auto"> +<h1 data-sourcepos="228:1-228:20" dir="auto"> <a id="user-content-blocks-and-inlines" class="anchor" href="#blocks-and-inlines" aria-hidden="true"></a>Blocks and inlines</h1> -<p data-sourcepos="208:1-213:54" dir="auto">We can think of a document as a sequence of +<p data-sourcepos="230:1-235:54" dir="auto">We can think of a document as a sequence of <a href="@">blocks</a>---structural elements like paragraphs, block quotations, lists, headings, rules, and code blocks. Some blocks (like block quotes and list items) contain other blocks; others (like headings and paragraphs) contain <a href="@">inline</a> content---text, links, emphasized text, images, code spans, and so on.</p> -<h2 data-sourcepos="215:1-215:13" dir="auto"> +<h2 data-sourcepos="237:1-237:13" dir="auto"> <a id="user-content-precedence" class="anchor" href="#precedence" aria-hidden="true"></a>Precedence</h2> -<p data-sourcepos="217:1-219:59" dir="auto">Indicators of block structure always take precedence over indicators +<p data-sourcepos="239:1-241:59" dir="auto">Indicators of block structure always take precedence over indicators of inline structure. So, for example, the following is a list with two items, not a list with one item containing a code span:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="221:1-229:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- `one</span> -<span id="LC2" class="line" lang="plaintext">- two`</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><ul></span> -<span id="LC5" class="line" lang="plaintext"><li>`one</li></span> -<span id="LC6" class="line" lang="plaintext"><li>two`</li></span> -<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre> +<pre data-sourcepos="243:1-246:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- `one</span> +<span id="LC2" class="line" lang="plaintext">- two`</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="248:1-253:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>`one</li></span> +<span id="LC3" class="line" lang="plaintext"><li>two`</li></span> +<span id="LC4" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="232:1-239:66" dir="auto">This means that parsing can proceed in two steps: first, the block +<p data-sourcepos="256:1-263:66" dir="auto">This means that parsing can proceed in two steps: first, the block structure of the document can be discerned; second, text lines inside paragraphs, headings, and other block constructs can be parsed for inline structure. The second step requires information about link reference @@ -213,209 +237,247 @@ definitions that will be available only at the end of the first step. Note that the first step requires processing lines in sequence, but the second can be parallelized, since the inline parsing of one block element does not affect the inline parsing of any other.</p> -<h2 data-sourcepos="241:1-241:35" dir="auto"> +<h2 data-sourcepos="265:1-265:35" dir="auto"> <a id="user-content-container-blocks-and-leaf-blocks" class="anchor" href="#container-blocks-and-leaf-blocks" aria-hidden="true"></a>Container blocks and leaf blocks</h2> -<p data-sourcepos="243:1-246:13" dir="auto">We can divide blocks into two types: +<p data-sourcepos="267:1-270:13" dir="auto">We can divide blocks into two types: <a href="@">container blocks</a>, which can contain other blocks, and <a href="@">leaf blocks</a>, which cannot.</p> -<h1 data-sourcepos="248:1-248:13" dir="auto"> +<h1 data-sourcepos="272:1-272:13" dir="auto"> <a id="user-content-leaf-blocks" class="anchor" href="#leaf-blocks" aria-hidden="true"></a>Leaf blocks</h1> -<p data-sourcepos="250:1-251:18" dir="auto">This section describes the different kinds of leaf block that make up a +<p data-sourcepos="274:1-275:18" dir="auto">This section describes the different kinds of leaf block that make up a Markdown document.</p> -<h2 data-sourcepos="253:1-253:18" dir="auto"> +<h2 data-sourcepos="277:1-277:18" dir="auto"> <a id="user-content-thematic-breaks" class="anchor" href="#thematic-breaks" aria-hidden="true"></a>Thematic breaks</h2> -<p data-sourcepos="255:1-258:20" dir="auto">A line consisting of 0-3 spaces of indentation, followed by a sequence +<p data-sourcepos="279:1-282:20" dir="auto">A line consisting of 0-3 spaces of indentation, followed by a sequence of three or more matching <code>-</code>, <code>_</code>, or <code>*</code> characters, each followed optionally by any number of spaces or tabs, forms a <a href="@">thematic break</a>.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="260:1-268:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">***</span> +<pre data-sourcepos="284:1-288:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">***</span> <span id="LC2" class="line" lang="plaintext">---</span> -<span id="LC3" class="line" lang="plaintext">___</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><hr /></span> -<span id="LC6" class="line" lang="plaintext"><hr /></span> -<span id="LC7" class="line" lang="plaintext"><hr /></span></code></pre> +<span id="LC3" class="line" lang="plaintext">___</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="271:1-271:17" dir="auto">Wrong characters:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="273:1-277:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">+++</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>+++</p></span></code></pre> +<pre data-sourcepos="290:1-294:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span> +<span id="LC2" class="line" lang="plaintext"><hr /></span> +<span id="LC3" class="line" lang="plaintext"><hr /></span></code></pre> <copy-code></copy-code> </div> +<p data-sourcepos="297:1-297:17" dir="auto">Wrong characters:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="280:1-284:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">===</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>===</p></span></code></pre> +<pre data-sourcepos="299:1-301:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">+++</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="287:1-287:22" dir="auto">Not enough characters:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="289:1-297:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">--</span> +<pre data-sourcepos="303:1-305:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>+++</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="308:1-310:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">===</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="312:1-314:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>===</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="317:1-317:22" dir="auto">Not enough characters:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="319:1-323:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">--</span> <span id="LC2" class="line" lang="plaintext">**</span> -<span id="LC3" class="line" lang="plaintext">__</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>--</span> -<span id="LC6" class="line" lang="plaintext">**</span> -<span id="LC7" class="line" lang="plaintext">__</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">__</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="300:1-300:39" dir="auto">One to three spaces indent are allowed:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="302:1-310:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ***</span> +<pre data-sourcepos="325:1-329:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>--</span> +<span id="LC2" class="line" lang="plaintext">**</span> +<span id="LC3" class="line" lang="plaintext">__</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="332:1-332:39" dir="auto">One to three spaces indent are allowed:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="334:1-338:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ***</span> <span id="LC2" class="line" lang="plaintext"> ***</span> -<span id="LC3" class="line" lang="plaintext"> ***</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><hr /></span> -<span id="LC6" class="line" lang="plaintext"><hr /></span> -<span id="LC7" class="line" lang="plaintext"><hr /></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> ***</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="313:1-313:24" dir="auto">Four spaces is too many:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="315:1-320:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ***</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><pre><code>***</span> -<span id="LC4" class="line" lang="plaintext"></code></pre></span></code></pre> +<pre data-sourcepos="340:1-344:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span> +<span id="LC2" class="line" lang="plaintext"><hr /></span> +<span id="LC3" class="line" lang="plaintext"><hr /></span></code></pre> <copy-code></copy-code> </div> +<p data-sourcepos="347:1-347:24" dir="auto">Four spaces is too many:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="323:1-329:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> -<span id="LC2" class="line" lang="plaintext"> ***</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>Foo</span> -<span id="LC5" class="line" lang="plaintext">***</p></span></code></pre> +<pre data-sourcepos="349:1-351:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ***</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="332:1-332:39" dir="auto">More than three characters may be used:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="334:1-338:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_____________________________________</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><hr /></span></code></pre> +<pre data-sourcepos="353:1-356:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>***</span> +<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="341:1-341:42" dir="auto">Spaces are allowed between the characters:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="343:1-347:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> - - -</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><hr /></span></code></pre> +<pre data-sourcepos="359:1-362:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> +<span id="LC2" class="line" lang="plaintext"> ***</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="350:1-354:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ** * ** * ** * **</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><hr /></span></code></pre> +<pre data-sourcepos="364:1-367:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</span> +<span id="LC2" class="line" lang="plaintext">***</p></span></code></pre> <copy-code></copy-code> </div> +<p data-sourcepos="370:1-370:39" dir="auto">More than three characters may be used:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="357:1-361:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- - - -</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><hr /></span></code></pre> +<pre data-sourcepos="372:1-374:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_____________________________________</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="364:1-364:30" dir="auto">Spaces are allowed at the end:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="366:1-370:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- - - - </span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><hr /></span></code></pre> +<pre data-sourcepos="376:1-378:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="381:1-381:42" dir="auto">Spaces are allowed between the characters:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="383:1-385:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> - - -</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="387:1-389:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="392:1-394:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ** * ** * ** * **</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="396:1-398:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="373:1-373:51" dir="auto">However, no other characters may occur in the line:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="375:1-385:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_ _ _ _ a</span> +<pre data-sourcepos="401:1-403:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- - - -</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="405:1-407:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="410:1-410:30" dir="auto">Spaces are allowed at the end:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="412:1-414:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- - - - </span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="416:1-418:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="421:1-421:51" dir="auto">However, no other characters may occur in the line:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="423:1-429:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_ _ _ _ a</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext">a------</span> <span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext">---a---</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><p>_ _ _ _ a</p></span> -<span id="LC8" class="line" lang="plaintext"><p>a------</p></span> -<span id="LC9" class="line" lang="plaintext"><p>---a---</p></span></code></pre> +<span id="LC5" class="line" lang="plaintext">---a---</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="388:1-389:33" dir="auto">It is required that all of the [non-whitespace characters] be the same. +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="431:1-435:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_ _ _ _ a</p></span> +<span id="LC2" class="line" lang="plaintext"><p>a------</p></span> +<span id="LC3" class="line" lang="plaintext"><p>---a---</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="438:1-439:33" dir="auto">It is required that all of the [non-whitespace characters] be the same. So, this is not a thematic break:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="391:1-395:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> *-*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>-</em></p></span></code></pre> +<pre data-sourcepos="441:1-443:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> *-*</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="445:1-447:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>-</em></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="398:1-398:56" dir="auto">Thematic breaks do not need blank lines before or after:</p> +<p data-sourcepos="450:1-450:56" dir="auto">Thematic breaks do not need blank lines before or after:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="400:1-412:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> +<pre data-sourcepos="452:1-456:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> <span id="LC2" class="line" lang="plaintext">***</span> -<span id="LC3" class="line" lang="plaintext">- bar</span> -<span id="LC4" class="line" lang="plaintext">.</span> +<span id="LC3" class="line" lang="plaintext">- bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="458:1-466:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>foo</li></span> +<span id="LC3" class="line" lang="plaintext"></ul></span> +<span id="LC4" class="line" lang="plaintext"><hr /></span> <span id="LC5" class="line" lang="plaintext"><ul></span> -<span id="LC6" class="line" lang="plaintext"><li>foo</li></span> -<span id="LC7" class="line" lang="plaintext"></ul></span> -<span id="LC8" class="line" lang="plaintext"><hr /></span> -<span id="LC9" class="line" lang="plaintext"><ul></span> -<span id="LC10" class="line" lang="plaintext"><li>bar</li></span> -<span id="LC11" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC6" class="line" lang="plaintext"><li>bar</li></span> +<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="415:1-415:42" dir="auto">Thematic breaks can interrupt a paragraph:</p> +<p data-sourcepos="469:1-469:42" dir="auto">Thematic breaks can interrupt a paragraph:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="417:1-425:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> +<pre data-sourcepos="471:1-475:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> <span id="LC2" class="line" lang="plaintext">***</span> -<span id="LC3" class="line" lang="plaintext">bar</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>Foo</p></span> -<span id="LC6" class="line" lang="plaintext"><hr /></span> -<span id="LC7" class="line" lang="plaintext"><p>bar</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="477:1-481:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</p></span> +<span id="LC2" class="line" lang="plaintext"><hr /></span> +<span id="LC3" class="line" lang="plaintext"><p>bar</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="428:1-432:71" dir="auto">If a line of dashes that meets the above conditions for being a +<p data-sourcepos="484:1-488:71" dir="auto">If a line of dashes that meets the above conditions for being a thematic break could also be interpreted as the underline of a [setext heading], the interpretation as a [setext heading] takes precedence. Thus, for example, this is a setext heading, not a paragraph followed by a thematic break:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="434:1-441:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> +<pre data-sourcepos="490:1-494:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> <span id="LC2" class="line" lang="plaintext">---</span> -<span id="LC3" class="line" lang="plaintext">bar</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><h2>Foo</h2></span> -<span id="LC6" class="line" lang="plaintext"><p>bar</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="496:1-499:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>Foo</h2></span> +<span id="LC2" class="line" lang="plaintext"><p>bar</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="444:1-445:63" dir="auto">When both a thematic break and a list item are possible +<p data-sourcepos="502:1-503:63" dir="auto">When both a thematic break and a list item are possible interpretations of a line, the thematic break takes precedence:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="447:1-459:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">* Foo</span> +<pre data-sourcepos="505:1-509:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">* Foo</span> <span id="LC2" class="line" lang="plaintext">* * *</span> -<span id="LC3" class="line" lang="plaintext">* Bar</span> -<span id="LC4" class="line" lang="plaintext">.</span> +<span id="LC3" class="line" lang="plaintext">* Bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="511:1-519:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>Foo</li></span> +<span id="LC3" class="line" lang="plaintext"></ul></span> +<span id="LC4" class="line" lang="plaintext"><hr /></span> <span id="LC5" class="line" lang="plaintext"><ul></span> -<span id="LC6" class="line" lang="plaintext"><li>Foo</li></span> -<span id="LC7" class="line" lang="plaintext"></ul></span> -<span id="LC8" class="line" lang="plaintext"><hr /></span> -<span id="LC9" class="line" lang="plaintext"><ul></span> -<span id="LC10" class="line" lang="plaintext"><li>Bar</li></span> -<span id="LC11" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC6" class="line" lang="plaintext"><li>Bar</li></span> +<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="462:1-462:68" dir="auto">If you want a thematic break in a list item, use a different bullet:</p> +<p data-sourcepos="522:1-522:68" dir="auto">If you want a thematic break in a list item, use a different bullet:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="464:1-474:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- Foo</span> -<span id="LC2" class="line" lang="plaintext">- * * *</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><ul></span> -<span id="LC5" class="line" lang="plaintext"><li>Foo</li></span> -<span id="LC6" class="line" lang="plaintext"><li></span> -<span id="LC7" class="line" lang="plaintext"><hr /></span> -<span id="LC8" class="line" lang="plaintext"></li></span> -<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre> +<pre data-sourcepos="524:1-527:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- Foo</span> +<span id="LC2" class="line" lang="plaintext">- * * *</span></code></pre> <copy-code></copy-code> </div> -<h2 data-sourcepos="477:1-477:15" dir="auto"> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="529:1-536:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>Foo</li></span> +<span id="LC3" class="line" lang="plaintext"><li></span> +<span id="LC4" class="line" lang="plaintext"><hr /></span> +<span id="LC5" class="line" lang="plaintext"></li></span> +<span id="LC6" class="line" lang="plaintext"></ul></span></code></pre> +<copy-code></copy-code> +</div> +<h2 data-sourcepos="539:1-539:15" dir="auto"> <a id="user-content-atx-headings" class="anchor" href="#atx-headings" aria-hidden="true"></a>ATX headings</h2> -<p data-sourcepos="479:1-489:35" dir="auto">An <a href="@">ATX heading</a> +<p data-sourcepos="541:1-551:35" dir="auto">An <a href="@">ATX heading</a> consists of a string of characters, parsed as inline content, between an opening sequence of 1--6 unescaped <code>#</code> characters and an optional closing sequence of any number of unescaped <code>#</code> characters. @@ -426,31 +488,35 @@ preceded by a [space] and may be followed by spaces only. The opening heading are stripped of leading and trailing spaces before being parsed as inline content. The heading level is equal to the number of <code>#</code> characters in the opening sequence.</p> -<p data-sourcepos="491:1-491:16" dir="auto">Simple headings:</p> +<p data-sourcepos="553:1-553:16" dir="auto">Simple headings:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="493:1-507:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"># foo</span> +<pre data-sourcepos="555:1-562:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"># foo</span> <span id="LC2" class="line" lang="plaintext">## foo</span> <span id="LC3" class="line" lang="plaintext">### foo</span> <span id="LC4" class="line" lang="plaintext">#### foo</span> <span id="LC5" class="line" lang="plaintext">##### foo</span> -<span id="LC6" class="line" lang="plaintext">###### foo</span> -<span id="LC7" class="line" lang="plaintext">.</span> -<span id="LC8" class="line" lang="plaintext"><h1>foo</h1></span> -<span id="LC9" class="line" lang="plaintext"><h2>foo</h2></span> -<span id="LC10" class="line" lang="plaintext"><h3>foo</h3></span> -<span id="LC11" class="line" lang="plaintext"><h4>foo</h4></span> -<span id="LC12" class="line" lang="plaintext"><h5>foo</h5></span> -<span id="LC13" class="line" lang="plaintext"><h6>foo</h6></span></code></pre> +<span id="LC6" class="line" lang="plaintext">###### foo</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="564:1-571:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>foo</h1></span> +<span id="LC2" class="line" lang="plaintext"><h2>foo</h2></span> +<span id="LC3" class="line" lang="plaintext"><h3>foo</h3></span> +<span id="LC4" class="line" lang="plaintext"><h4>foo</h4></span> +<span id="LC5" class="line" lang="plaintext"><h5>foo</h5></span> +<span id="LC6" class="line" lang="plaintext"><h6>foo</h6></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="574:1-574:46" dir="auto">More than six <code>#</code> characters is not a heading:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="576:1-578:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">####### foo</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="510:1-510:46" dir="auto">More than six <code>#</code> characters is not a heading:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="512:1-516:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">####### foo</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>####### foo</p></span></code></pre> +<pre data-sourcepos="580:1-582:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>####### foo</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="519:1-525:9" dir="auto">At least one space is required between the <code>#</code> characters and the +<p data-sourcepos="585:1-591:9" dir="auto">At least one space is required between the <code>#</code> characters and the heading's contents, unless the heading is empty. Note that many implementations currently do not require the space. However, the space was required by the @@ -458,151 +524,183 @@ space was required by the and it helps prevent things like the following from being parsed as headings:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="527:1-534:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">#5 bolt</span> +<pre data-sourcepos="593:1-597:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">#5 bolt</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">#hashtag</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>#5 bolt</p></span> -<span id="LC6" class="line" lang="plaintext"><p>#hashtag</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">#hashtag</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="537:1-537:56" dir="auto">This is not a heading, because the first <code>#</code> is escaped:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="539:1-543:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\## foo</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>## foo</p></span></code></pre> +<pre data-sourcepos="599:1-602:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>#5 bolt</p></span> +<span id="LC2" class="line" lang="plaintext"><p>#hashtag</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="546:1-546:31" dir="auto">Contents are parsed as inlines:</p> +<p data-sourcepos="605:1-605:56" dir="auto">This is not a heading, because the first <code>#</code> is escaped:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="548:1-552:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"># foo *bar* \*baz\*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><h1>foo <em>bar</em> *baz*</h1></span></code></pre> +<pre data-sourcepos="607:1-609:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\## foo</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="555:1-555:71" dir="auto">Leading and trailing [whitespace] is ignored in parsing inline content:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="557:1-561:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"># foo </span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><h1>foo</h1></span></code></pre> +<pre data-sourcepos="611:1-613:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>## foo</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="616:1-616:31" dir="auto">Contents are parsed as inlines:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="618:1-620:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"># foo *bar* \*baz\*</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="564:1-564:44" dir="auto">One to three spaces indentation are allowed:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="566:1-574:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ### foo</span> +<pre data-sourcepos="622:1-624:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>foo <em>bar</em> *baz*</h1></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="627:1-627:71" dir="auto">Leading and trailing [whitespace] is ignored in parsing inline content:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="629:1-631:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"># foo </span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="633:1-635:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>foo</h1></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="638:1-638:44" dir="auto">One to three spaces indentation are allowed:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="640:1-644:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ### foo</span> <span id="LC2" class="line" lang="plaintext"> ## foo</span> -<span id="LC3" class="line" lang="plaintext"> # foo</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><h3>foo</h3></span> -<span id="LC6" class="line" lang="plaintext"><h2>foo</h2></span> -<span id="LC7" class="line" lang="plaintext"><h1>foo</h1></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> # foo</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="577:1-577:25" dir="auto">Four spaces are too much:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="579:1-584:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> # foo</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><pre><code># foo</span> -<span id="LC4" class="line" lang="plaintext"></code></pre></span></code></pre> +<pre data-sourcepos="646:1-650:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h3>foo</h3></span> +<span id="LC2" class="line" lang="plaintext"><h2>foo</h2></span> +<span id="LC3" class="line" lang="plaintext"><h1>foo</h1></span></code></pre> <copy-code></copy-code> </div> +<p data-sourcepos="653:1-653:25" dir="auto">Four spaces are too much:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="587:1-593:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span> -<span id="LC2" class="line" lang="plaintext"> # bar</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>foo</span> -<span id="LC5" class="line" lang="plaintext"># bar</p></span></code></pre> +<pre data-sourcepos="655:1-657:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> # foo</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="659:1-662:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code># foo</span> +<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="665:1-668:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span> +<span id="LC2" class="line" lang="plaintext"> # bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="670:1-673:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo</span> +<span id="LC2" class="line" lang="plaintext"># bar</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="676:1-676:49" dir="auto">A closing sequence of <code>#</code> characters is optional:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="678:1-681:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">## foo ##</span> +<span id="LC2" class="line" lang="plaintext"> ### bar ###</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="683:1-686:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>foo</h2></span> +<span id="LC2" class="line" lang="plaintext"><h3>bar</h3></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="689:1-689:55" dir="auto">It need not be the same length as the opening sequence:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="691:1-694:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"># foo ##################################</span> +<span id="LC2" class="line" lang="plaintext">##### foo ##</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="596:1-596:49" dir="auto">A closing sequence of <code>#</code> characters is optional:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="598:1-604:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">## foo ##</span> -<span id="LC2" class="line" lang="plaintext"> ### bar ###</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><h2>foo</h2></span> -<span id="LC5" class="line" lang="plaintext"><h3>bar</h3></span></code></pre> +<pre data-sourcepos="696:1-699:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>foo</h1></span> +<span id="LC2" class="line" lang="plaintext"><h5>foo</h5></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="607:1-607:55" dir="auto">It need not be the same length as the opening sequence:</p> +<p data-sourcepos="702:1-702:46" dir="auto">Spaces are allowed after the closing sequence:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="609:1-615:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"># foo ##################################</span> -<span id="LC2" class="line" lang="plaintext">##### foo ##</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><h1>foo</h1></span> -<span id="LC5" class="line" lang="plaintext"><h5>foo</h5></span></code></pre> +<pre data-sourcepos="704:1-706:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">### foo ### </span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="618:1-618:46" dir="auto">Spaces are allowed after the closing sequence:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="620:1-624:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">### foo ### </span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><h3>foo</h3></span></code></pre> +<pre data-sourcepos="708:1-710:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h3>foo</h3></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="627:1-629:8" dir="auto">A sequence of <code>#</code> characters with anything but [spaces] following it +<p data-sourcepos="713:1-715:8" dir="auto">A sequence of <code>#</code> characters with anything but [spaces] following it is not a closing sequence, but counts as part of the contents of the heading:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="631:1-635:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">### foo ### b</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><h3>foo ### b</h3></span></code></pre> +<pre data-sourcepos="717:1-719:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">### foo ### b</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="721:1-723:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h3>foo ### b</h3></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="726:1-726:49" dir="auto">The closing sequence must be preceded by a space:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="728:1-730:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"># foo#</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="638:1-638:49" dir="auto">The closing sequence must be preceded by a space:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="640:1-644:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"># foo#</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><h1>foo#</h1></span></code></pre> +<pre data-sourcepos="732:1-734:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>foo#</h1></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="647:1-648:24" dir="auto">Backslash-escaped <code>#</code> characters do not count as part +<p data-sourcepos="737:1-738:24" dir="auto">Backslash-escaped <code>#</code> characters do not count as part of the closing sequence:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="650:1-658:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">### foo \###</span> +<pre data-sourcepos="740:1-744:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">### foo \###</span> <span id="LC2" class="line" lang="plaintext">## foo #\##</span> -<span id="LC3" class="line" lang="plaintext"># foo \#</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><h3>foo ###</h3></span> -<span id="LC6" class="line" lang="plaintext"><h2>foo ###</h2></span> -<span id="LC7" class="line" lang="plaintext"><h1>foo #</h1></span></code></pre> +<span id="LC3" class="line" lang="plaintext"># foo \#</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="746:1-750:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h3>foo ###</h3></span> +<span id="LC2" class="line" lang="plaintext"><h2>foo ###</h2></span> +<span id="LC3" class="line" lang="plaintext"><h1>foo #</h1></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="661:1-662:41" dir="auto">ATX headings need not be separated from surrounding content by blank +<p data-sourcepos="753:1-754:41" dir="auto">ATX headings need not be separated from surrounding content by blank lines, and they can interrupt paragraphs:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="664:1-672:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">****</span> +<pre data-sourcepos="756:1-760:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">****</span> <span id="LC2" class="line" lang="plaintext">## foo</span> -<span id="LC3" class="line" lang="plaintext">****</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><hr /></span> -<span id="LC6" class="line" lang="plaintext"><h2>foo</h2></span> -<span id="LC7" class="line" lang="plaintext"><hr /></span></code></pre> +<span id="LC3" class="line" lang="plaintext">****</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="762:1-766:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span> +<span id="LC2" class="line" lang="plaintext"><h2>foo</h2></span> +<span id="LC3" class="line" lang="plaintext"><hr /></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="675:1-683:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo bar</span> +<pre data-sourcepos="769:1-773:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo bar</span> <span id="LC2" class="line" lang="plaintext"># baz</span> -<span id="LC3" class="line" lang="plaintext">Bar foo</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>Foo bar</p></span> -<span id="LC6" class="line" lang="plaintext"><h1>baz</h1></span> -<span id="LC7" class="line" lang="plaintext"><p>Bar foo</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">Bar foo</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="775:1-779:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo bar</p></span> +<span id="LC2" class="line" lang="plaintext"><h1>baz</h1></span> +<span id="LC3" class="line" lang="plaintext"><p>Bar foo</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="686:1-686:26" dir="auto">ATX headings can be empty:</p> +<p data-sourcepos="782:1-782:26" dir="auto">ATX headings can be empty:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="688:1-696:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">## </span> +<pre data-sourcepos="784:1-788:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">## </span> <span id="LC2" class="line" lang="plaintext">#</span> -<span id="LC3" class="line" lang="plaintext">### ###</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><h2></h2></span> -<span id="LC6" class="line" lang="plaintext"><h1></h1></span> -<span id="LC7" class="line" lang="plaintext"><h3></h3></span></code></pre> +<span id="LC3" class="line" lang="plaintext">### ###</span></code></pre> <copy-code></copy-code> </div> -<h2 data-sourcepos="699:1-699:18" dir="auto"> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="790:1-794:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2></h2></span> +<span id="LC2" class="line" lang="plaintext"><h1></h1></span> +<span id="LC3" class="line" lang="plaintext"><h3></h3></span></code></pre> +<copy-code></copy-code> +</div> +<h2 data-sourcepos="797:1-797:18" dir="auto"> <a id="user-content-setext-headings" class="anchor" href="#setext-headings" aria-hidden="true"></a>Setext headings</h2> -<p data-sourcepos="701:1-709:54" dir="auto">A <a href="@">setext heading</a> consists of one or more +<p data-sourcepos="799:1-807:54" dir="auto">A <a href="@">setext heading</a> consists of one or more lines of text, each containing at least one [non-whitespace character], with no more than 3 spaces indentation, followed by a [setext heading underline]. The lines of text must be such @@ -611,550 +709,628 @@ they would be interpreted as a paragraph: they cannot be interpretable as a [code fence], [ATX heading][ATX headings], [block quote][block quotes], [thematic break][thematic breaks], [list item][list items], or [HTML block][HTML blocks].</p> -<p data-sourcepos="711:1-716:40" dir="auto">A <a href="@">setext heading underline</a> is a sequence of +<p data-sourcepos="809:1-814:40" dir="auto">A <a href="@">setext heading underline</a> is a sequence of <code>=</code> characters or a sequence of <code>-</code> characters, with no more than 3 spaces indentation and any number of trailing spaces. If a line containing a single <code>-</code> can be interpreted as an empty [list items], it should be interpreted this way and not as a [setext heading underline].</p> -<p data-sourcepos="718:1-722:8" dir="auto">The heading is a level 1 heading if <code>=</code> characters are used in +<p data-sourcepos="816:1-820:8" dir="auto">The heading is a level 1 heading if <code>=</code> characters are used in the [setext heading underline], and a level 2 heading if <code>-</code> characters are used. The contents of the heading are the result of parsing the preceding lines of text as CommonMark inline content.</p> -<p data-sourcepos="724:1-727:5" dir="auto">In general, a setext heading need not be preceded or followed by a +<p data-sourcepos="822:1-825:5" dir="auto">In general, a setext heading need not be preceded or followed by a blank line. However, it cannot interrupt a paragraph, so when a setext heading comes after a paragraph, a blank line is needed between them.</p> -<p data-sourcepos="729:1-729:16" dir="auto">Simple examples:</p> +<p data-sourcepos="827:1-827:16" dir="auto">Simple examples:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="731:1-740:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo *bar*</span> +<pre data-sourcepos="829:1-835:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo *bar*</span> <span id="LC2" class="line" lang="plaintext">=========</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext">Foo *bar*</span> -<span id="LC5" class="line" lang="plaintext">---------</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><h1>Foo <em>bar</em></h1></span> -<span id="LC8" class="line" lang="plaintext"><h2>Foo <em>bar</em></h2></span></code></pre> +<span id="LC5" class="line" lang="plaintext">---------</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="837:1-840:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>Foo <em>bar</em></h1></span> +<span id="LC2" class="line" lang="plaintext"><h2>Foo <em>bar</em></h2></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="743:1-743:54" dir="auto">The content of the header may span more than one line:</p> +<p data-sourcepos="843:1-843:54" dir="auto">The content of the header may span more than one line:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="745:1-752:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo *bar</span> +<pre data-sourcepos="845:1-849:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo *bar</span> <span id="LC2" class="line" lang="plaintext">baz*</span> -<span id="LC3" class="line" lang="plaintext">====</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><h1>Foo <em>bar</span> -<span id="LC6" class="line" lang="plaintext">baz</em></h1></span></code></pre> +<span id="LC3" class="line" lang="plaintext">====</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="754:1-757:13" dir="auto">The contents are the result of parsing the headings's raw +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="851:1-854:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>Foo <em>bar</span> +<span id="LC2" class="line" lang="plaintext">baz</em></h1></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="856:1-859:13" dir="auto">The contents are the result of parsing the headings's raw content as inlines. The heading's raw content is formed by concatenating the lines and removing initial and final [whitespace].</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="759:1-766:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> Foo *bar</span> +<pre data-sourcepos="861:1-865:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> Foo *bar</span> <span id="LC2" class="line" lang="plaintext">baz*→</span> -<span id="LC3" class="line" lang="plaintext">====</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><h1>Foo <em>bar</span> -<span id="LC6" class="line" lang="plaintext">baz</em></h1></span></code></pre> +<span id="LC3" class="line" lang="plaintext">====</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="867:1-870:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>Foo <em>bar</span> +<span id="LC2" class="line" lang="plaintext">baz</em></h1></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="769:1-769:34" dir="auto">The underlining can be any length:</p> +<p data-sourcepos="873:1-873:34" dir="auto">The underlining can be any length:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="771:1-780:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> +<pre data-sourcepos="875:1-881:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> <span id="LC2" class="line" lang="plaintext">-------------------------</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext">Foo</span> -<span id="LC5" class="line" lang="plaintext">=</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><h2>Foo</h2></span> -<span id="LC8" class="line" lang="plaintext"><h1>Foo</h1></span></code></pre> +<span id="LC5" class="line" lang="plaintext">=</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="783:1-784:33" dir="auto">The heading content can be indented up to three spaces, and need +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="883:1-886:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>Foo</h2></span> +<span id="LC2" class="line" lang="plaintext"><h1>Foo</h1></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="889:1-890:33" dir="auto">The heading content can be indented up to three spaces, and need not line up with the underlining:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="786:1-799:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> Foo</span> +<pre data-sourcepos="892:1-901:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> Foo</span> <span id="LC2" class="line" lang="plaintext">---</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext"> Foo</span> <span id="LC5" class="line" lang="plaintext">-----</span> <span id="LC6" class="line" lang="plaintext"></span> <span id="LC7" class="line" lang="plaintext"> Foo</span> -<span id="LC8" class="line" lang="plaintext"> ===</span> -<span id="LC9" class="line" lang="plaintext">.</span> -<span id="LC10" class="line" lang="plaintext"><h2>Foo</h2></span> -<span id="LC11" class="line" lang="plaintext"><h2>Foo</h2></span> -<span id="LC12" class="line" lang="plaintext"><h1>Foo</h1></span></code></pre> +<span id="LC8" class="line" lang="plaintext"> ===</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="903:1-907:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>Foo</h2></span> +<span id="LC2" class="line" lang="plaintext"><h2>Foo</h2></span> +<span id="LC3" class="line" lang="plaintext"><h1>Foo</h1></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="802:1-802:31" dir="auto">Four spaces indent is too much:</p> +<p data-sourcepos="910:1-910:31" dir="auto">Four spaces indent is too much:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="804:1-817:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> Foo</span> +<pre data-sourcepos="912:1-918:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> Foo</span> <span id="LC2" class="line" lang="plaintext"> ---</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext"> Foo</span> -<span id="LC5" class="line" lang="plaintext">---</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><pre><code>Foo</span> -<span id="LC8" class="line" lang="plaintext">---</span> -<span id="LC9" class="line" lang="plaintext"></span> -<span id="LC10" class="line" lang="plaintext">Foo</span> -<span id="LC11" class="line" lang="plaintext"></code></pre></span> -<span id="LC12" class="line" lang="plaintext"><hr /></span></code></pre> +<span id="LC5" class="line" lang="plaintext">---</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="920:1-927:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>Foo</span> +<span id="LC2" class="line" lang="plaintext">---</span> +<span id="LC3" class="line" lang="plaintext"></span> +<span id="LC4" class="line" lang="plaintext">Foo</span> +<span id="LC5" class="line" lang="plaintext"></code></pre></span> +<span id="LC6" class="line" lang="plaintext"><hr /></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="820:1-821:25" dir="auto">The setext heading underline can be indented up to three spaces, and +<p data-sourcepos="930:1-931:25" dir="auto">The setext heading underline can be indented up to three spaces, and may have trailing spaces:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="823:1-828:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> -<span id="LC2" class="line" lang="plaintext"> ---- </span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><h2>Foo</h2></span></code></pre> +<pre data-sourcepos="933:1-936:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> +<span id="LC2" class="line" lang="plaintext"> ---- </span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="831:1-831:24" dir="auto">Four spaces is too much:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="833:1-839:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> -<span id="LC2" class="line" lang="plaintext"> ---</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>Foo</span> -<span id="LC5" class="line" lang="plaintext">---</p></span></code></pre> +<pre data-sourcepos="938:1-940:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>Foo</h2></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="943:1-943:24" dir="auto">Four spaces is too much:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="945:1-948:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> +<span id="LC2" class="line" lang="plaintext"> ---</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="950:1-953:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</span> +<span id="LC2" class="line" lang="plaintext">---</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="842:1-842:60" dir="auto">The setext heading underline cannot contain internal spaces:</p> +<p data-sourcepos="956:1-956:60" dir="auto">The setext heading underline cannot contain internal spaces:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="844:1-855:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> +<pre data-sourcepos="958:1-964:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> <span id="LC2" class="line" lang="plaintext">= =</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext">Foo</span> -<span id="LC5" class="line" lang="plaintext">--- -</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><p>Foo</span> -<span id="LC8" class="line" lang="plaintext">= =</p></span> -<span id="LC9" class="line" lang="plaintext"><p>Foo</p></span> -<span id="LC10" class="line" lang="plaintext"><hr /></span></code></pre> +<span id="LC5" class="line" lang="plaintext">--- -</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="858:1-858:62" dir="auto">Trailing spaces in the content line do not cause a line break:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="860:1-865:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo </span> -<span id="LC2" class="line" lang="plaintext">-----</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><h2>Foo</h2></span></code></pre> +<pre data-sourcepos="966:1-971:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</span> +<span id="LC2" class="line" lang="plaintext">= =</p></span> +<span id="LC3" class="line" lang="plaintext"><p>Foo</p></span> +<span id="LC4" class="line" lang="plaintext"><hr /></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="868:1-868:32" dir="auto">Nor does a backslash at the end:</p> +<p data-sourcepos="974:1-974:62" dir="auto">Trailing spaces in the content line do not cause a line break:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="870:1-875:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo\</span> -<span id="LC2" class="line" lang="plaintext">----</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><h2>Foo\</h2></span></code></pre> +<pre data-sourcepos="976:1-979:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo </span> +<span id="LC2" class="line" lang="plaintext">-----</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="878:1-879:66" dir="auto">Since indicators of block structure take precedence over +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="981:1-983:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>Foo</h2></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="986:1-986:32" dir="auto">Nor does a backslash at the end:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="988:1-991:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo\</span> +<span id="LC2" class="line" lang="plaintext">----</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="993:1-995:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>Foo\</h2></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="998:1-999:66" dir="auto">Since indicators of block structure take precedence over indicators of inline structure, the following are setext headings:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="881:1-894:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`Foo</span> +<pre data-sourcepos="1001:1-1009:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`Foo</span> <span id="LC2" class="line" lang="plaintext">----</span> <span id="LC3" class="line" lang="plaintext">`</span> <span id="LC4" class="line" lang="plaintext"></span> <span id="LC5" class="line" lang="plaintext"><a title="a lot</span> <span id="LC6" class="line" lang="plaintext">---</span> -<span id="LC7" class="line" lang="plaintext">of dashes"/></span> -<span id="LC8" class="line" lang="plaintext">.</span> -<span id="LC9" class="line" lang="plaintext"><h2>`Foo</h2></span> -<span id="LC10" class="line" lang="plaintext"><p>`</p></span> -<span id="LC11" class="line" lang="plaintext"><h2>&lt;a title=&quot;a lot</h2></span> -<span id="LC12" class="line" lang="plaintext"><p>of dashes&quot;/&gt;</p></span></code></pre> +<span id="LC7" class="line" lang="plaintext">of dashes"/></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1011:1-1016:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>`Foo</h2></span> +<span id="LC2" class="line" lang="plaintext"><p>`</p></span> +<span id="LC3" class="line" lang="plaintext"><h2>&lt;a title=&quot;a lot</h2></span> +<span id="LC4" class="line" lang="plaintext"><p>of dashes&quot;/&gt;</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="897:1-898:36" dir="auto">The setext heading underline cannot be a [lazy continuation +<p data-sourcepos="1019:1-1020:36" dir="auto">The setext heading underline cannot be a [lazy continuation line] in a list item or block quote:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="900:1-908:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> Foo</span> -<span id="LC2" class="line" lang="plaintext">---</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><blockquote></span> -<span id="LC5" class="line" lang="plaintext"><p>Foo</p></span> -<span id="LC6" class="line" lang="plaintext"></blockquote></span> -<span id="LC7" class="line" lang="plaintext"><hr /></span></code></pre> +<pre data-sourcepos="1022:1-1025:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> Foo</span> +<span id="LC2" class="line" lang="plaintext">---</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="911:1-921:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span> +<pre data-sourcepos="1027:1-1032:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><p>Foo</p></span> +<span id="LC3" class="line" lang="plaintext"></blockquote></span> +<span id="LC4" class="line" lang="plaintext"><hr /></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1035:1-1039:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span> <span id="LC2" class="line" lang="plaintext">bar</span> -<span id="LC3" class="line" lang="plaintext">===</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><blockquote></span> -<span id="LC6" class="line" lang="plaintext"><p>foo</span> -<span id="LC7" class="line" lang="plaintext">bar</span> -<span id="LC8" class="line" lang="plaintext">===</p></span> -<span id="LC9" class="line" lang="plaintext"></blockquote></span></code></pre> +<span id="LC3" class="line" lang="plaintext">===</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="924:1-932:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- Foo</span> -<span id="LC2" class="line" lang="plaintext">---</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><ul></span> -<span id="LC5" class="line" lang="plaintext"><li>Foo</li></span> -<span id="LC6" class="line" lang="plaintext"></ul></span> -<span id="LC7" class="line" lang="plaintext"><hr /></span></code></pre> +<pre data-sourcepos="1041:1-1047:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><p>foo</span> +<span id="LC3" class="line" lang="plaintext">bar</span> +<span id="LC4" class="line" lang="plaintext">===</p></span> +<span id="LC5" class="line" lang="plaintext"></blockquote></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1050:1-1053:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- Foo</span> +<span id="LC2" class="line" lang="plaintext">---</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1055:1-1060:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>Foo</li></span> +<span id="LC3" class="line" lang="plaintext"></ul></span> +<span id="LC4" class="line" lang="plaintext"><hr /></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="935:1-937:25" dir="auto">A blank line is needed between a paragraph and a following +<p data-sourcepos="1063:1-1065:25" dir="auto">A blank line is needed between a paragraph and a following setext heading, since otherwise the paragraph becomes part of the heading's content:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="939:1-946:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> +<pre data-sourcepos="1067:1-1071:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> <span id="LC2" class="line" lang="plaintext">Bar</span> -<span id="LC3" class="line" lang="plaintext">---</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><h2>Foo</span> -<span id="LC6" class="line" lang="plaintext">Bar</h2></span></code></pre> +<span id="LC3" class="line" lang="plaintext">---</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1073:1-1076:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>Foo</span> +<span id="LC2" class="line" lang="plaintext">Bar</h2></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="949:1-950:16" dir="auto">But in general a blank line is not required before or after +<p data-sourcepos="1079:1-1080:16" dir="auto">But in general a blank line is not required before or after setext headings:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="952:1-964:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">---</span> +<pre data-sourcepos="1082:1-1089:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">---</span> <span id="LC2" class="line" lang="plaintext">Foo</span> <span id="LC3" class="line" lang="plaintext">---</span> <span id="LC4" class="line" lang="plaintext">Bar</span> <span id="LC5" class="line" lang="plaintext">---</span> -<span id="LC6" class="line" lang="plaintext">Baz</span> -<span id="LC7" class="line" lang="plaintext">.</span> -<span id="LC8" class="line" lang="plaintext"><hr /></span> -<span id="LC9" class="line" lang="plaintext"><h2>Foo</h2></span> -<span id="LC10" class="line" lang="plaintext"><h2>Bar</h2></span> -<span id="LC11" class="line" lang="plaintext"><p>Baz</p></span></code></pre> +<span id="LC6" class="line" lang="plaintext">Baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1091:1-1096:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span> +<span id="LC2" class="line" lang="plaintext"><h2>Foo</h2></span> +<span id="LC3" class="line" lang="plaintext"><h2>Bar</h2></span> +<span id="LC4" class="line" lang="plaintext"><p>Baz</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="1099:1-1099:32" dir="auto">Setext headings cannot be empty:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1101:1-1104:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></span> +<span id="LC2" class="line" lang="plaintext">====</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="967:1-967:32" dir="auto">Setext headings cannot be empty:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="969:1-974:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></span> -<span id="LC2" class="line" lang="plaintext">====</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>====</p></span></code></pre> +<pre data-sourcepos="1106:1-1108:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>====</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="977:1-979:55" dir="auto">Setext heading text lines must not be interpretable as block +<p data-sourcepos="1111:1-1113:55" dir="auto">Setext heading text lines must not be interpretable as block constructs other than paragraphs. So, the line of dashes in these examples gets interpreted as a thematic break:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="981:1-987:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">---</span> -<span id="LC2" class="line" lang="plaintext">---</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><hr /></span> -<span id="LC5" class="line" lang="plaintext"><hr /></span></code></pre> +<pre data-sourcepos="1115:1-1118:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">---</span> +<span id="LC2" class="line" lang="plaintext">---</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="990:1-998:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> -<span id="LC2" class="line" lang="plaintext">-----</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><ul></span> -<span id="LC5" class="line" lang="plaintext"><li>foo</li></span> -<span id="LC6" class="line" lang="plaintext"></ul></span> -<span id="LC7" class="line" lang="plaintext"><hr /></span></code></pre> +<pre data-sourcepos="1120:1-1123:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span> +<span id="LC2" class="line" lang="plaintext"><hr /></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1001:1-1008:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> foo</span> -<span id="LC2" class="line" lang="plaintext">---</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><pre><code>foo</span> -<span id="LC5" class="line" lang="plaintext"></code></pre></span> -<span id="LC6" class="line" lang="plaintext"><hr /></span></code></pre> +<pre data-sourcepos="1126:1-1129:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> +<span id="LC2" class="line" lang="plaintext">-----</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1011:1-1019:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span> -<span id="LC2" class="line" lang="plaintext">-----</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><blockquote></span> -<span id="LC5" class="line" lang="plaintext"><p>foo</p></span> -<span id="LC6" class="line" lang="plaintext"></blockquote></span> -<span id="LC7" class="line" lang="plaintext"><hr /></span></code></pre> +<pre data-sourcepos="1131:1-1136:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>foo</li></span> +<span id="LC3" class="line" lang="plaintext"></ul></span> +<span id="LC4" class="line" lang="plaintext"><hr /></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1139:1-1142:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> foo</span> +<span id="LC2" class="line" lang="plaintext">---</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1022:1-1023:22" dir="auto">If you want a heading with <code>> foo</code> as its literal text, you can +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1144:1-1148:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>foo</span> +<span id="LC2" class="line" lang="plaintext"></code></pre></span> +<span id="LC3" class="line" lang="plaintext"><hr /></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1151:1-1154:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span> +<span id="LC2" class="line" lang="plaintext">-----</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1156:1-1161:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><p>foo</p></span> +<span id="LC3" class="line" lang="plaintext"></blockquote></span> +<span id="LC4" class="line" lang="plaintext"><hr /></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="1164:1-1165:22" dir="auto">If you want a heading with <code>> foo</code> as its literal text, you can use backslash escapes:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1025:1-1030:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\> foo</span> -<span id="LC2" class="line" lang="plaintext">------</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><h2>&gt; foo</h2></span></code></pre> +<pre data-sourcepos="1167:1-1170:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\> foo</span> +<span id="LC2" class="line" lang="plaintext">------</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1172:1-1174:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>&gt; foo</h2></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1033:1-1035:48" dir="auto"><strong>Compatibility note:</strong> Most existing Markdown implementations +<p data-sourcepos="1177:1-1179:48" dir="auto"><strong>Compatibility note:</strong> Most existing Markdown implementations do not allow the text of setext headings to span multiple lines. But there is no consensus about how to interpret</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1037:1-1042:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown">Foo</span> +<pre data-sourcepos="1181:1-1186:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown">Foo</span> <span id="LC2" class="line" lang="markdown"><span class="gh">bar</span></span> <span id="LC3" class="line" lang="markdown"><span class="gh">---</span></span> <span id="LC4" class="line" lang="markdown">baz</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1044:1-1044:44" dir="auto">One can find four different interpretations:</p> -<ol data-sourcepos="1046:1-1050:0" dir="auto"> -<li data-sourcepos="1046:1-1046:50">paragraph "Foo", heading "bar", paragraph "baz"</li> -<li data-sourcepos="1047:1-1047:55">paragraph "Foo bar", thematic break, paragraph "baz"</li> -<li data-sourcepos="1048:1-1048:30">paragraph "Foo bar --- baz"</li> -<li data-sourcepos="1049:1-1050:0">heading "Foo bar", paragraph "baz"</li> +<p data-sourcepos="1188:1-1188:44" dir="auto">One can find four different interpretations:</p> +<ol data-sourcepos="1190:1-1194:0" dir="auto"> +<li data-sourcepos="1190:1-1190:50">paragraph "Foo", heading "bar", paragraph "baz"</li> +<li data-sourcepos="1191:1-1191:55">paragraph "Foo bar", thematic break, paragraph "baz"</li> +<li data-sourcepos="1192:1-1192:30">paragraph "Foo bar --- baz"</li> +<li data-sourcepos="1193:1-1194:0">heading "Foo bar", paragraph "baz"</li> </ol> -<p data-sourcepos="1051:1-1054:43" dir="auto">We find interpretation 4 most natural, and interpretation 4 +<p data-sourcepos="1195:1-1198:43" dir="auto">We find interpretation 4 most natural, and interpretation 4 increases the expressive power of CommonMark, by allowing multiline headings. Authors who want interpretation 1 can put a blank line after the first paragraph:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1056:1-1066:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> +<pre data-sourcepos="1200:1-1206:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext">bar</span> <span id="LC4" class="line" lang="plaintext">---</span> -<span id="LC5" class="line" lang="plaintext">baz</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><p>Foo</p></span> -<span id="LC8" class="line" lang="plaintext"><h2>bar</h2></span> -<span id="LC9" class="line" lang="plaintext"><p>baz</p></span></code></pre> +<span id="LC5" class="line" lang="plaintext">baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1208:1-1212:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</p></span> +<span id="LC2" class="line" lang="plaintext"><h2>bar</h2></span> +<span id="LC3" class="line" lang="plaintext"><p>baz</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1069:1-1070:19" dir="auto">Authors who want interpretation 2 can put blank lines around +<p data-sourcepos="1215:1-1216:19" dir="auto">Authors who want interpretation 2 can put blank lines around the thematic break,</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1072:1-1084:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> +<pre data-sourcepos="1218:1-1225:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> <span id="LC2" class="line" lang="plaintext">bar</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext">---</span> <span id="LC5" class="line" lang="plaintext"></span> -<span id="LC6" class="line" lang="plaintext">baz</span> -<span id="LC7" class="line" lang="plaintext">.</span> -<span id="LC8" class="line" lang="plaintext"><p>Foo</span> -<span id="LC9" class="line" lang="plaintext">bar</p></span> -<span id="LC10" class="line" lang="plaintext"><hr /></span> -<span id="LC11" class="line" lang="plaintext"><p>baz</p></span></code></pre> +<span id="LC6" class="line" lang="plaintext">baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1227:1-1232:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</span> +<span id="LC2" class="line" lang="plaintext">bar</p></span> +<span id="LC3" class="line" lang="plaintext"><hr /></span> +<span id="LC4" class="line" lang="plaintext"><p>baz</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1087:1-1088:19" dir="auto">or use a thematic break that cannot count as a [setext heading +<p data-sourcepos="1235:1-1236:19" dir="auto">or use a thematic break that cannot count as a [setext heading underline], such as</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1090:1-1100:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> +<pre data-sourcepos="1238:1-1243:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> <span id="LC2" class="line" lang="plaintext">bar</span> <span id="LC3" class="line" lang="plaintext">* * *</span> -<span id="LC4" class="line" lang="plaintext">baz</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><p>Foo</span> -<span id="LC7" class="line" lang="plaintext">bar</p></span> -<span id="LC8" class="line" lang="plaintext"><hr /></span> -<span id="LC9" class="line" lang="plaintext"><p>baz</p></span></code></pre> +<span id="LC4" class="line" lang="plaintext">baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1245:1-1250:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</span> +<span id="LC2" class="line" lang="plaintext">bar</p></span> +<span id="LC3" class="line" lang="plaintext"><hr /></span> +<span id="LC4" class="line" lang="plaintext"><p>baz</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1103:1-1103:60" dir="auto">Authors who want interpretation 3 can use backslash escapes:</p> +<p data-sourcepos="1253:1-1253:60" dir="auto">Authors who want interpretation 3 can use backslash escapes:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1105:1-1115:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> +<pre data-sourcepos="1255:1-1260:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> <span id="LC2" class="line" lang="plaintext">bar</span> <span id="LC3" class="line" lang="plaintext">\---</span> -<span id="LC4" class="line" lang="plaintext">baz</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><p>Foo</span> -<span id="LC7" class="line" lang="plaintext">bar</span> -<span id="LC8" class="line" lang="plaintext">---</span> -<span id="LC9" class="line" lang="plaintext">baz</p></span></code></pre> +<span id="LC4" class="line" lang="plaintext">baz</span></code></pre> <copy-code></copy-code> </div> -<h2 data-sourcepos="1118:1-1118:23" dir="auto"> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1262:1-1267:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</span> +<span id="LC2" class="line" lang="plaintext">bar</span> +<span id="LC3" class="line" lang="plaintext">---</span> +<span id="LC4" class="line" lang="plaintext">baz</p></span></code></pre> +<copy-code></copy-code> +</div> +<h2 data-sourcepos="1270:1-1270:23" dir="auto"> <a id="user-content-indented-code-blocks" class="anchor" href="#indented-code-blocks" aria-hidden="true"></a>Indented code blocks</h2> -<p data-sourcepos="1120:1-1126:44" dir="auto">An <a href="@">indented code block</a> is composed of one or more +<p data-sourcepos="1272:1-1278:44" dir="auto">An <a href="@">indented code block</a> is composed of one or more [indented chunks] separated by blank lines. An <a href="@">indented chunk</a> is a sequence of non-blank lines, each indented four or more spaces. The contents of the code block are the literal contents of the lines, including trailing [line endings], minus four spaces of indentation. An indented code block has no [info string].</p> -<p data-sourcepos="1128:1-1131:11" dir="auto">An indented code block cannot interrupt a paragraph, so there must be +<p data-sourcepos="1280:1-1283:11" dir="auto">An indented code block cannot interrupt a paragraph, so there must be a blank line between a paragraph and a following indented code block. (A blank line is not needed, however, between a code block and a following paragraph.)</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1133:1-1140:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> a simple</span> -<span id="LC2" class="line" lang="plaintext"> indented code block</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><pre><code>a simple</span> -<span id="LC5" class="line" lang="plaintext"> indented code block</span> -<span id="LC6" class="line" lang="plaintext"></code></pre></span></code></pre> +<pre data-sourcepos="1285:1-1288:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> a simple</span> +<span id="LC2" class="line" lang="plaintext"> indented code block</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1143:1-1145:65" dir="auto">If there is any ambiguity between an interpretation of indentation +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1290:1-1294:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>a simple</span> +<span id="LC2" class="line" lang="plaintext"> indented code block</span> +<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="1297:1-1299:65" dir="auto">If there is any ambiguity between an interpretation of indentation as a code block and as indicating that material belongs to a [list item][list items], the list item interpretation takes precedence:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1147:1-1158:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> - foo</span> +<pre data-sourcepos="1301:1-1305:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> - foo</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext"> bar</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><ul></span> -<span id="LC6" class="line" lang="plaintext"><li></span> -<span id="LC7" class="line" lang="plaintext"><p>foo</p></span> -<span id="LC8" class="line" lang="plaintext"><p>bar</p></span> -<span id="LC9" class="line" lang="plaintext"></li></span> -<span id="LC10" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1307:1-1314:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>foo</p></span> +<span id="LC4" class="line" lang="plaintext"><p>bar</p></span> +<span id="LC5" class="line" lang="plaintext"></li></span> +<span id="LC6" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1161:1-1174:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. foo</span> +<pre data-sourcepos="1317:1-1321:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. foo</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext"> - bar</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><ol></span> -<span id="LC6" class="line" lang="plaintext"><li></span> -<span id="LC7" class="line" lang="plaintext"><p>foo</p></span> -<span id="LC8" class="line" lang="plaintext"><ul></span> -<span id="LC9" class="line" lang="plaintext"><li>bar</li></span> -<span id="LC10" class="line" lang="plaintext"></ul></span> -<span id="LC11" class="line" lang="plaintext"></li></span> -<span id="LC12" class="line" lang="plaintext"></ol></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> - bar</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1178:1-1179:12" dir="auto">The contents of a code block are literal text, and do not get parsed +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1323:1-1332:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>foo</p></span> +<span id="LC4" class="line" lang="plaintext"><ul></span> +<span id="LC5" class="line" lang="plaintext"><li>bar</li></span> +<span id="LC6" class="line" lang="plaintext"></ul></span> +<span id="LC7" class="line" lang="plaintext"></li></span> +<span id="LC8" class="line" lang="plaintext"></ol></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="1336:1-1337:12" dir="auto">The contents of a code block are literal text, and do not get parsed as Markdown:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1181:1-1192:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> <a/></span> +<pre data-sourcepos="1339:1-1344:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> <a/></span> <span id="LC2" class="line" lang="plaintext"> *hi*</span> <span id="LC3" class="line" lang="plaintext"></span> -<span id="LC4" class="line" lang="plaintext"> - one</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><pre><code>&lt;a/&gt;</span> -<span id="LC7" class="line" lang="plaintext">*hi*</span> -<span id="LC8" class="line" lang="plaintext"></span> -<span id="LC9" class="line" lang="plaintext">- one</span> -<span id="LC10" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC4" class="line" lang="plaintext"> - one</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1346:1-1352:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>&lt;a/&gt;</span> +<span id="LC2" class="line" lang="plaintext">*hi*</span> +<span id="LC3" class="line" lang="plaintext"></span> +<span id="LC4" class="line" lang="plaintext">- one</span> +<span id="LC5" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1195:1-1195:51" dir="auto">Here we have three chunks separated by blank lines:</p> +<p data-sourcepos="1355:1-1355:51" dir="auto">Here we have three chunks separated by blank lines:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1197:1-1214:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> chunk1</span> +<pre data-sourcepos="1357:1-1365:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> chunk1</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext"> chunk2</span> <span id="LC4" class="line" lang="plaintext"> </span> <span id="LC5" class="line" lang="plaintext"> </span> <span id="LC6" class="line" lang="plaintext"> </span> -<span id="LC7" class="line" lang="plaintext"> chunk3</span> -<span id="LC8" class="line" lang="plaintext">.</span> -<span id="LC9" class="line" lang="plaintext"><pre><code>chunk1</span> -<span id="LC10" class="line" lang="plaintext"></span> -<span id="LC11" class="line" lang="plaintext">chunk2</span> -<span id="LC12" class="line" lang="plaintext"></span> -<span id="LC13" class="line" lang="plaintext"></span> -<span id="LC14" class="line" lang="plaintext"></span> -<span id="LC15" class="line" lang="plaintext">chunk3</span> -<span id="LC16" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC7" class="line" lang="plaintext"> chunk3</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1367:1-1376:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>chunk1</span> +<span id="LC2" class="line" lang="plaintext"></span> +<span id="LC3" class="line" lang="plaintext">chunk2</span> +<span id="LC4" class="line" lang="plaintext"></span> +<span id="LC5" class="line" lang="plaintext"></span> +<span id="LC6" class="line" lang="plaintext"></span> +<span id="LC7" class="line" lang="plaintext">chunk3</span> +<span id="LC8" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1217:1-1218:24" dir="auto">Any initial spaces beyond four will be included in the content, even +<p data-sourcepos="1379:1-1380:24" dir="auto">Any initial spaces beyond four will be included in the content, even in interior blank lines:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1220:1-1229:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> chunk1</span> +<pre data-sourcepos="1382:1-1386:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> chunk1</span> <span id="LC2" class="line" lang="plaintext"> </span> -<span id="LC3" class="line" lang="plaintext"> chunk2</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><pre><code>chunk1</span> -<span id="LC6" class="line" lang="plaintext"> </span> -<span id="LC7" class="line" lang="plaintext"> chunk2</span> -<span id="LC8" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> chunk2</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1388:1-1393:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>chunk1</span> +<span id="LC2" class="line" lang="plaintext"> </span> +<span id="LC3" class="line" lang="plaintext"> chunk2</span> +<span id="LC4" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1232:1-1233:37" dir="auto">An indented code block cannot interrupt a paragraph. (This +<p data-sourcepos="1396:1-1397:37" dir="auto">An indented code block cannot interrupt a paragraph. (This allows hanging indents and the like.)</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1235:1-1242:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> +<pre data-sourcepos="1399:1-1403:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> <span id="LC2" class="line" lang="plaintext"> bar</span> -<span id="LC3" class="line" lang="plaintext"></span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>Foo</span> -<span id="LC6" class="line" lang="plaintext">bar</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext"></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1405:1-1408:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</span> +<span id="LC2" class="line" lang="plaintext">bar</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1245:1-1247:20" dir="auto">However, any non-blank line with fewer than four leading spaces ends +<p data-sourcepos="1411:1-1413:20" dir="auto">However, any non-blank line with fewer than four leading spaces ends the code block immediately. So a paragraph may occur immediately after indented code:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1249:1-1256:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> foo</span> -<span id="LC2" class="line" lang="plaintext">bar</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><pre><code>foo</span> -<span id="LC5" class="line" lang="plaintext"></code></pre></span> -<span id="LC6" class="line" lang="plaintext"><p>bar</p></span></code></pre> +<pre data-sourcepos="1415:1-1418:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> foo</span> +<span id="LC2" class="line" lang="plaintext">bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1420:1-1424:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>foo</span> +<span id="LC2" class="line" lang="plaintext"></code></pre></span> +<span id="LC3" class="line" lang="plaintext"><p>bar</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1259:1-1260:7" dir="auto">And indented code can occur immediately before and after other kinds of +<p data-sourcepos="1427:1-1428:7" dir="auto">And indented code can occur immediately before and after other kinds of blocks:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1262:1-1277:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"># Heading</span> +<pre data-sourcepos="1430:1-1437:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"># Heading</span> <span id="LC2" class="line" lang="plaintext"> foo</span> <span id="LC3" class="line" lang="plaintext">Heading</span> <span id="LC4" class="line" lang="plaintext">------</span> <span id="LC5" class="line" lang="plaintext"> foo</span> -<span id="LC6" class="line" lang="plaintext">----</span> -<span id="LC7" class="line" lang="plaintext">.</span> -<span id="LC8" class="line" lang="plaintext"><h1>Heading</h1></span> -<span id="LC9" class="line" lang="plaintext"><pre><code>foo</span> -<span id="LC10" class="line" lang="plaintext"></code></pre></span> -<span id="LC11" class="line" lang="plaintext"><h2>Heading</h2></span> -<span id="LC12" class="line" lang="plaintext"><pre><code>foo</span> -<span id="LC13" class="line" lang="plaintext"></code></pre></span> -<span id="LC14" class="line" lang="plaintext"><hr /></span></code></pre> +<span id="LC6" class="line" lang="plaintext">----</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1280:1-1280:53" dir="auto">The first line can be indented more than four spaces:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1282:1-1289:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> foo</span> -<span id="LC2" class="line" lang="plaintext"> bar</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><pre><code> foo</span> -<span id="LC5" class="line" lang="plaintext">bar</span> -<span id="LC6" class="line" lang="plaintext"></code></pre></span></code></pre> +<pre data-sourcepos="1439:1-1447:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>Heading</h1></span> +<span id="LC2" class="line" lang="plaintext"><pre><code>foo</span> +<span id="LC3" class="line" lang="plaintext"></code></pre></span> +<span id="LC4" class="line" lang="plaintext"><h2>Heading</h2></span> +<span id="LC5" class="line" lang="plaintext"><pre><code>foo</span> +<span id="LC6" class="line" lang="plaintext"></code></pre></span> +<span id="LC7" class="line" lang="plaintext"><hr /></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="1450:1-1450:53" dir="auto">The first line can be indented more than four spaces:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1452:1-1455:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> foo</span> +<span id="LC2" class="line" lang="plaintext"> bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1457:1-1461:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code> foo</span> +<span id="LC2" class="line" lang="plaintext">bar</span> +<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1292:1-1293:23" dir="auto">Blank lines preceding or following an indented code block +<p data-sourcepos="1464:1-1465:23" dir="auto">Blank lines preceding or following an indented code block are not included in it:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1295:1-1304:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></span> +<pre data-sourcepos="1467:1-1473:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></span> <span id="LC2" class="line" lang="plaintext"> </span> <span id="LC3" class="line" lang="plaintext"> foo</span> <span id="LC4" class="line" lang="plaintext"> </span> -<span id="LC5" class="line" lang="plaintext"></span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><pre><code>foo</span> -<span id="LC8" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC5" class="line" lang="plaintext"></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1307:1-1307:57" dir="auto">Trailing spaces are included in the code block's content:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1309:1-1314:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> foo </span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><pre><code>foo </span> -<span id="LC4" class="line" lang="plaintext"></code></pre></span></code></pre> +<pre data-sourcepos="1475:1-1478:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>foo</span> +<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="1481:1-1481:57" dir="auto">Trailing spaces are included in the code block's content:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1483:1-1485:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> foo </span></code></pre> <copy-code></copy-code> </div> -<h2 data-sourcepos="1318:1-1318:21" dir="auto"> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1487:1-1490:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>foo </span> +<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre> +<copy-code></copy-code> +</div> +<h2 data-sourcepos="1494:1-1494:21" dir="auto"> <a id="user-content-fenced-code-blocks" class="anchor" href="#fenced-code-blocks" aria-hidden="true"></a>Fenced code blocks</h2> -<p data-sourcepos="1320:1-1324:61" dir="auto">A <a href="@">code fence</a> is a sequence +<p data-sourcepos="1496:1-1500:61" dir="auto">A <a href="@">code fence</a> is a sequence of at least three consecutive backtick characters (<code>`</code>) or tildes (<code>~</code>). (Tildes and backticks cannot be mixed.) A <a href="@">fenced code block</a> begins with a code fence, indented no more than three spaces.</p> -<p data-sourcepos="1326:1-1332:34" dir="auto">The line with the opening code fence may optionally contain some text +<p data-sourcepos="1502:1-1508:34" dir="auto">The line with the opening code fence may optionally contain some text following the code fence; this is trimmed of leading and trailing whitespace and called the <a href="@">info string</a>. If the [info string] comes after a backtick fence, it may not contain any backtick characters. (The reason for this restriction is that otherwise some inline code would be incorrectly interpreted as the beginning of a fenced code block.)</p> -<p data-sourcepos="1334:1-1341:43" dir="auto">The content of the code block consists of all subsequent lines, until +<p data-sourcepos="1510:1-1517:43" dir="auto">The content of the code block consists of all subsequent lines, until a closing [code fence] of the same type as the code block began with (backticks or tildes), and with at least as many backticks or tildes as the opening code fence. If the leading code fence is @@ -1162,7 +1338,7 @@ indented N spaces, then up to N spaces of indentation are removed from each line of the content (if present). (If a content line is not indented, it is preserved unchanged. If it is indented less than N spaces, all of the indentation is removed.)</p> -<p data-sourcepos="1343:1-1351:25" dir="auto">The closing code fence may be indented up to three spaces, and may be +<p data-sourcepos="1519:1-1527:25" dir="auto">The closing code fence may be indented up to three spaces, and may be followed only by spaces, which are ignored. If the end of the containing block (or document) is reached and no closing code fence has been found, the code block contains all of the lines after the @@ -1171,352 +1347,410 @@ document). (An alternative spec would require backtracking in the event that a closing code fence is not found. But this makes parsing much less efficient, and there seems to be no real down side to the behavior described here.)</p> -<p data-sourcepos="1353:1-1354:36" dir="auto">A fenced code block may interrupt a paragraph, and does not require +<p data-sourcepos="1529:1-1530:36" dir="auto">A fenced code block may interrupt a paragraph, and does not require a blank line either before or after.</p> -<p data-sourcepos="1356:1-1360:42" dir="auto">The content of a code fence is treated as literal text, not parsed +<p data-sourcepos="1532:1-1536:42" dir="auto">The content of a code fence is treated as literal text, not parsed as inlines. The first word of the [info string] is typically used to specify the language of the code sample, and rendered in the <code>class</code> attribute of the <code>code</code> tag. However, this spec does not mandate any particular treatment of the [info string].</p> -<p data-sourcepos="1362:1-1362:40" dir="auto">Here is a simple example with backticks:</p> +<p data-sourcepos="1538:1-1538:40" dir="auto">Here is a simple example with backticks:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1364:1-1373:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span> +<pre data-sourcepos="1540:1-1545:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span> <span id="LC2" class="line" lang="plaintext"><</span> <span id="LC3" class="line" lang="plaintext"> ></span> -<span id="LC4" class="line" lang="plaintext">```</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><pre><code>&lt;</span> -<span id="LC7" class="line" lang="plaintext"> &gt;</span> -<span id="LC8" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC4" class="line" lang="plaintext">```</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1376:1-1376:12" dir="auto">With tildes:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1378:1-1387:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~~</span> +<pre data-sourcepos="1547:1-1551:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>&lt;</span> +<span id="LC2" class="line" lang="plaintext"> &gt;</span> +<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="1554:1-1554:12" dir="auto">With tildes:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1556:1-1561:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~~</span> <span id="LC2" class="line" lang="plaintext"><</span> <span id="LC3" class="line" lang="plaintext"> ></span> -<span id="LC4" class="line" lang="plaintext">~~~</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><pre><code>&lt;</span> -<span id="LC7" class="line" lang="plaintext"> &gt;</span> -<span id="LC8" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC4" class="line" lang="plaintext">~~~</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1563:1-1567:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>&lt;</span> +<span id="LC2" class="line" lang="plaintext"> &gt;</span> +<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1389:1-1389:41" dir="auto">Fewer than three backticks is not enough:</p> +<p data-sourcepos="1569:1-1569:41" dir="auto">Fewer than three backticks is not enough:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1391:1-1397:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``</span> +<pre data-sourcepos="1571:1-1575:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``</span> <span id="LC2" class="line" lang="plaintext">foo</span> -<span id="LC3" class="line" lang="plaintext">``</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><code>foo</code></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">``</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1399:1-1400:6" dir="auto">The closing code fence must use the same character as the opening +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1577:1-1579:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>foo</code></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="1581:1-1582:6" dir="auto">The closing code fence must use the same character as the opening fence:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1402:1-1411:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span> +<pre data-sourcepos="1584:1-1589:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span> <span id="LC2" class="line" lang="plaintext">aaa</span> <span id="LC3" class="line" lang="plaintext">~~~</span> -<span id="LC4" class="line" lang="plaintext">```</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><pre><code>aaa</span> -<span id="LC7" class="line" lang="plaintext">~~~</span> -<span id="LC8" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC4" class="line" lang="plaintext">```</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1591:1-1595:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span> +<span id="LC2" class="line" lang="plaintext">~~~</span> +<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1414:1-1423:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~~</span> +<pre data-sourcepos="1598:1-1603:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~~</span> <span id="LC2" class="line" lang="plaintext">aaa</span> <span id="LC3" class="line" lang="plaintext">```</span> -<span id="LC4" class="line" lang="plaintext">~~~</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><pre><code>aaa</span> -<span id="LC7" class="line" lang="plaintext">```</span> -<span id="LC8" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC4" class="line" lang="plaintext">~~~</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1605:1-1609:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span> +<span id="LC2" class="line" lang="plaintext">```</span> +<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1426:1-1426:69" dir="auto">The closing code fence must be at least as long as the opening fence:</p> +<p data-sourcepos="1612:1-1612:69" dir="auto">The closing code fence must be at least as long as the opening fence:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1428:1-1437:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">````</span> +<pre data-sourcepos="1614:1-1619:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">````</span> <span id="LC2" class="line" lang="plaintext">aaa</span> <span id="LC3" class="line" lang="plaintext">```</span> -<span id="LC4" class="line" lang="plaintext">``````</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><pre><code>aaa</span> -<span id="LC7" class="line" lang="plaintext">```</span> -<span id="LC8" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC4" class="line" lang="plaintext">``````</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1621:1-1625:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span> +<span id="LC2" class="line" lang="plaintext">```</span> +<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1440:1-1449:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~~~</span> +<pre data-sourcepos="1628:1-1633:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~~~</span> <span id="LC2" class="line" lang="plaintext">aaa</span> <span id="LC3" class="line" lang="plaintext">~~~</span> -<span id="LC4" class="line" lang="plaintext">~~~~</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><pre><code>aaa</span> -<span id="LC7" class="line" lang="plaintext">~~~</span> -<span id="LC8" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC4" class="line" lang="plaintext">~~~~</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1635:1-1639:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span> +<span id="LC2" class="line" lang="plaintext">~~~</span> +<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1452:1-1453:74" dir="auto">Unclosed code blocks are closed by the end of the document +<p data-sourcepos="1642:1-1643:74" dir="auto">Unclosed code blocks are closed by the end of the document (or the enclosing [block quote][block quotes] or [list item][list items]):</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1455:1-1459:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><pre><code></code></pre></span></code></pre> +<pre data-sourcepos="1645:1-1647:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1649:1-1651:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code></code></pre></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1462:1-1472:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`````</span> +<pre data-sourcepos="1654:1-1659:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`````</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext">```</span> -<span id="LC4" class="line" lang="plaintext">aaa</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><pre><code></span> -<span id="LC7" class="line" lang="plaintext">```</span> -<span id="LC8" class="line" lang="plaintext">aaa</span> -<span id="LC9" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC4" class="line" lang="plaintext">aaa</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1475:1-1486:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> ```</span> +<pre data-sourcepos="1661:1-1666:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code></span> +<span id="LC2" class="line" lang="plaintext">```</span> +<span id="LC3" class="line" lang="plaintext">aaa</span> +<span id="LC4" class="line" lang="plaintext"></code></pre></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1669:1-1674:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> ```</span> <span id="LC2" class="line" lang="plaintext">> aaa</span> <span id="LC3" class="line" lang="plaintext"></span> -<span id="LC4" class="line" lang="plaintext">bbb</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><blockquote></span> -<span id="LC7" class="line" lang="plaintext"><pre><code>aaa</span> -<span id="LC8" class="line" lang="plaintext"></code></pre></span> -<span id="LC9" class="line" lang="plaintext"></blockquote></span> -<span id="LC10" class="line" lang="plaintext"><p>bbb</p></span></code></pre> +<span id="LC4" class="line" lang="plaintext">bbb</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1489:1-1489:53" dir="auto">A code block can have all empty lines as its content:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1491:1-1500:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span> +<pre data-sourcepos="1676:1-1682:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><pre><code>aaa</span> +<span id="LC3" class="line" lang="plaintext"></code></pre></span> +<span id="LC4" class="line" lang="plaintext"></blockquote></span> +<span id="LC5" class="line" lang="plaintext"><p>bbb</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="1685:1-1685:53" dir="auto">A code block can have all empty lines as its content:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1687:1-1692:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext"> </span> -<span id="LC4" class="line" lang="plaintext">```</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><pre><code></span> -<span id="LC7" class="line" lang="plaintext"> </span> -<span id="LC8" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC4" class="line" lang="plaintext">```</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1503:1-1503:26" dir="auto">A code block can be empty:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1505:1-1510:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span> -<span id="LC2" class="line" lang="plaintext">```</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><pre><code></code></pre></span></code></pre> +<pre data-sourcepos="1694:1-1698:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code></span> +<span id="LC2" class="line" lang="plaintext"> </span> +<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1513:1-1515:11" dir="auto">Fences can be indented. If the opening fence is indented, +<p data-sourcepos="1701:1-1701:26" dir="auto">A code block can be empty:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1703:1-1706:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span> +<span id="LC2" class="line" lang="plaintext">```</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1708:1-1710:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code></code></pre></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="1713:1-1715:11" dir="auto">Fences can be indented. If the opening fence is indented, content lines will have equivalent opening indentation removed, if present:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1517:1-1526:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ```</span> +<pre data-sourcepos="1717:1-1722:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ```</span> <span id="LC2" class="line" lang="plaintext"> aaa</span> <span id="LC3" class="line" lang="plaintext">aaa</span> -<span id="LC4" class="line" lang="plaintext">```</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><pre><code>aaa</span> -<span id="LC7" class="line" lang="plaintext">aaa</span> -<span id="LC8" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC4" class="line" lang="plaintext">```</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1724:1-1728:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span> +<span id="LC2" class="line" lang="plaintext">aaa</span> +<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1529:1-1540:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ```</span> +<pre data-sourcepos="1731:1-1737:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ```</span> <span id="LC2" class="line" lang="plaintext">aaa</span> <span id="LC3" class="line" lang="plaintext"> aaa</span> <span id="LC4" class="line" lang="plaintext">aaa</span> -<span id="LC5" class="line" lang="plaintext"> ```</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><pre><code>aaa</span> -<span id="LC8" class="line" lang="plaintext">aaa</span> -<span id="LC9" class="line" lang="plaintext">aaa</span> -<span id="LC10" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC5" class="line" lang="plaintext"> ```</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1739:1-1744:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span> +<span id="LC2" class="line" lang="plaintext">aaa</span> +<span id="LC3" class="line" lang="plaintext">aaa</span> +<span id="LC4" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1543:1-1554:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ```</span> +<pre data-sourcepos="1747:1-1753:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ```</span> <span id="LC2" class="line" lang="plaintext"> aaa</span> <span id="LC3" class="line" lang="plaintext"> aaa</span> <span id="LC4" class="line" lang="plaintext"> aaa</span> -<span id="LC5" class="line" lang="plaintext"> ```</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><pre><code>aaa</span> -<span id="LC8" class="line" lang="plaintext"> aaa</span> -<span id="LC9" class="line" lang="plaintext">aaa</span> -<span id="LC10" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC5" class="line" lang="plaintext"> ```</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1557:1-1557:56" dir="auto">Four spaces indentation produces an indented code block:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1559:1-1568:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ```</span> +<pre data-sourcepos="1755:1-1760:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span> +<span id="LC2" class="line" lang="plaintext"> aaa</span> +<span id="LC3" class="line" lang="plaintext">aaa</span> +<span id="LC4" class="line" lang="plaintext"></code></pre></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="1763:1-1763:56" dir="auto">Four spaces indentation produces an indented code block:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1765:1-1769:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ```</span> <span id="LC2" class="line" lang="plaintext"> aaa</span> -<span id="LC3" class="line" lang="plaintext"> ```</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><pre><code>```</span> -<span id="LC6" class="line" lang="plaintext">aaa</span> -<span id="LC7" class="line" lang="plaintext">```</span> -<span id="LC8" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> ```</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1571:1-1572:41" dir="auto">Closing fences may be indented by 0-3 spaces, and their indentation -need not match that of the opening fence:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1574:1-1581:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span> +<pre data-sourcepos="1771:1-1776:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>```</span> <span id="LC2" class="line" lang="plaintext">aaa</span> -<span id="LC3" class="line" lang="plaintext"> ```</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><pre><code>aaa</span> -<span id="LC6" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC3" class="line" lang="plaintext">```</span> +<span id="LC4" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> +<p data-sourcepos="1779:1-1780:41" dir="auto">Closing fences may be indented by 0-3 spaces, and their indentation +need not match that of the opening fence:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1584:1-1591:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ```</span> +<pre data-sourcepos="1782:1-1786:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span> <span id="LC2" class="line" lang="plaintext">aaa</span> -<span id="LC3" class="line" lang="plaintext"> ```</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><pre><code>aaa</span> -<span id="LC6" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> ```</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1594:1-1594:61" dir="auto">This is not a closing fence, because it is indented 4 spaces:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1596:1-1604:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span> +<pre data-sourcepos="1788:1-1791:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span> +<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1794:1-1798:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ```</span> <span id="LC2" class="line" lang="plaintext">aaa</span> -<span id="LC3" class="line" lang="plaintext"> ```</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><pre><code>aaa</span> -<span id="LC6" class="line" lang="plaintext"> ```</span> -<span id="LC7" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> ```</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1608:1-1608:65" dir="auto">Code fences (opening and closing) cannot contain internal spaces:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1610:1-1616:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``` ```</span> +<pre data-sourcepos="1800:1-1803:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span> +<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="1806:1-1806:61" dir="auto">This is not a closing fence, because it is indented 4 spaces:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1808:1-1812:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span> <span id="LC2" class="line" lang="plaintext">aaa</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p><code> </code></span> -<span id="LC5" class="line" lang="plaintext">aaa</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> ```</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1814:1-1818:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span> +<span id="LC2" class="line" lang="plaintext"> ```</span> +<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> +<p data-sourcepos="1822:1-1822:65" dir="auto">Code fences (opening and closing) cannot contain internal spaces:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1619:1-1627:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~~~~~</span> +<pre data-sourcepos="1824:1-1827:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``` ```</span> +<span id="LC2" class="line" lang="plaintext">aaa</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1829:1-1832:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code> </code></span> +<span id="LC2" class="line" lang="plaintext">aaa</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1835:1-1839:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~~~~~</span> <span id="LC2" class="line" lang="plaintext">aaa</span> -<span id="LC3" class="line" lang="plaintext">~~~ ~~</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><pre><code>aaa</span> -<span id="LC6" class="line" lang="plaintext">~~~ ~~</span> -<span id="LC7" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC3" class="line" lang="plaintext">~~~ ~~</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1841:1-1845:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span> +<span id="LC2" class="line" lang="plaintext">~~~ ~~</span> +<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1630:1-1631:53" dir="auto">Fenced code blocks can interrupt paragraphs, and can be followed +<p data-sourcepos="1848:1-1849:53" dir="auto">Fenced code blocks can interrupt paragraphs, and can be followed directly by paragraphs, without a blank line between:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1633:1-1644:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span> +<pre data-sourcepos="1851:1-1857:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span> <span id="LC2" class="line" lang="plaintext">```</span> <span id="LC3" class="line" lang="plaintext">bar</span> <span id="LC4" class="line" lang="plaintext">```</span> -<span id="LC5" class="line" lang="plaintext">baz</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><p>foo</p></span> -<span id="LC8" class="line" lang="plaintext"><pre><code>bar</span> -<span id="LC9" class="line" lang="plaintext"></code></pre></span> -<span id="LC10" class="line" lang="plaintext"><p>baz</p></span></code></pre> +<span id="LC5" class="line" lang="plaintext">baz</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1647:1-1648:34" dir="auto">Other blocks can also occur before and after fenced code blocks +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1859:1-1864:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo</p></span> +<span id="LC2" class="line" lang="plaintext"><pre><code>bar</span> +<span id="LC3" class="line" lang="plaintext"></code></pre></span> +<span id="LC4" class="line" lang="plaintext"><p>baz</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="1867:1-1868:34" dir="auto">Other blocks can also occur before and after fenced code blocks without an intervening blank line:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1650:1-1662:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span> +<pre data-sourcepos="1870:1-1877:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span> <span id="LC2" class="line" lang="plaintext">---</span> <span id="LC3" class="line" lang="plaintext">~~~</span> <span id="LC4" class="line" lang="plaintext">bar</span> <span id="LC5" class="line" lang="plaintext">~~~</span> -<span id="LC6" class="line" lang="plaintext"># baz</span> -<span id="LC7" class="line" lang="plaintext">.</span> -<span id="LC8" class="line" lang="plaintext"><h2>foo</h2></span> -<span id="LC9" class="line" lang="plaintext"><pre><code>bar</span> -<span id="LC10" class="line" lang="plaintext"></code></pre></span> -<span id="LC11" class="line" lang="plaintext"><h1>baz</h1></span></code></pre> +<span id="LC6" class="line" lang="plaintext"># baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1879:1-1884:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>foo</h2></span> +<span id="LC2" class="line" lang="plaintext"><pre><code>bar</span> +<span id="LC3" class="line" lang="plaintext"></code></pre></span> +<span id="LC4" class="line" lang="plaintext"><h1>baz</h1></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1665:1-1670:45" dir="auto">An [info string] can be provided after the opening code fence. +<p data-sourcepos="1887:1-1892:45" dir="auto">An [info string] can be provided after the opening code fence. Although this spec doesn't mandate any particular treatment of the info string, the first word is typically used to specify the language of the code block. In HTML output, the language is normally indicated by adding a class to the <code>code</code> element consisting of <code>language-</code> followed by the language name.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1672:1-1683:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```ruby</span> +<pre data-sourcepos="1894:1-1900:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```ruby</span> <span id="LC2" class="line" lang="plaintext">def foo(x)</span> <span id="LC3" class="line" lang="plaintext"> return 3</span> <span id="LC4" class="line" lang="plaintext">end</span> -<span id="LC5" class="line" lang="plaintext">```</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><pre><code class="language-ruby">def foo(x)</span> -<span id="LC8" class="line" lang="plaintext"> return 3</span> -<span id="LC9" class="line" lang="plaintext">end</span> -<span id="LC10" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC5" class="line" lang="plaintext">```</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1902:1-1907:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code class="language-ruby">def foo(x)</span> +<span id="LC2" class="line" lang="plaintext"> return 3</span> +<span id="LC3" class="line" lang="plaintext">end</span> +<span id="LC4" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1686:1-1697:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~~~ ruby startline=3 $%@#$</span> +<pre data-sourcepos="1910:1-1916:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~~~ ruby startline=3 $%@#$</span> <span id="LC2" class="line" lang="plaintext">def foo(x)</span> <span id="LC3" class="line" lang="plaintext"> return 3</span> <span id="LC4" class="line" lang="plaintext">end</span> -<span id="LC5" class="line" lang="plaintext">~~~~~~~</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><pre><code class="language-ruby">def foo(x)</span> -<span id="LC8" class="line" lang="plaintext"> return 3</span> -<span id="LC9" class="line" lang="plaintext">end</span> -<span id="LC10" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC5" class="line" lang="plaintext">~~~~~~~</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1700:1-1705:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">````;</span> -<span id="LC2" class="line" lang="plaintext">````</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><pre><code class="language-;"></code></pre></span></code></pre> +<pre data-sourcepos="1918:1-1923:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code class="language-ruby">def foo(x)</span> +<span id="LC2" class="line" lang="plaintext"> return 3</span> +<span id="LC3" class="line" lang="plaintext">end</span> +<span id="LC4" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1708:1-1708:65" dir="auto">[Info strings] for backtick code blocks cannot contain backticks:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1710:1-1716:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``` aa ```</span> -<span id="LC2" class="line" lang="plaintext">foo</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p><code>aa</code></span> -<span id="LC5" class="line" lang="plaintext">foo</p></span></code></pre> +<pre data-sourcepos="1926:1-1929:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">````;</span> +<span id="LC2" class="line" lang="plaintext">````</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1931:1-1933:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code class="language-;"></code></pre></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="1936:1-1936:65" dir="auto">[Info strings] for backtick code blocks cannot contain backticks:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1938:1-1941:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``` aa ```</span> +<span id="LC2" class="line" lang="plaintext">foo</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1943:1-1946:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>aa</code></span> +<span id="LC2" class="line" lang="plaintext">foo</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1719:1-1719:70" dir="auto">[Info strings] for tilde code blocks can contain backticks and tildes:</p> +<p data-sourcepos="1949:1-1949:70" dir="auto">[Info strings] for tilde code blocks can contain backticks and tildes:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1721:1-1728:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~~ aa ``` ~~~</span> +<pre data-sourcepos="1951:1-1955:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~~ aa ``` ~~~</span> <span id="LC2" class="line" lang="plaintext">foo</span> -<span id="LC3" class="line" lang="plaintext">~~~</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><pre><code class="language-aa">foo</span> -<span id="LC6" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC3" class="line" lang="plaintext">~~~</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1957:1-1960:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code class="language-aa">foo</span> +<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1731:1-1731:47" dir="auto">Closing code fences cannot have [info strings]:</p> +<p data-sourcepos="1963:1-1963:47" dir="auto">Closing code fences cannot have [info strings]:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1733:1-1740:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span> +<pre data-sourcepos="1965:1-1969:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span> <span id="LC2" class="line" lang="plaintext">``` aaa</span> -<span id="LC3" class="line" lang="plaintext">```</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><pre><code>``` aaa</span> -<span id="LC6" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC3" class="line" lang="plaintext">```</span></code></pre> <copy-code></copy-code> </div> -<h2 data-sourcepos="1744:1-1744:14" dir="auto"> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="1971:1-1974:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>``` aaa</span> +<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre> +<copy-code></copy-code> +</div> +<h2 data-sourcepos="1978:1-1978:14" dir="auto"> <a id="user-content-html-blocks" class="anchor" href="#html-blocks" aria-hidden="true"></a>HTML blocks</h2> -<p data-sourcepos="1746:1-1747:53" dir="auto">An <a href="@">HTML block</a> is a group of lines that is treated +<p data-sourcepos="1980:1-1981:53" dir="auto">An <a href="@">HTML block</a> is a group of lines that is treated as raw HTML (and will not be escaped in HTML output).</p> -<p data-sourcepos="1749:1-1757:50" dir="auto">There are seven kinds of [HTML block], which can be defined by their +<p data-sourcepos="1983:1-1991:50" dir="auto">There are seven kinds of [HTML block], which can be defined by their start and end conditions. The block begins with a line that meets a <a href="@">start condition</a> (after up to three spaces optional indentation). It ends with the first subsequent line that meets a matching <a href="@">end @@ -1525,35 +1759,35 @@ the <a href="#container-blocks">container block</a> containing the current HTML block, if no line is encountered that meets the [end condition]. If the first line meets both the [start condition] and the [end condition], the block will contain just that line.</p> -<ol data-sourcepos="1759:1-1800:0" dir="auto"> -<li data-sourcepos="1759:1-1765:0"> -<p data-sourcepos="1759:5-1764:30"><strong>Start condition:</strong> line begins with the string <code><script</code>, +<ol data-sourcepos="1993:1-2034:0" dir="auto"> +<li data-sourcepos="1993:1-1999:0"> +<p data-sourcepos="1993:5-1998:30"><strong>Start condition:</strong> line begins with the string <code><script</code>, <code><pre</code>, or <code><style</code> (case-insensitive), followed by whitespace, the string <code>></code>, or the end of the line.<br> <strong>End condition:</strong> line contains an end tag <code></script></code>, <code></pre></code>, or <code></style></code> (case-insensitive; it need not match the start tag).</p> </li> -<li data-sourcepos="1766:1-1768:0"> -<p data-sourcepos="1766:5-1767:51"><strong>Start condition:</strong> line begins with the string <code><!--</code>.<br> +<li data-sourcepos="2000:1-2002:0"> +<p data-sourcepos="2000:5-2001:51"><strong>Start condition:</strong> line begins with the string <code><!--</code>.<br> <strong>End condition:</strong> line contains the string <code>--></code>.</p> </li> -<li data-sourcepos="1769:1-1771:0"> -<p data-sourcepos="1769:5-1770:49"><strong>Start condition:</strong> line begins with the string <code><?</code>.<br> +<li data-sourcepos="2003:1-2005:0"> +<p data-sourcepos="2003:5-2004:49"><strong>Start condition:</strong> line begins with the string <code><?</code>.<br> <strong>End condition:</strong> line contains the string <code>?></code>.</p> </li> -<li data-sourcepos="1772:1-1775:0"> -<p data-sourcepos="1772:5-1774:51"><strong>Start condition:</strong> line begins with the string <code><!</code> +<li data-sourcepos="2006:1-2009:0"> +<p data-sourcepos="2006:5-2008:51"><strong>Start condition:</strong> line begins with the string <code><!</code> followed by an uppercase ASCII letter.<br> <strong>End condition:</strong> line contains the character <code>></code>.</p> </li> -<li data-sourcepos="1776:1-1779:0"> -<p data-sourcepos="1776:5-1778:50"><strong>Start condition:</strong> line begins with the string +<li data-sourcepos="2010:1-2013:0"> +<p data-sourcepos="2010:5-2012:50"><strong>Start condition:</strong> line begins with the string <code><![CDATA[</code>.<br> <strong>End condition:</strong> line contains the string <code>]]></code>.</p> </li> -<li data-sourcepos="1780:1-1794:0"> -<p data-sourcepos="1780:5-1793:54"><strong>Start condition:</strong> line begins the string <code><</code> or <code></</code> +<li data-sourcepos="2014:1-2028:0"> +<p data-sourcepos="2014:5-2027:54"><strong>Start condition:</strong> line begins the string <code><</code> or <code></</code> followed by one of the strings (case-insensitive) <code>address</code>, <code>article</code>, <code>aside</code>, <code>base</code>, <code>basefont</code>, <code>blockquote</code>, <code>body</code>, <code>caption</code>, <code>center</code>, <code>col</code>, <code>colgroup</code>, <code>dd</code>, <code>details</code>, <code>dialog</code>, @@ -1568,51 +1802,53 @@ by [whitespace], the end of the line, the string <code>></code>, or the string <code>/></code>.<br> <strong>End condition:</strong> line is followed by a [blank line].</p> </li> -<li data-sourcepos="1795:1-1800:0"> -<p data-sourcepos="1795:5-1799:54"><strong>Start condition:</strong> line begins with a complete [open tag] +<li data-sourcepos="2029:1-2034:0"> +<p data-sourcepos="2029:5-2033:54"><strong>Start condition:</strong> line begins with a complete [open tag] (with any [tag name] other than <code>script</code>, <code>style</code>, or <code>pre</code>) or a complete [closing tag], followed only by [whitespace] or the end of the line.<br> <strong>End condition:</strong> line is followed by a [blank line].</p> </li> </ol> -<p data-sourcepos="1801:1-1806:19" dir="auto">HTML blocks continue until they are closed by their appropriate +<p data-sourcepos="2035:1-2040:19" dir="auto">HTML blocks continue until they are closed by their appropriate [end condition], or the last line of the document or other <a href="#container-blocks">container block</a>. This means any HTML <strong>within an HTML block</strong> that might otherwise be recognised as a start condition will be ignored by the parser and passed through as-is, without changing the parser's state.</p> -<p data-sourcepos="1808:1-1810:51" dir="auto">For instance, <code><pre></code> within a HTML block started by <code><table></code> will not affect +<p data-sourcepos="2042:1-2044:51" dir="auto">For instance, <code><pre></code> within a HTML block started by <code><table></code> will not affect the parser state; as the HTML block was started in by start condition 6, it will end at any blank line. This can be surprising:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1812:1-1827:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table><tr><td></span> +<pre data-sourcepos="2046:1-2054:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table><tr><td></span> <span id="LC2" class="line" lang="plaintext"><pre></span> <span id="LC3" class="line" lang="plaintext">**Hello**,</span> <span id="LC4" class="line" lang="plaintext"></span> <span id="LC5" class="line" lang="plaintext">_world_.</span> <span id="LC6" class="line" lang="plaintext"></pre></span> -<span id="LC7" class="line" lang="plaintext"></td></tr></table></span> -<span id="LC8" class="line" lang="plaintext">.</span> -<span id="LC9" class="line" lang="plaintext"><table><tr><td></span> -<span id="LC10" class="line" lang="plaintext"><pre></span> -<span id="LC11" class="line" lang="plaintext">**Hello**,</span> -<span id="LC12" class="line" lang="plaintext"><p><em>world</em>.</span> -<span id="LC13" class="line" lang="plaintext"></pre></p></span> -<span id="LC14" class="line" lang="plaintext"></td></tr></table></span></code></pre> +<span id="LC7" class="line" lang="plaintext"></td></tr></table></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2056:1-2063:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table><tr><td></span> +<span id="LC2" class="line" lang="plaintext"><pre></span> +<span id="LC3" class="line" lang="plaintext">**Hello**,</span> +<span id="LC4" class="line" lang="plaintext"><p><em>world</em>.</span> +<span id="LC5" class="line" lang="plaintext"></pre></p></span> +<span id="LC6" class="line" lang="plaintext"></td></tr></table></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1829:1-1831:55" dir="auto">In this case, the HTML block is terminated by the newline — the <code>**Hello**</code> +<p data-sourcepos="2065:1-2067:55" dir="auto">In this case, the HTML block is terminated by the newline — the <code>**Hello**</code> text remains verbatim — and regular parsing resumes, with a paragraph, emphasised <code>world</code> and inline and block HTML following.</p> -<p data-sourcepos="1833:1-1836:65" dir="auto">All types of [HTML blocks] except type 7 may interrupt +<p data-sourcepos="2069:1-2072:65" dir="auto">All types of [HTML blocks] except type 7 may interrupt a paragraph. Blocks of type 7 may not interrupt a paragraph. (This restriction is intended to prevent unwanted interpretation of long tags inside a wrapped paragraph as starting HTML blocks.)</p> -<p data-sourcepos="1838:1-1839:10" dir="auto">Some simple examples follow. Here are some basic HTML blocks +<p data-sourcepos="2074:1-2075:10" dir="auto">Some simple examples follow. Here are some basic HTML blocks of type 6:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1841:1-1860:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span> +<pre data-sourcepos="2077:1-2087:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span> <span id="LC2" class="line" lang="plaintext"> <tr></span> <span id="LC3" class="line" lang="plaintext"> <td></span> <span id="LC4" class="line" lang="plaintext"> hi</span> @@ -1620,401 +1856,465 @@ of type 6:</p> <span id="LC6" class="line" lang="plaintext"> </tr></span> <span id="LC7" class="line" lang="plaintext"></table></span> <span id="LC8" class="line" lang="plaintext"></span> -<span id="LC9" class="line" lang="plaintext">okay.</span> -<span id="LC10" class="line" lang="plaintext">.</span> -<span id="LC11" class="line" lang="plaintext"><table></span> -<span id="LC12" class="line" lang="plaintext"> <tr></span> -<span id="LC13" class="line" lang="plaintext"> <td></span> -<span id="LC14" class="line" lang="plaintext"> hi</span> -<span id="LC15" class="line" lang="plaintext"> </td></span> -<span id="LC16" class="line" lang="plaintext"> </tr></span> -<span id="LC17" class="line" lang="plaintext"></table></span> -<span id="LC18" class="line" lang="plaintext"><p>okay.</p></span></code></pre> +<span id="LC9" class="line" lang="plaintext">okay.</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2089:1-2098:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span> +<span id="LC2" class="line" lang="plaintext"> <tr></span> +<span id="LC3" class="line" lang="plaintext"> <td></span> +<span id="LC4" class="line" lang="plaintext"> hi</span> +<span id="LC5" class="line" lang="plaintext"> </td></span> +<span id="LC6" class="line" lang="plaintext"> </tr></span> +<span id="LC7" class="line" lang="plaintext"></table></span> +<span id="LC8" class="line" lang="plaintext"><p>okay.</p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1863:1-1871:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> <div></span> +<pre data-sourcepos="2101:1-2105:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> <div></span> <span id="LC2" class="line" lang="plaintext"> *hello*</span> -<span id="LC3" class="line" lang="plaintext"> <foo><a></span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"> <div></span> -<span id="LC6" class="line" lang="plaintext"> *hello*</span> -<span id="LC7" class="line" lang="plaintext"> <foo><a></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> <foo><a></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1874:1-1874:42" dir="auto">A block can also start with a closing tag:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1876:1-1882:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></div></span> -<span id="LC2" class="line" lang="plaintext">*foo*</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"></div></span> -<span id="LC5" class="line" lang="plaintext">*foo*</span></code></pre> +<pre data-sourcepos="2107:1-2111:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> <div></span> +<span id="LC2" class="line" lang="plaintext"> *hello*</span> +<span id="LC3" class="line" lang="plaintext"> <foo><a></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="2114:1-2114:42" dir="auto">A block can also start with a closing tag:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2116:1-2119:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></div></span> +<span id="LC2" class="line" lang="plaintext">*foo*</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1885:1-1885:68" dir="auto">Here we have two HTML blocks with a Markdown paragraph between them:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1887:1-1897:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><DIV CLASS="foo"></span> +<pre data-sourcepos="2121:1-2124:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></div></span> +<span id="LC2" class="line" lang="plaintext">*foo*</span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="2127:1-2127:68" dir="auto">Here we have two HTML blocks with a Markdown paragraph between them:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2129:1-2135:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><DIV CLASS="foo"></span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext">*Markdown*</span> <span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext"></DIV></span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><DIV CLASS="foo"></span> -<span id="LC8" class="line" lang="plaintext"><p><em>Markdown</em></p></span> -<span id="LC9" class="line" lang="plaintext"></DIV></span></code></pre> +<span id="LC5" class="line" lang="plaintext"></DIV></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2137:1-2141:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><DIV CLASS="foo"></span> +<span id="LC2" class="line" lang="plaintext"><p><em>Markdown</em></p></span> +<span id="LC3" class="line" lang="plaintext"></DIV></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1900:1-1901:47" dir="auto">The tag on the first line can be partial, as long +<p data-sourcepos="2144:1-2145:47" dir="auto">The tag on the first line can be partial, as long as it is split where there would be whitespace:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1903:1-1911:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div id="foo"</span> +<pre data-sourcepos="2147:1-2151:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div id="foo"</span> <span id="LC2" class="line" lang="plaintext"> class="bar"></span> -<span id="LC3" class="line" lang="plaintext"></div></span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><div id="foo"</span> -<span id="LC6" class="line" lang="plaintext"> class="bar"></span> -<span id="LC7" class="line" lang="plaintext"></div></span></code></pre> +<span id="LC3" class="line" lang="plaintext"></div></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2153:1-2157:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div id="foo"</span> +<span id="LC2" class="line" lang="plaintext"> class="bar"></span> +<span id="LC3" class="line" lang="plaintext"></div></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1914:1-1922:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div id="foo" class="bar</span> +<pre data-sourcepos="2160:1-2164:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div id="foo" class="bar</span> <span id="LC2" class="line" lang="plaintext"> baz"></span> -<span id="LC3" class="line" lang="plaintext"></div></span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><div id="foo" class="bar</span> -<span id="LC6" class="line" lang="plaintext"> baz"></span> -<span id="LC7" class="line" lang="plaintext"></div></span></code></pre> +<span id="LC3" class="line" lang="plaintext"></div></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1925:1-1925:31" dir="auto">An open tag need not be closed:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1926:1-1935:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></span> +<pre data-sourcepos="2166:1-2170:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div id="foo" class="bar</span> +<span id="LC2" class="line" lang="plaintext"> baz"></span> +<span id="LC3" class="line" lang="plaintext"></div></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="2173:1-2173:31" dir="auto">An open tag need not be closed:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2174:1-2179:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></span> <span id="LC2" class="line" lang="plaintext">*foo*</span> <span id="LC3" class="line" lang="plaintext"></span> -<span id="LC4" class="line" lang="plaintext">*bar*</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><div></span> -<span id="LC7" class="line" lang="plaintext">*foo*</span> -<span id="LC8" class="line" lang="plaintext"><p><em>bar</em></p></span></code></pre> +<span id="LC4" class="line" lang="plaintext">*bar*</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2181:1-2185:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></span> +<span id="LC2" class="line" lang="plaintext">*foo*</span> +<span id="LC3" class="line" lang="plaintext"><p><em>bar</em></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1939:1-1940:17" dir="auto">A partial tag need not even be completed (garbage +<p data-sourcepos="2189:1-2190:17" dir="auto">A partial tag need not even be completed (garbage in, garbage out):</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1942:1-1948:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div id="foo"</span> -<span id="LC2" class="line" lang="plaintext">*hi*</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><div id="foo"</span> -<span id="LC5" class="line" lang="plaintext">*hi*</span></code></pre> +<pre data-sourcepos="2192:1-2195:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div id="foo"</span> +<span id="LC2" class="line" lang="plaintext">*hi*</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1951:1-1957:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div class</span> -<span id="LC2" class="line" lang="plaintext">foo</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><div class</span> -<span id="LC5" class="line" lang="plaintext">foo</span></code></pre> +<pre data-sourcepos="2197:1-2200:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div id="foo"</span> +<span id="LC2" class="line" lang="plaintext">*hi*</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2203:1-2206:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div class</span> +<span id="LC2" class="line" lang="plaintext">foo</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2208:1-2211:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div class</span> +<span id="LC2" class="line" lang="plaintext">foo</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1960:1-1961:35" dir="auto">The initial tag doesn't even need to be a valid +<p data-sourcepos="2214:1-2215:35" dir="auto">The initial tag doesn't even need to be a valid tag, as long as it starts like one:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1963:1-1969:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div *???-&&&-<---</span> -<span id="LC2" class="line" lang="plaintext">*foo*</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><div *???-&&&-<---</span> -<span id="LC5" class="line" lang="plaintext">*foo*</span></code></pre> +<pre data-sourcepos="2217:1-2220:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div *???-&&&-<---</span> +<span id="LC2" class="line" lang="plaintext">*foo*</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1972:1-1973:7" dir="auto">In type 6 blocks, the initial tag need not be on a line by +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2222:1-2225:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div *???-&&&-<---</span> +<span id="LC2" class="line" lang="plaintext">*foo*</span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="2228:1-2229:7" dir="auto">In type 6 blocks, the initial tag need not be on a line by itself:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1975:1-1979:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div><a href="bar">*foo*</a></div></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><div><a href="bar">*foo*</a></div></span></code></pre> +<pre data-sourcepos="2231:1-2233:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div><a href="bar">*foo*</a></div></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2235:1-2237:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div><a href="bar">*foo*</a></div></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1982:1-1990:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table><tr><td></span> +<pre data-sourcepos="2240:1-2244:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table><tr><td></span> <span id="LC2" class="line" lang="plaintext">foo</span> -<span id="LC3" class="line" lang="plaintext"></td></tr></table></span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><table><tr><td></span> -<span id="LC6" class="line" lang="plaintext">foo</span> -<span id="LC7" class="line" lang="plaintext"></td></tr></table></span></code></pre> +<span id="LC3" class="line" lang="plaintext"></td></tr></table></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="1993:1-1997:43" dir="auto">Everything until the next blank line or end of document +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2246:1-2250:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table><tr><td></span> +<span id="LC2" class="line" lang="plaintext">foo</span> +<span id="LC3" class="line" lang="plaintext"></td></tr></table></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="2253:1-2257:43" dir="auto">Everything until the next blank line or end of document gets included in the HTML block. So, in the following example, what looks like a Markdown code block is actually part of the HTML block, which continues until a blank line or the end of the document is reached:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1999:1-2009:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></div></span> +<pre data-sourcepos="2259:1-2264:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></div></span> <span id="LC2" class="line" lang="plaintext">``` c</span> <span id="LC3" class="line" lang="plaintext">int x = 33;</span> -<span id="LC4" class="line" lang="plaintext">```</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><div></div></span> -<span id="LC7" class="line" lang="plaintext">``` c</span> -<span id="LC8" class="line" lang="plaintext">int x = 33;</span> -<span id="LC9" class="line" lang="plaintext">```</span></code></pre> +<span id="LC4" class="line" lang="plaintext">```</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2266:1-2271:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></div></span> +<span id="LC2" class="line" lang="plaintext">``` c</span> +<span id="LC3" class="line" lang="plaintext">int x = 33;</span> +<span id="LC4" class="line" lang="plaintext">```</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2012:1-2014:51" dir="auto">To start an [HTML block] with a tag that is <em>not</em> in the +<p data-sourcepos="2274:1-2276:51" dir="auto">To start an [HTML block] with a tag that is <em>not</em> in the list of block-level tags in (6), you must put the tag by itself on the first line (and it must be complete):</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2016:1-2024:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="foo"></span> +<pre data-sourcepos="2278:1-2282:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="foo"></span> +<span id="LC2" class="line" lang="plaintext">*bar*</span> +<span id="LC3" class="line" lang="plaintext"></a></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2284:1-2288:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="foo"></span> +<span id="LC2" class="line" lang="plaintext">*bar*</span> +<span id="LC3" class="line" lang="plaintext"></a></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="2291:1-2291:49" dir="auto">In type 7 blocks, the [tag name] can be anything:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2293:1-2297:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><Warning></span> <span id="LC2" class="line" lang="plaintext">*bar*</span> -<span id="LC3" class="line" lang="plaintext"></a></span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><a href="foo"></span> -<span id="LC6" class="line" lang="plaintext">*bar*</span> -<span id="LC7" class="line" lang="plaintext"></a></span></code></pre> +<span id="LC3" class="line" lang="plaintext"></Warning></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2027:1-2027:49" dir="auto">In type 7 blocks, the [tag name] can be anything:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2029:1-2037:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><Warning></span> +<pre data-sourcepos="2299:1-2303:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><Warning></span> <span id="LC2" class="line" lang="plaintext">*bar*</span> -<span id="LC3" class="line" lang="plaintext"></Warning></span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><Warning></span> -<span id="LC6" class="line" lang="plaintext">*bar*</span> -<span id="LC7" class="line" lang="plaintext"></Warning></span></code></pre> +<span id="LC3" class="line" lang="plaintext"></Warning></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2040:1-2048:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><i class="foo"></span> +<pre data-sourcepos="2306:1-2310:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><i class="foo"></span> <span id="LC2" class="line" lang="plaintext">*bar*</span> -<span id="LC3" class="line" lang="plaintext"></i></span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><i class="foo"></span> -<span id="LC6" class="line" lang="plaintext">*bar*</span> -<span id="LC7" class="line" lang="plaintext"></i></span></code></pre> +<span id="LC3" class="line" lang="plaintext"></i></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2051:1-2057:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></ins></span> +<pre data-sourcepos="2312:1-2316:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><i class="foo"></span> <span id="LC2" class="line" lang="plaintext">*bar*</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"></ins></span> -<span id="LC5" class="line" lang="plaintext">*bar*</span></code></pre> +<span id="LC3" class="line" lang="plaintext"></i></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2060:1-2064:59" dir="auto">These rules are designed to allow us to work with tags that +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2319:1-2322:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></ins></span> +<span id="LC2" class="line" lang="plaintext">*bar*</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2324:1-2327:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></ins></span> +<span id="LC2" class="line" lang="plaintext">*bar*</span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="2330:1-2334:59" dir="auto">These rules are designed to allow us to work with tags that can function as either block-level or inline-level tags. The <code><del></code> tag is a nice example. We can surround content with <code><del></code> tags in three different ways. In this case, we get a raw HTML block, because the <code><del></code> tag is on a line by itself:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2066:1-2074:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><del></span> +<pre data-sourcepos="2336:1-2340:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><del></span> <span id="LC2" class="line" lang="plaintext">*foo*</span> -<span id="LC3" class="line" lang="plaintext"></del></span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><del></span> -<span id="LC6" class="line" lang="plaintext">*foo*</span> -<span id="LC7" class="line" lang="plaintext"></del></span></code></pre> +<span id="LC3" class="line" lang="plaintext"></del></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2077:1-2079:54" dir="auto">In this case, we get a raw HTML block that just includes +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2342:1-2346:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><del></span> +<span id="LC2" class="line" lang="plaintext">*foo*</span> +<span id="LC3" class="line" lang="plaintext"></del></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="2349:1-2351:54" dir="auto">In this case, we get a raw HTML block that just includes the <code><del></code> tag (because it ends with the following blank line). So the contents get interpreted as CommonMark:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2081:1-2091:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><del></span> +<pre data-sourcepos="2353:1-2359:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><del></span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext">*foo*</span> <span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext"></del></span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><del></span> -<span id="LC8" class="line" lang="plaintext"><p><em>foo</em></p></span> -<span id="LC9" class="line" lang="plaintext"></del></span></code></pre> +<span id="LC5" class="line" lang="plaintext"></del></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2094:1-2097:29" dir="auto">Finally, in this case, the <code><del></code> tags are interpreted +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2361:1-2365:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><del></span> +<span id="LC2" class="line" lang="plaintext"><p><em>foo</em></p></span> +<span id="LC3" class="line" lang="plaintext"></del></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="2368:1-2371:29" dir="auto">Finally, in this case, the <code><del></code> tags are interpreted as [raw HTML] <em>inside</em> the CommonMark paragraph. (Because the tag is not on a line by itself, we get inline HTML rather than an [HTML block].)</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2099:1-2103:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><del>*foo*</del></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><del><em>foo</em></del></p></span></code></pre> +<pre data-sourcepos="2373:1-2375:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><del>*foo*</del></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2377:1-2379:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><del><em>foo</em></del></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2106:1-2111:50" dir="auto">HTML tags designed to contain literal content +<p data-sourcepos="2382:1-2387:50" dir="auto">HTML tags designed to contain literal content (<code>script</code>, <code>style</code>, <code>pre</code>), comments, processing instructions, and declarations are treated somewhat differently. Instead of ending at the first blank line, these blocks end at the first line containing a corresponding end tag. As a result, these blocks can contain blank lines:</p> -<p data-sourcepos="2113:1-2113:19" dir="auto">A pre tag (type 1):</p> +<p data-sourcepos="2389:1-2389:19" dir="auto">A pre tag (type 1):</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2115:1-2131:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre language="haskell"><code></span> +<pre data-sourcepos="2391:1-2399:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre language="haskell"><code></span> <span id="LC2" class="line" lang="plaintext">import Text.HTML.TagSoup</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext">main :: IO ()</span> <span id="LC5" class="line" lang="plaintext">main = print $ parseTags tags</span> <span id="LC6" class="line" lang="plaintext"></code></pre></span> -<span id="LC7" class="line" lang="plaintext">okay</span> -<span id="LC8" class="line" lang="plaintext">.</span> -<span id="LC9" class="line" lang="plaintext"><pre language="haskell"><code></span> -<span id="LC10" class="line" lang="plaintext">import Text.HTML.TagSoup</span> -<span id="LC11" class="line" lang="plaintext"></span> -<span id="LC12" class="line" lang="plaintext">main :: IO ()</span> -<span id="LC13" class="line" lang="plaintext">main = print $ parseTags tags</span> -<span id="LC14" class="line" lang="plaintext"></code></pre></span> -<span id="LC15" class="line" lang="plaintext"><p>okay</p></span></code></pre> +<span id="LC7" class="line" lang="plaintext">okay</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2134:1-2134:22" dir="auto">A script tag (type 1):</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2136:1-2150:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><script type="text/javascript"></span> +<pre data-sourcepos="2401:1-2409:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre language="haskell"><code></span> +<span id="LC2" class="line" lang="plaintext">import Text.HTML.TagSoup</span> +<span id="LC3" class="line" lang="plaintext"></span> +<span id="LC4" class="line" lang="plaintext">main :: IO ()</span> +<span id="LC5" class="line" lang="plaintext">main = print $ parseTags tags</span> +<span id="LC6" class="line" lang="plaintext"></code></pre></span> +<span id="LC7" class="line" lang="plaintext"><p>okay</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="2412:1-2412:22" dir="auto">A script tag (type 1):</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2414:1-2421:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><script type="text/javascript"></span> <span id="LC2" class="line" lang="plaintext">// JavaScript example</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext">document.getElementById("demo").innerHTML = "Hello JavaScript!";</span> <span id="LC5" class="line" lang="plaintext"></script></span> -<span id="LC6" class="line" lang="plaintext">okay</span> -<span id="LC7" class="line" lang="plaintext">.</span> -<span id="LC8" class="line" lang="plaintext"><script type="text/javascript"></span> -<span id="LC9" class="line" lang="plaintext">// JavaScript example</span> -<span id="LC10" class="line" lang="plaintext"></span> -<span id="LC11" class="line" lang="plaintext">document.getElementById("demo").innerHTML = "Hello JavaScript!";</span> -<span id="LC12" class="line" lang="plaintext"></script></span> -<span id="LC13" class="line" lang="plaintext"><p>okay</p></span></code></pre> +<span id="LC6" class="line" lang="plaintext">okay</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2423:1-2430:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><script type="text/javascript"></span> +<span id="LC2" class="line" lang="plaintext">// JavaScript example</span> +<span id="LC3" class="line" lang="plaintext"></span> +<span id="LC4" class="line" lang="plaintext">document.getElementById("demo").innerHTML = "Hello JavaScript!";</span> +<span id="LC5" class="line" lang="plaintext"></script></span> +<span id="LC6" class="line" lang="plaintext"><p>okay</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="2433:1-2433:21" dir="auto">A style tag (type 1):</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2435:1-2443:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><style</span> +<span id="LC2" class="line" lang="plaintext"> type="text/css"></span> +<span id="LC3" class="line" lang="plaintext">h1 {color:red;}</span> +<span id="LC4" class="line" lang="plaintext"></span> +<span id="LC5" class="line" lang="plaintext">p {color:blue;}</span> +<span id="LC6" class="line" lang="plaintext"></style></span> +<span id="LC7" class="line" lang="plaintext">okay</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2153:1-2153:21" dir="auto">A style tag (type 1):</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2155:1-2171:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><style</span> +<pre data-sourcepos="2445:1-2453:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><style</span> <span id="LC2" class="line" lang="plaintext"> type="text/css"></span> <span id="LC3" class="line" lang="plaintext">h1 {color:red;}</span> <span id="LC4" class="line" lang="plaintext"></span> <span id="LC5" class="line" lang="plaintext">p {color:blue;}</span> <span id="LC6" class="line" lang="plaintext"></style></span> -<span id="LC7" class="line" lang="plaintext">okay</span> -<span id="LC8" class="line" lang="plaintext">.</span> -<span id="LC9" class="line" lang="plaintext"><style</span> -<span id="LC10" class="line" lang="plaintext"> type="text/css"></span> -<span id="LC11" class="line" lang="plaintext">h1 {color:red;}</span> -<span id="LC12" class="line" lang="plaintext"></span> -<span id="LC13" class="line" lang="plaintext">p {color:blue;}</span> -<span id="LC14" class="line" lang="plaintext"></style></span> -<span id="LC15" class="line" lang="plaintext"><p>okay</p></span></code></pre> -<copy-code></copy-code> -</div> -<p data-sourcepos="2174:1-2176:28" dir="auto">If there is no matching end tag, the block will end at the +<span id="LC7" class="line" lang="plaintext"><p>okay</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="2456:1-2458:28" dir="auto">If there is no matching end tag, the block will end at the end of the document (or the enclosing [block quote][block quotes] or [list item][list items]):</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2178:1-2188:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><style</span> +<pre data-sourcepos="2460:1-2465:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><style</span> <span id="LC2" class="line" lang="plaintext"> type="text/css"></span> <span id="LC3" class="line" lang="plaintext"></span> -<span id="LC4" class="line" lang="plaintext">foo</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><style</span> -<span id="LC7" class="line" lang="plaintext"> type="text/css"></span> -<span id="LC8" class="line" lang="plaintext"></span> -<span id="LC9" class="line" lang="plaintext">foo</span></code></pre> +<span id="LC4" class="line" lang="plaintext">foo</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2191:1-2202:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> <div></span> +<pre data-sourcepos="2467:1-2472:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><style</span> +<span id="LC2" class="line" lang="plaintext"> type="text/css"></span> +<span id="LC3" class="line" lang="plaintext"></span> +<span id="LC4" class="line" lang="plaintext">foo</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2475:1-2480:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> <div></span> <span id="LC2" class="line" lang="plaintext">> foo</span> <span id="LC3" class="line" lang="plaintext"></span> -<span id="LC4" class="line" lang="plaintext">bar</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><blockquote></span> -<span id="LC7" class="line" lang="plaintext"><div></span> -<span id="LC8" class="line" lang="plaintext">foo</span> -<span id="LC9" class="line" lang="plaintext"></blockquote></span> -<span id="LC10" class="line" lang="plaintext"><p>bar</p></span></code></pre> +<span id="LC4" class="line" lang="plaintext">bar</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2205:1-2215:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- <div></span> -<span id="LC2" class="line" lang="plaintext">- foo</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><ul></span> -<span id="LC5" class="line" lang="plaintext"><li></span> -<span id="LC6" class="line" lang="plaintext"><div></span> -<span id="LC7" class="line" lang="plaintext"></li></span> -<span id="LC8" class="line" lang="plaintext"><li>foo</li></span> -<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre> +<pre data-sourcepos="2482:1-2488:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><div></span> +<span id="LC3" class="line" lang="plaintext">foo</span> +<span id="LC4" class="line" lang="plaintext"></blockquote></span> +<span id="LC5" class="line" lang="plaintext"><p>bar</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2218:1-2218:56" dir="auto">The end tag can occur on the same line as the start tag:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2220:1-2226:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><style>p{color:red;}</style></span> -<span id="LC2" class="line" lang="plaintext">*foo*</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><style>p{color:red;}</style></span> -<span id="LC5" class="line" lang="plaintext"><p><em>foo</em></p></span></code></pre> +<pre data-sourcepos="2491:1-2494:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- <div></span> +<span id="LC2" class="line" lang="plaintext">- foo</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2496:1-2503:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><div></span> +<span id="LC4" class="line" lang="plaintext"></li></span> +<span id="LC5" class="line" lang="plaintext"><li>foo</li></span> +<span id="LC6" class="line" lang="plaintext"></ul></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="2506:1-2506:56" dir="auto">The end tag can occur on the same line as the start tag:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2508:1-2511:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><style>p{color:red;}</style></span> +<span id="LC2" class="line" lang="plaintext">*foo*</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2513:1-2516:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><style>p{color:red;}</style></span> +<span id="LC2" class="line" lang="plaintext"><p><em>foo</em></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2519:1-2522:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><!-- foo -->*bar*</span> +<span id="LC2" class="line" lang="plaintext">*baz*</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2229:1-2235:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><!-- foo -->*bar*</span> -<span id="LC2" class="line" lang="plaintext">*baz*</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><!-- foo -->*bar*</span> -<span id="LC5" class="line" lang="plaintext"><p><em>baz</em></p></span></code></pre> +<pre data-sourcepos="2524:1-2527:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><!-- foo -->*bar*</span> +<span id="LC2" class="line" lang="plaintext"><p><em>baz</em></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2238:1-2239:45" dir="auto">Note that anything on the last line after the +<p data-sourcepos="2530:1-2531:45" dir="auto">Note that anything on the last line after the end tag will be included in the [HTML block]:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2241:1-2249:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><script></span> +<pre data-sourcepos="2533:1-2537:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><script></span> +<span id="LC2" class="line" lang="plaintext">foo</span> +<span id="LC3" class="line" lang="plaintext"></script>1. *bar*</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2539:1-2543:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><script></span> <span id="LC2" class="line" lang="plaintext">foo</span> -<span id="LC3" class="line" lang="plaintext"></script>1. *bar*</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><script></span> -<span id="LC6" class="line" lang="plaintext">foo</span> -<span id="LC7" class="line" lang="plaintext"></script>1. *bar*</span></code></pre> +<span id="LC3" class="line" lang="plaintext"></script>1. *bar*</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2252:1-2252:19" dir="auto">A comment (type 2):</p> +<p data-sourcepos="2546:1-2546:19" dir="auto">A comment (type 2):</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2254:1-2266:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><!-- Foo</span> +<pre data-sourcepos="2548:1-2554:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><!-- Foo</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext">bar</span> <span id="LC4" class="line" lang="plaintext"> baz --></span> -<span id="LC5" class="line" lang="plaintext">okay</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><!-- Foo</span> -<span id="LC8" class="line" lang="plaintext"></span> -<span id="LC9" class="line" lang="plaintext">bar</span> -<span id="LC10" class="line" lang="plaintext"> baz --></span> -<span id="LC11" class="line" lang="plaintext"><p>okay</p></span></code></pre> +<span id="LC5" class="line" lang="plaintext">okay</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2556:1-2562:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><!-- Foo</span> +<span id="LC2" class="line" lang="plaintext"></span> +<span id="LC3" class="line" lang="plaintext">bar</span> +<span id="LC4" class="line" lang="plaintext"> baz --></span> +<span id="LC5" class="line" lang="plaintext"><p>okay</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2270:1-2270:34" dir="auto">A processing instruction (type 3):</p> +<p data-sourcepos="2566:1-2566:34" dir="auto">A processing instruction (type 3):</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2272:1-2286:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><?php</span> +<pre data-sourcepos="2568:1-2575:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><?php</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext"> echo '>';</span> <span id="LC4" class="line" lang="plaintext"></span> <span id="LC5" class="line" lang="plaintext">?></span> -<span id="LC6" class="line" lang="plaintext">okay</span> -<span id="LC7" class="line" lang="plaintext">.</span> -<span id="LC8" class="line" lang="plaintext"><?php</span> -<span id="LC9" class="line" lang="plaintext"></span> -<span id="LC10" class="line" lang="plaintext"> echo '>';</span> -<span id="LC11" class="line" lang="plaintext"></span> -<span id="LC12" class="line" lang="plaintext">?></span> -<span id="LC13" class="line" lang="plaintext"><p>okay</p></span></code></pre> +<span id="LC6" class="line" lang="plaintext">okay</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2577:1-2584:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><?php</span> +<span id="LC2" class="line" lang="plaintext"></span> +<span id="LC3" class="line" lang="plaintext"> echo '>';</span> +<span id="LC4" class="line" lang="plaintext"></span> +<span id="LC5" class="line" lang="plaintext">?></span> +<span id="LC6" class="line" lang="plaintext"><p>okay</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="2587:1-2587:23" dir="auto">A declaration (type 4):</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2589:1-2591:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><!DOCTYPE html></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2289:1-2289:23" dir="auto">A declaration (type 4):</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2291:1-2295:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><!DOCTYPE html></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><!DOCTYPE html></span></code></pre> +<pre data-sourcepos="2593:1-2595:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><!DOCTYPE html></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2298:1-2298:15" dir="auto">CDATA (type 5):</p> +<p data-sourcepos="2598:1-2598:15" dir="auto">CDATA (type 5):</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2300:1-2328:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><![CDATA[</span> +<pre data-sourcepos="2600:1-2614:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><![CDATA[</span> <span id="LC2" class="line" lang="plaintext">function matchwo(a,b)</span> <span id="LC3" class="line" lang="plaintext">{</span> <span id="LC4" class="line" lang="plaintext"> if (a < b && a < 0) then {</span> @@ -2026,103 +2326,115 @@ end tag will be included in the [HTML block]:</p> <span id="LC10" class="line" lang="plaintext"> }</span> <span id="LC11" class="line" lang="plaintext">}</span> <span id="LC12" class="line" lang="plaintext">]]></span> -<span id="LC13" class="line" lang="plaintext">okay</span> -<span id="LC14" class="line" lang="plaintext">.</span> -<span id="LC15" class="line" lang="plaintext"><![CDATA[</span> -<span id="LC16" class="line" lang="plaintext">function matchwo(a,b)</span> -<span id="LC17" class="line" lang="plaintext">{</span> -<span id="LC18" class="line" lang="plaintext"> if (a < b && a < 0) then {</span> -<span id="LC19" class="line" lang="plaintext"> return 1;</span> -<span id="LC20" class="line" lang="plaintext"></span> -<span id="LC21" class="line" lang="plaintext"> } else {</span> -<span id="LC22" class="line" lang="plaintext"></span> -<span id="LC23" class="line" lang="plaintext"> return 0;</span> -<span id="LC24" class="line" lang="plaintext"> }</span> -<span id="LC25" class="line" lang="plaintext">}</span> -<span id="LC26" class="line" lang="plaintext">]]></span> -<span id="LC27" class="line" lang="plaintext"><p>okay</p></span></code></pre> -<copy-code></copy-code> -</div> -<p data-sourcepos="2331:1-2331:54" dir="auto">The opening tag can be indented 1-3 spaces, but not 4:</p> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2333:1-2341:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> <!-- foo --></span> -<span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext"> <!-- foo --></span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"> <!-- foo --></span> -<span id="LC6" class="line" lang="plaintext"><pre><code>&lt;!-- foo --&gt;</span> -<span id="LC7" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC13" class="line" lang="plaintext">okay</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2344:1-2352:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> <div></span> +<pre data-sourcepos="2616:1-2630:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><![CDATA[</span> +<span id="LC2" class="line" lang="plaintext">function matchwo(a,b)</span> +<span id="LC3" class="line" lang="plaintext">{</span> +<span id="LC4" class="line" lang="plaintext"> if (a < b && a < 0) then {</span> +<span id="LC5" class="line" lang="plaintext"> return 1;</span> +<span id="LC6" class="line" lang="plaintext"></span> +<span id="LC7" class="line" lang="plaintext"> } else {</span> +<span id="LC8" class="line" lang="plaintext"></span> +<span id="LC9" class="line" lang="plaintext"> return 0;</span> +<span id="LC10" class="line" lang="plaintext"> }</span> +<span id="LC11" class="line" lang="plaintext">}</span> +<span id="LC12" class="line" lang="plaintext">]]></span> +<span id="LC13" class="line" lang="plaintext"><p>okay</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="2633:1-2633:54" dir="auto">The opening tag can be indented 1-3 spaces, but not 4:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2635:1-2639:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> <!-- foo --></span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext"> <div></span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"> <div></span> -<span id="LC6" class="line" lang="plaintext"><pre><code>&lt;div&gt;</span> -<span id="LC7" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> <!-- foo --></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2641:1-2645:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> <!-- foo --></span> +<span id="LC2" class="line" lang="plaintext"><pre><code>&lt;!-- foo --&gt;</span> +<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2648:1-2652:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> <div></span> +<span id="LC2" class="line" lang="plaintext"></span> +<span id="LC3" class="line" lang="plaintext"> <div></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2654:1-2658:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> <div></span> +<span id="LC2" class="line" lang="plaintext"><pre><code>&lt;div&gt;</span> +<span id="LC3" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2355:1-2356:25" dir="auto">An HTML block of types 1--6 can interrupt a paragraph, and need not be +<p data-sourcepos="2661:1-2662:25" dir="auto">An HTML block of types 1--6 can interrupt a paragraph, and need not be preceded by a blank line.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2358:1-2368:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> +<pre data-sourcepos="2664:1-2669:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> +<span id="LC2" class="line" lang="plaintext"><div></span> +<span id="LC3" class="line" lang="plaintext">bar</span> +<span id="LC4" class="line" lang="plaintext"></div></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2671:1-2676:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</p></span> <span id="LC2" class="line" lang="plaintext"><div></span> <span id="LC3" class="line" lang="plaintext">bar</span> -<span id="LC4" class="line" lang="plaintext"></div></span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><p>Foo</p></span> -<span id="LC7" class="line" lang="plaintext"><div></span> -<span id="LC8" class="line" lang="plaintext">bar</span> -<span id="LC9" class="line" lang="plaintext"></div></span></code></pre> +<span id="LC4" class="line" lang="plaintext"></div></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2371:1-2373:7" dir="auto">However, a following blank line is needed, except at the end of +<p data-sourcepos="2679:1-2681:7" dir="auto">However, a following blank line is needed, except at the end of a document, and except for blocks of types 1--5, [above][HTML block]:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2375:1-2385:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></span> +<pre data-sourcepos="2683:1-2688:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></span> +<span id="LC2" class="line" lang="plaintext">bar</span> +<span id="LC3" class="line" lang="plaintext"></div></span> +<span id="LC4" class="line" lang="plaintext">*foo*</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2690:1-2695:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></span> <span id="LC2" class="line" lang="plaintext">bar</span> <span id="LC3" class="line" lang="plaintext"></div></span> -<span id="LC4" class="line" lang="plaintext">*foo*</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><div></span> -<span id="LC7" class="line" lang="plaintext">bar</span> -<span id="LC8" class="line" lang="plaintext"></div></span> -<span id="LC9" class="line" lang="plaintext">*foo*</span></code></pre> +<span id="LC4" class="line" lang="plaintext">*foo*</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2388:1-2388:51" dir="auto">HTML blocks of type 7 cannot interrupt a paragraph:</p> +<p data-sourcepos="2698:1-2698:51" dir="auto">HTML blocks of type 7 cannot interrupt a paragraph:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2390:1-2398:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> +<pre data-sourcepos="2700:1-2704:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> <span id="LC2" class="line" lang="plaintext"><a href="bar"></span> -<span id="LC3" class="line" lang="plaintext">baz</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>Foo</span> -<span id="LC6" class="line" lang="plaintext"><a href="bar"></span> -<span id="LC7" class="line" lang="plaintext">baz</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2706:1-2710:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</span> +<span id="LC2" class="line" lang="plaintext"><a href="bar"></span> +<span id="LC3" class="line" lang="plaintext">baz</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2401:1-2402:26" dir="auto">This rule differs from John Gruber's original Markdown syntax +<p data-sourcepos="2713:1-2714:26" dir="auto">This rule differs from John Gruber's original Markdown syntax specification, which says:</p> -<blockquote data-sourcepos="2404:1-2407:51" dir="auto"> -<p data-sourcepos="2404:3-2407:51">The only restrictions are that block-level HTML elements — +<blockquote data-sourcepos="2716:1-2719:51" dir="auto"> +<p data-sourcepos="2716:3-2719:51">The only restrictions are that block-level HTML elements — e.g. <code><div></code>, <code><table></code>, <code><pre></code>, <code><p></code>, etc. — must be separated from surrounding content by blank lines, and the start and end tags of the block should not be indented with tabs or spaces.</p> </blockquote> -<p data-sourcepos="2409:1-2410:5" dir="auto">In some ways Gruber's rule is more restrictive than the one given +<p data-sourcepos="2721:1-2722:5" dir="auto">In some ways Gruber's rule is more restrictive than the one given here:</p> -<ul data-sourcepos="2412:1-2416:0" dir="auto"> -<li data-sourcepos="2412:1-2412:61">It requires that an HTML block be preceded by a blank line.</li> -<li data-sourcepos="2413:1-2413:49">It does not allow the start tag to be indented.</li> -<li data-sourcepos="2414:1-2416:0">It requires a matching end tag, which it also does not allow to +<ul data-sourcepos="2724:1-2728:0" dir="auto"> +<li data-sourcepos="2724:1-2724:61">It requires that an HTML block be preceded by a blank line.</li> +<li data-sourcepos="2725:1-2725:49">It does not allow the start tag to be indented.</li> +<li data-sourcepos="2726:1-2728:0">It requires a matching end tag, which it also does not allow to be indented.</li> </ul> -<p data-sourcepos="2417:1-2418:34" dir="auto">Most Markdown implementations (including some of Gruber's own) do not +<p data-sourcepos="2729:1-2730:34" dir="auto">Most Markdown implementations (including some of Gruber's own) do not respect all of these restrictions.</p> -<p data-sourcepos="2420:1-2427:61" dir="auto">There is one respect, however, in which Gruber's rule is more liberal +<p data-sourcepos="2732:1-2739:61" dir="auto">There is one respect, however, in which Gruber's rule is more liberal than the one given here, since it allows blank lines to occur inside an HTML block. There are two reasons for disallowing them here. First, it removes the need to parse balanced tags, which is @@ -2130,40 +2442,44 @@ expensive and can require backtracking from the end of the document if no matching end tag is found. Second, it provides a very simple and flexible way of including Markdown content inside HTML tags: simply separate the Markdown from the HTML using blank lines:</p> -<p data-sourcepos="2429:1-2429:8" dir="auto">Compare:</p> +<p data-sourcepos="2741:1-2741:8" dir="auto">Compare:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2431:1-2441:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></span> +<pre data-sourcepos="2743:1-2749:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext">*Emphasized* text.</span> <span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext"></div></span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><div></span> -<span id="LC8" class="line" lang="plaintext"><p><em>Emphasized</em> text.</p></span> -<span id="LC9" class="line" lang="plaintext"></div></span></code></pre> +<span id="LC5" class="line" lang="plaintext"></div></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2751:1-2755:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></span> +<span id="LC2" class="line" lang="plaintext"><p><em>Emphasized</em> text.</p></span> +<span id="LC3" class="line" lang="plaintext"></div></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2444:1-2452:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></span> +<pre data-sourcepos="2758:1-2762:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></span> <span id="LC2" class="line" lang="plaintext">*Emphasized* text.</span> -<span id="LC3" class="line" lang="plaintext"></div></span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><div></span> -<span id="LC6" class="line" lang="plaintext">*Emphasized* text.</span> -<span id="LC7" class="line" lang="plaintext"></div></span></code></pre> +<span id="LC3" class="line" lang="plaintext"></div></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2764:1-2768:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></span> +<span id="LC2" class="line" lang="plaintext">*Emphasized* text.</span> +<span id="LC3" class="line" lang="plaintext"></div></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2455:1-2459:22" dir="auto">Some Markdown implementations have adopted a convention of +<p data-sourcepos="2771:1-2775:22" dir="auto">Some Markdown implementations have adopted a convention of interpreting content inside tags as text if the open tag has the attribute <code>markdown=1</code>. The rule given above seems a simpler and more elegant way of achieving the same expressive power, which is also much simpler to parse.</p> -<p data-sourcepos="2461:1-2464:59" dir="auto">The main potential drawback is that one can no longer paste HTML +<p data-sourcepos="2777:1-2780:59" dir="auto">The main potential drawback is that one can no longer paste HTML blocks into Markdown documents with 100% reliability. However, <em>in most cases</em> this will work fine, because the blank lines in HTML are usually followed by HTML block tags. For example:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2466:1-2486:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span> +<pre data-sourcepos="2782:1-2794:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext"><tr></span> <span id="LC4" class="line" lang="plaintext"></span> @@ -2173,22 +2489,24 @@ HTML are usually followed by HTML block tags. For example:</p> <span id="LC8" class="line" lang="plaintext"></span> <span id="LC9" class="line" lang="plaintext"></tr></span> <span id="LC10" class="line" lang="plaintext"></span> -<span id="LC11" class="line" lang="plaintext"></table></span> -<span id="LC12" class="line" lang="plaintext">.</span> -<span id="LC13" class="line" lang="plaintext"><table></span> -<span id="LC14" class="line" lang="plaintext"><tr></span> -<span id="LC15" class="line" lang="plaintext"><td></span> -<span id="LC16" class="line" lang="plaintext">Hi</span> -<span id="LC17" class="line" lang="plaintext"></td></span> -<span id="LC18" class="line" lang="plaintext"></tr></span> -<span id="LC19" class="line" lang="plaintext"></table></span></code></pre> -<copy-code></copy-code> -</div> -<p data-sourcepos="2489:1-2491:23" dir="auto">There are problems, however, if the inner tags are indented +<span id="LC11" class="line" lang="plaintext"></table></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2796:1-2804:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span> +<span id="LC2" class="line" lang="plaintext"><tr></span> +<span id="LC3" class="line" lang="plaintext"><td></span> +<span id="LC4" class="line" lang="plaintext">Hi</span> +<span id="LC5" class="line" lang="plaintext"></td></span> +<span id="LC6" class="line" lang="plaintext"></tr></span> +<span id="LC7" class="line" lang="plaintext"></table></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="2807:1-2809:23" dir="auto">There are problems, however, if the inner tags are indented <em>and</em> separated by spaces, as then they will be interpreted as an indented code block:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2493:1-2514:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span> +<pre data-sourcepos="2811:1-2823:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext"> <tr></span> <span id="LC4" class="line" lang="plaintext"></span> @@ -2198,25 +2516,27 @@ an indented code block:</p> <span id="LC8" class="line" lang="plaintext"></span> <span id="LC9" class="line" lang="plaintext"> </tr></span> <span id="LC10" class="line" lang="plaintext"></span> -<span id="LC11" class="line" lang="plaintext"></table></span> -<span id="LC12" class="line" lang="plaintext">.</span> -<span id="LC13" class="line" lang="plaintext"><table></span> -<span id="LC14" class="line" lang="plaintext"> <tr></span> -<span id="LC15" class="line" lang="plaintext"><pre><code>&lt;td&gt;</span> -<span id="LC16" class="line" lang="plaintext"> Hi</span> -<span id="LC17" class="line" lang="plaintext">&lt;/td&gt;</span> -<span id="LC18" class="line" lang="plaintext"></code></pre></span> -<span id="LC19" class="line" lang="plaintext"> </tr></span> -<span id="LC20" class="line" lang="plaintext"></table></span></code></pre> -<copy-code></copy-code> -</div> -<p data-sourcepos="2517:1-2520:26" dir="auto">Fortunately, blank lines are usually not necessary and can be +<span id="LC11" class="line" lang="plaintext"></table></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2825:1-2834:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span> +<span id="LC2" class="line" lang="plaintext"> <tr></span> +<span id="LC3" class="line" lang="plaintext"><pre><code>&lt;td&gt;</span> +<span id="LC4" class="line" lang="plaintext"> Hi</span> +<span id="LC5" class="line" lang="plaintext">&lt;/td&gt;</span> +<span id="LC6" class="line" lang="plaintext"></code></pre></span> +<span id="LC7" class="line" lang="plaintext"> </tr></span> +<span id="LC8" class="line" lang="plaintext"></table></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="2837:1-2840:26" dir="auto">Fortunately, blank lines are usually not necessary and can be deleted. The exception is inside <code><pre></code> tags, but as described [above][HTML blocks], raw HTML blocks starting with <code><pre></code> <em>can</em> contain blank lines.</p> -<h2 data-sourcepos="2522:1-2522:29" dir="auto"> +<h2 data-sourcepos="2842:1-2842:29" dir="auto"> <a id="user-content-link-reference-definitions" class="anchor" href="#link-reference-definitions" aria-hidden="true"></a>Link reference definitions</h2> -<p data-sourcepos="2524:1-2532:61" dir="auto">A <a href="@">link reference definition</a> +<p data-sourcepos="2844:1-2852:61" dir="auto">A <a href="@">link reference definition</a> consists of a [link label], indented up to three spaces, followed by a colon (<code>:</code>), optional [whitespace] (including up to one [line ending]), a [link destination], @@ -2225,656 +2545,748 @@ optional [whitespace] (including up to one title], which if it is present must be separated from the [link destination] by [whitespace]. No further [non-whitespace characters] may occur on the line.</p> -<p data-sourcepos="2534:1-2539:5" dir="auto">A [link reference definition] +<p data-sourcepos="2854:1-2859:5" dir="auto">A [link reference definition] does not correspond to a structural element of a document. Instead, it defines a label which can be used in [reference links] and reference-style [images] elsewhere in the document. [Link reference definitions] can come either before or after the links that use them.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2541:1-2547:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url "title"</span> +<pre data-sourcepos="2861:1-2865:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url "title"</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/url" title="title">foo</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2867:1-2869:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title">foo</a></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2550:1-2558:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> [foo]: </span> +<pre data-sourcepos="2872:1-2878:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> [foo]: </span> <span id="LC2" class="line" lang="plaintext"> /url </span> <span id="LC3" class="line" lang="plaintext"> 'the title' </span> <span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext">[foo]</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><p><a href="/url" title="the title">foo</a></p></span></code></pre> +<span id="LC5" class="line" lang="plaintext">[foo]</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2880:1-2882:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="the title">foo</a></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2561:1-2567:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[Foo*bar\]]:my_(url) 'title (with parens)'</span> +<pre data-sourcepos="2885:1-2889:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[Foo*bar\]]:my_(url) 'title (with parens)'</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[Foo*bar\]]</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="my_(url)" title="title (with parens)">Foo*bar]</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[Foo*bar\]]</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2570:1-2578:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[Foo bar]:</span> +<pre data-sourcepos="2891:1-2893:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="my_(url)" title="title (with parens)">Foo*bar]</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2896:1-2902:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[Foo bar]:</span> <span id="LC2" class="line" lang="plaintext"><my url></span> <span id="LC3" class="line" lang="plaintext">'title'</span> <span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext">[Foo bar]</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><p><a href="my%20url" title="title">Foo bar</a></p></span></code></pre> +<span id="LC5" class="line" lang="plaintext">[Foo bar]</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2904:1-2906:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="my%20url" title="title">Foo bar</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2581:1-2581:41" dir="auto">The title may extend over multiple lines:</p> +<p data-sourcepos="2909:1-2909:41" dir="auto">The title may extend over multiple lines:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2583:1-2597:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url '</span> +<pre data-sourcepos="2911:1-2919:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url '</span> <span id="LC2" class="line" lang="plaintext">title</span> <span id="LC3" class="line" lang="plaintext">line1</span> <span id="LC4" class="line" lang="plaintext">line2</span> <span id="LC5" class="line" lang="plaintext">'</span> <span id="LC6" class="line" lang="plaintext"></span> -<span id="LC7" class="line" lang="plaintext">[foo]</span> -<span id="LC8" class="line" lang="plaintext">.</span> -<span id="LC9" class="line" lang="plaintext"><p><a href="/url" title="</span> -<span id="LC10" class="line" lang="plaintext">title</span> -<span id="LC11" class="line" lang="plaintext">line1</span> -<span id="LC12" class="line" lang="plaintext">line2</span> -<span id="LC13" class="line" lang="plaintext">">foo</a></p></span></code></pre> +<span id="LC7" class="line" lang="plaintext">[foo]</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2921:1-2927:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="</span> +<span id="LC2" class="line" lang="plaintext">title</span> +<span id="LC3" class="line" lang="plaintext">line1</span> +<span id="LC4" class="line" lang="plaintext">line2</span> +<span id="LC5" class="line" lang="plaintext">">foo</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2600:1-2600:43" dir="auto">However, it may not contain a [blank line]:</p> +<p data-sourcepos="2930:1-2930:43" dir="auto">However, it may not contain a [blank line]:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2602:1-2612:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url 'title</span> +<pre data-sourcepos="2932:1-2938:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url 'title</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext">with blank line'</span> <span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext">[foo]</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><p>[foo]: /url 'title</p></span> -<span id="LC8" class="line" lang="plaintext"><p>with blank line'</p></span> -<span id="LC9" class="line" lang="plaintext"><p>[foo]</p></span></code></pre> +<span id="LC5" class="line" lang="plaintext">[foo]</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2940:1-2944:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo]: /url 'title</p></span> +<span id="LC2" class="line" lang="plaintext"><p>with blank line'</p></span> +<span id="LC3" class="line" lang="plaintext"><p>[foo]</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2615:1-2615:25" dir="auto">The title may be omitted:</p> +<p data-sourcepos="2947:1-2947:25" dir="auto">The title may be omitted:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2617:1-2624:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]:</span> +<pre data-sourcepos="2949:1-2954:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]:</span> <span id="LC2" class="line" lang="plaintext">/url</span> <span id="LC3" class="line" lang="plaintext"></span> -<span id="LC4" class="line" lang="plaintext">[foo]</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><p><a href="/url">foo</a></p></span></code></pre> +<span id="LC4" class="line" lang="plaintext">[foo]</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2956:1-2958:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url">foo</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2627:1-2627:40" dir="auto">The link destination may not be omitted:</p> +<p data-sourcepos="2961:1-2961:40" dir="auto">The link destination may not be omitted:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2629:1-2636:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]:</span> +<pre data-sourcepos="2963:1-2967:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]:</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>[foo]:</p></span> -<span id="LC6" class="line" lang="plaintext"><p>[foo]</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2969:1-2972:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo]:</p></span> +<span id="LC2" class="line" lang="plaintext"><p>[foo]</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2638:2-2639:16" dir="auto">However, an empty link destination may be specified using +<p data-sourcepos="2974:2-2975:16" dir="auto">However, an empty link destination may be specified using angle brackets:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2641:1-2647:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: <></span> +<pre data-sourcepos="2977:1-2981:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: <></span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="">foo</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2983:1-2985:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="">foo</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2649:1-2650:11" dir="auto">The title must be separated from the link destination by +<p data-sourcepos="2987:1-2988:11" dir="auto">The title must be separated from the link destination by whitespace:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2652:1-2659:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: <bar>(baz)</span> +<pre data-sourcepos="2990:1-2994:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: <bar>(baz)</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>[foo]: <bar>(baz)</p></span> -<span id="LC6" class="line" lang="plaintext"><p>[foo]</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2662:1-2663:24" dir="auto">Both title and destination can contain backslash escapes +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="2996:1-2999:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo]: <bar>(baz)</p></span> +<span id="LC2" class="line" lang="plaintext"><p>[foo]</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="3002:1-3003:24" dir="auto">Both title and destination can contain backslash escapes and literal backslashes:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2665:1-2671:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url\bar\*baz "foo\"bar\baz"</span> +<pre data-sourcepos="3005:1-3009:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url\bar\*baz "foo\"bar\baz"</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/url%5Cbar*baz" title="foo&quot;bar\baz">foo</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3011:1-3013:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url%5Cbar*baz" title="foo&quot;bar\baz">foo</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2674:1-2674:52" dir="auto">A link can come before its corresponding definition:</p> +<p data-sourcepos="3016:1-3016:52" dir="auto">A link can come before its corresponding definition:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2676:1-2682:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]</span> +<pre data-sourcepos="3018:1-3022:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]: url</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="url">foo</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]: url</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3024:1-3026:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="url">foo</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2685:1-2686:11" dir="auto">If there are several matching definitions, the first one takes +<p data-sourcepos="3029:1-3030:11" dir="auto">If there are several matching definitions, the first one takes precedence:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2688:1-2695:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]</span> +<pre data-sourcepos="3032:1-3037:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext">[foo]: first</span> -<span id="LC4" class="line" lang="plaintext">[foo]: second</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><p><a href="first">foo</a></p></span></code></pre> +<span id="LC4" class="line" lang="plaintext">[foo]: second</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3039:1-3041:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="first">foo</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2698:1-2699:33" dir="auto">As noted in the section on [Links], matching of labels is +<p data-sourcepos="3044:1-3045:33" dir="auto">As noted in the section on [Links], matching of labels is case-insensitive (see [matches]).</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2701:1-2707:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[FOO]: /url</span> +<pre data-sourcepos="3047:1-3051:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[FOO]: /url</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[Foo]</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/url">Foo</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[Foo]</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2710:1-2716:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[ΑΓΩ]: /φου</span> +<pre data-sourcepos="3053:1-3055:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url">Foo</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3058:1-3062:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[ΑΓΩ]: /φου</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[αγω]</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/%CF%86%CE%BF%CF%85">αγω</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[αγω]</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3064:1-3066:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/%CF%86%CE%BF%CF%85">αγω</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2719:1-2720:39" dir="auto">Here is a link reference definition with no corresponding link. +<p data-sourcepos="3069:1-3070:39" dir="auto">Here is a link reference definition with no corresponding link. It contributes nothing to the document.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2722:1-2725:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url</span> -<span id="LC2" class="line" lang="plaintext">.</span></code></pre> +<pre data-sourcepos="3072:1-3074:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2728:1-2728:20" dir="auto">Here is another one:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2730:1-2737:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[</span> +<pre data-sourcepos="3076:1-3077:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="3080:1-3080:20" dir="auto">Here is another one:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3082:1-3087:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[</span> <span id="LC2" class="line" lang="plaintext">foo</span> <span id="LC3" class="line" lang="plaintext">]: /url</span> -<span id="LC4" class="line" lang="plaintext">bar</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><p>bar</p></span></code></pre> +<span id="LC4" class="line" lang="plaintext">bar</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2740:1-2741:44" dir="auto">This is not a link reference definition, because there are +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3089:1-3091:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>bar</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="3094:1-3095:44" dir="auto">This is not a link reference definition, because there are [non-whitespace characters] after the title:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2743:1-2747:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url "title" ok</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>[foo]: /url &quot;title&quot; ok</p></span></code></pre> +<pre data-sourcepos="3097:1-3099:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url "title" ok</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3101:1-3103:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo]: /url &quot;title&quot; ok</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="3106:1-3106:57" dir="auto">This is a link reference definition, but it has no title:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3108:1-3111:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url</span> +<span id="LC2" class="line" lang="plaintext">"title" ok</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2750:1-2750:57" dir="auto">This is a link reference definition, but it has no title:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2752:1-2757:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url</span> -<span id="LC2" class="line" lang="plaintext">"title" ok</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>&quot;title&quot; ok</p></span></code></pre> +<pre data-sourcepos="3113:1-3115:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&quot;title&quot; ok</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2760:1-2761:12" dir="auto">This is not a link reference definition, because it is indented +<p data-sourcepos="3118:1-3119:12" dir="auto">This is not a link reference definition, because it is indented four spaces:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2763:1-2771:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> [foo]: /url "title"</span> +<pre data-sourcepos="3121:1-3125:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> [foo]: /url "title"</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><pre><code>[foo]: /url &quot;title&quot;</span> -<span id="LC6" class="line" lang="plaintext"></code></pre></span> -<span id="LC7" class="line" lang="plaintext"><p>[foo]</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3127:1-3131:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>[foo]: /url &quot;title&quot;</span> +<span id="LC2" class="line" lang="plaintext"></code></pre></span> +<span id="LC3" class="line" lang="plaintext"><p>[foo]</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2774:1-2775:13" dir="auto">This is not a link reference definition, because it occurs inside +<p data-sourcepos="3134:1-3135:13" dir="auto">This is not a link reference definition, because it occurs inside a code block:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2777:1-2787:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span> +<pre data-sourcepos="3137:1-3143:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span> <span id="LC2" class="line" lang="plaintext">[foo]: /url</span> <span id="LC3" class="line" lang="plaintext">```</span> <span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext">[foo]</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><pre><code>[foo]: /url</span> -<span id="LC8" class="line" lang="plaintext"></code></pre></span> -<span id="LC9" class="line" lang="plaintext"><p>[foo]</p></span></code></pre> +<span id="LC5" class="line" lang="plaintext">[foo]</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2790:1-2790:59" dir="auto">A [link reference definition] cannot interrupt a paragraph.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2792:1-2801:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> +<pre data-sourcepos="3145:1-3149:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>[foo]: /url</span> +<span id="LC2" class="line" lang="plaintext"></code></pre></span> +<span id="LC3" class="line" lang="plaintext"><p>[foo]</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="3152:1-3152:59" dir="auto">A [link reference definition] cannot interrupt a paragraph.</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3154:1-3159:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> <span id="LC2" class="line" lang="plaintext">[bar]: /baz</span> <span id="LC3" class="line" lang="plaintext"></span> -<span id="LC4" class="line" lang="plaintext">[bar]</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><p>Foo</span> -<span id="LC7" class="line" lang="plaintext">[bar]: /baz</p></span> -<span id="LC8" class="line" lang="plaintext"><p>[bar]</p></span></code></pre> +<span id="LC4" class="line" lang="plaintext">[bar]</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3161:1-3165:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</span> +<span id="LC2" class="line" lang="plaintext">[bar]: /baz</p></span> +<span id="LC3" class="line" lang="plaintext"><p>[bar]</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2804:1-2805:65" dir="auto">However, it can directly follow other block elements, such as headings +<p data-sourcepos="3168:1-3169:65" dir="auto">However, it can directly follow other block elements, such as headings and thematic breaks, and it need not be followed by a blank line.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2807:1-2816:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"># [Foo]</span> +<pre data-sourcepos="3171:1-3175:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"># [Foo]</span> <span id="LC2" class="line" lang="plaintext">[foo]: /url</span> -<span id="LC3" class="line" lang="plaintext">> bar</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><h1><a href="/url">Foo</a></h1></span> -<span id="LC6" class="line" lang="plaintext"><blockquote></span> -<span id="LC7" class="line" lang="plaintext"><p>bar</p></span> -<span id="LC8" class="line" lang="plaintext"></blockquote></span></code></pre> +<span id="LC3" class="line" lang="plaintext">> bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3177:1-3182:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1><a href="/url">Foo</a></h1></span> +<span id="LC2" class="line" lang="plaintext"><blockquote></span> +<span id="LC3" class="line" lang="plaintext"><p>bar</p></span> +<span id="LC4" class="line" lang="plaintext"></blockquote></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2818:1-2826:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url</span> +<pre data-sourcepos="3184:1-3189:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url</span> <span id="LC2" class="line" lang="plaintext">bar</span> <span id="LC3" class="line" lang="plaintext">===</span> -<span id="LC4" class="line" lang="plaintext">[foo]</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><h1>bar</h1></span> -<span id="LC7" class="line" lang="plaintext"><p><a href="/url">foo</a></p></span></code></pre> +<span id="LC4" class="line" lang="plaintext">[foo]</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2828:1-2835:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url</span> +<pre data-sourcepos="3191:1-3194:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>bar</h1></span> +<span id="LC2" class="line" lang="plaintext"><p><a href="/url">foo</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3196:1-3200:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url</span> <span id="LC2" class="line" lang="plaintext">===</span> -<span id="LC3" class="line" lang="plaintext">[foo]</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>===</span> -<span id="LC6" class="line" lang="plaintext"><a href="/url">foo</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3202:1-3205:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>===</span> +<span id="LC2" class="line" lang="plaintext"><a href="/url">foo</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2838:1-2839:61" dir="auto">Several [link reference definitions] +<p data-sourcepos="3208:1-3209:61" dir="auto">Several [link reference definitions] can occur one after another, without intervening blank lines.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2841:1-2854:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /foo-url "foo"</span> +<pre data-sourcepos="3211:1-3220:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /foo-url "foo"</span> <span id="LC2" class="line" lang="plaintext">[bar]: /bar-url</span> <span id="LC3" class="line" lang="plaintext"> "bar"</span> <span id="LC4" class="line" lang="plaintext">[baz]: /baz-url</span> <span id="LC5" class="line" lang="plaintext"></span> <span id="LC6" class="line" lang="plaintext">[foo],</span> <span id="LC7" class="line" lang="plaintext">[bar],</span> -<span id="LC8" class="line" lang="plaintext">[baz]</span> -<span id="LC9" class="line" lang="plaintext">.</span> -<span id="LC10" class="line" lang="plaintext"><p><a href="/foo-url" title="foo">foo</a>,</span> -<span id="LC11" class="line" lang="plaintext"><a href="/bar-url" title="bar">bar</a>,</span> -<span id="LC12" class="line" lang="plaintext"><a href="/baz-url">baz</a></p></span></code></pre> +<span id="LC8" class="line" lang="plaintext">[baz]</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3222:1-3226:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/foo-url" title="foo">foo</a>,</span> +<span id="LC2" class="line" lang="plaintext"><a href="/bar-url" title="bar">bar</a>,</span> +<span id="LC3" class="line" lang="plaintext"><a href="/baz-url">baz</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2857:1-2860:12" dir="auto">[Link reference definitions] can occur +<p data-sourcepos="3229:1-3232:12" dir="auto">[Link reference definitions] can occur inside block containers, like lists and block quotations. They affect the entire document, not just the container in which they are defined:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2862:1-2870:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]</span> +<pre data-sourcepos="3234:1-3238:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">> [foo]: /url</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/url">foo</a></p></span> -<span id="LC6" class="line" lang="plaintext"><blockquote></span> -<span id="LC7" class="line" lang="plaintext"></blockquote></span></code></pre> +<span id="LC3" class="line" lang="plaintext">> [foo]: /url</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3240:1-3244:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url">foo</a></p></span> +<span id="LC2" class="line" lang="plaintext"><blockquote></span> +<span id="LC3" class="line" lang="plaintext"></blockquote></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2873:1-2877:19" dir="auto">Whether something is a [link reference definition] is +<p data-sourcepos="3247:1-3251:19" dir="auto">Whether something is a [link reference definition] is independent of whether the link reference it defines is used in the document. Thus, for example, the following document contains just a link reference definition, and no visible content:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2879:1-2882:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url</span> -<span id="LC2" class="line" lang="plaintext">.</span></code></pre> +<pre data-sourcepos="3253:1-3255:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url</span></code></pre> <copy-code></copy-code> </div> -<h2 data-sourcepos="2885:1-2885:13" dir="auto"> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3257:1-3258:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code></code></pre> +<copy-code></copy-code> +</div> +<h2 data-sourcepos="3261:1-3261:13" dir="auto"> <a id="user-content-paragraphs" class="anchor" href="#paragraphs" aria-hidden="true"></a>Paragraphs</h2> -<p data-sourcepos="2887:1-2892:13" dir="auto">A sequence of non-blank lines that cannot be interpreted as other +<p data-sourcepos="3263:1-3268:13" dir="auto">A sequence of non-blank lines that cannot be interpreted as other kinds of blocks forms a <a href="@">paragraph</a>. The contents of the paragraph are the result of parsing the paragraph's raw content as inlines. The paragraph's raw content is formed by concatenating the lines and removing initial and final [whitespace].</p> -<p data-sourcepos="2894:1-2894:37" dir="auto">A simple example with two paragraphs:</p> +<p data-sourcepos="3270:1-3270:37" dir="auto">A simple example with two paragraphs:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2896:1-2903:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span> +<pre data-sourcepos="3272:1-3276:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">bbb</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>aaa</p></span> -<span id="LC6" class="line" lang="plaintext"><p>bbb</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">bbb</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3278:1-3281:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>aaa</p></span> +<span id="LC2" class="line" lang="plaintext"><p>bbb</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2906:1-2906:58" dir="auto">Paragraphs can contain multiple lines, but no blank lines:</p> +<p data-sourcepos="3284:1-3284:58" dir="auto">Paragraphs can contain multiple lines, but no blank lines:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2908:1-2919:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span> +<pre data-sourcepos="3286:1-3292:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span> <span id="LC2" class="line" lang="plaintext">bbb</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext">ccc</span> -<span id="LC5" class="line" lang="plaintext">ddd</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><p>aaa</span> -<span id="LC8" class="line" lang="plaintext">bbb</p></span> -<span id="LC9" class="line" lang="plaintext"><p>ccc</span> -<span id="LC10" class="line" lang="plaintext">ddd</p></span></code></pre> +<span id="LC5" class="line" lang="plaintext">ddd</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2922:1-2922:54" dir="auto">Multiple blank lines between paragraph have no effect:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2924:1-2932:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span> +<pre data-sourcepos="3294:1-3299:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>aaa</span> +<span id="LC2" class="line" lang="plaintext">bbb</p></span> +<span id="LC3" class="line" lang="plaintext"><p>ccc</span> +<span id="LC4" class="line" lang="plaintext">ddd</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="3302:1-3302:54" dir="auto">Multiple blank lines between paragraph have no effect:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3304:1-3309:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext"></span> -<span id="LC4" class="line" lang="plaintext">bbb</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><p>aaa</p></span> -<span id="LC7" class="line" lang="plaintext"><p>bbb</p></span></code></pre> +<span id="LC4" class="line" lang="plaintext">bbb</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3311:1-3314:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>aaa</p></span> +<span id="LC2" class="line" lang="plaintext"><p>bbb</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="3317:1-3317:27" dir="auto">Leading spaces are skipped:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3319:1-3322:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> aaa</span> +<span id="LC2" class="line" lang="plaintext"> bbb</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2935:1-2935:27" dir="auto">Leading spaces are skipped:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2937:1-2943:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> aaa</span> -<span id="LC2" class="line" lang="plaintext"> bbb</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>aaa</span> -<span id="LC5" class="line" lang="plaintext">bbb</p></span></code></pre> +<pre data-sourcepos="3324:1-3327:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>aaa</span> +<span id="LC2" class="line" lang="plaintext">bbb</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2946:1-2947:40" dir="auto">Lines after the first may be indented any amount, since indented +<p data-sourcepos="3330:1-3331:40" dir="auto">Lines after the first may be indented any amount, since indented code blocks cannot interrupt paragraphs.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2949:1-2957:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span> +<pre data-sourcepos="3333:1-3337:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span> <span id="LC2" class="line" lang="plaintext"> bbb</span> -<span id="LC3" class="line" lang="plaintext"> ccc</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>aaa</span> -<span id="LC6" class="line" lang="plaintext">bbb</span> -<span id="LC7" class="line" lang="plaintext">ccc</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> ccc</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2960:1-2961:44" dir="auto">However, the first line may be indented at most three spaces, -or an indented code block will be triggered:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2963:1-2969:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> aaa</span> +<pre data-sourcepos="3339:1-3343:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>aaa</span> <span id="LC2" class="line" lang="plaintext">bbb</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>aaa</span> -<span id="LC5" class="line" lang="plaintext">bbb</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">ccc</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="3346:1-3347:44" dir="auto">However, the first line may be indented at most three spaces, +or an indented code block will be triggered:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3349:1-3352:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> aaa</span> +<span id="LC2" class="line" lang="plaintext">bbb</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2972:1-2979:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> aaa</span> -<span id="LC2" class="line" lang="plaintext">bbb</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><pre><code>aaa</span> -<span id="LC5" class="line" lang="plaintext"></code></pre></span> -<span id="LC6" class="line" lang="plaintext"><p>bbb</p></span></code></pre> +<pre data-sourcepos="3354:1-3357:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>aaa</span> +<span id="LC2" class="line" lang="plaintext">bbb</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3360:1-3363:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> aaa</span> +<span id="LC2" class="line" lang="plaintext">bbb</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3365:1-3369:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>aaa</span> +<span id="LC2" class="line" lang="plaintext"></code></pre></span> +<span id="LC3" class="line" lang="plaintext"><p>bbb</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="2982:1-2984:7" dir="auto">Final spaces are stripped before inline parsing, so a paragraph +<p data-sourcepos="3372:1-3374:7" dir="auto">Final spaces are stripped before inline parsing, so a paragraph that ends with two or more spaces will not end with a [hard line break]:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2986:1-2992:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa </span> -<span id="LC2" class="line" lang="plaintext">bbb </span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>aaa<br /></span> -<span id="LC5" class="line" lang="plaintext">bbb</p></span></code></pre> +<pre data-sourcepos="3376:1-3379:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa </span> +<span id="LC2" class="line" lang="plaintext">bbb </span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3381:1-3384:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>aaa<br /></span> +<span id="LC2" class="line" lang="plaintext">bbb</p></span></code></pre> <copy-code></copy-code> </div> -<h2 data-sourcepos="2995:1-2995:14" dir="auto"> +<h2 data-sourcepos="3387:1-3387:14" dir="auto"> <a id="user-content-blank-lines" class="anchor" href="#blank-lines" aria-hidden="true"></a>Blank lines</h2> -<p data-sourcepos="2997:1-2999:22" dir="auto">[Blank lines] between block-level elements are ignored, +<p data-sourcepos="3389:1-3391:22" dir="auto">[Blank lines] between block-level elements are ignored, except for the role they play in determining whether a [list] is [tight] or [loose].</p> -<p data-sourcepos="3001:1-3001:70" dir="auto">Blank lines at the beginning and end of the document are also ignored.</p> +<p data-sourcepos="3393:1-3393:70" dir="auto">Blank lines at the beginning and end of the document are also ignored.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3003:1-3015:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> </span> +<pre data-sourcepos="3395:1-3404:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> </span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext">aaa</span> <span id="LC4" class="line" lang="plaintext"> </span> <span id="LC5" class="line" lang="plaintext"></span> <span id="LC6" class="line" lang="plaintext"># aaa</span> <span id="LC7" class="line" lang="plaintext"></span> -<span id="LC8" class="line" lang="plaintext"> </span> -<span id="LC9" class="line" lang="plaintext">.</span> -<span id="LC10" class="line" lang="plaintext"><p>aaa</p></span> -<span id="LC11" class="line" lang="plaintext"><h1>aaa</h1></span></code></pre> +<span id="LC8" class="line" lang="plaintext"> </span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3406:1-3409:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>aaa</p></span> +<span id="LC2" class="line" lang="plaintext"><h1>aaa</h1></span></code></pre> <copy-code></copy-code> </div> <div> -<h2 data-sourcepos="3019:1-3019:21"> +<h2 data-sourcepos="3413:1-3413:21"> <a id="user-content-tables-extension" class="anchor" href="#tables-extension" aria-hidden="true"></a>Tables (extension)</h2> -<p data-sourcepos="3021:1-3022:10">GFM enables the <code>table</code> extension, where an additional leaf block type is +<p data-sourcepos="3415:1-3416:10">GFM enables the <code>table</code> extension, where an additional leaf block type is available.</p> -<p data-sourcepos="3024:1-3026:23">A <a href="@">table</a> is an arrangement of data with rows and columns, consisting of a +<p data-sourcepos="3418:1-3420:23">A <a href="@">table</a> is an arrangement of data with rows and columns, consisting of a single header row, a [delimiter row] separating the header from the data, and zero or more data rows.</p> -<p data-sourcepos="3028:1-3032:23">Each row consists of cells containing arbitrary text, in which [inlines] are +<p data-sourcepos="3422:1-3426:23">Each row consists of cells containing arbitrary text, in which [inlines] are parsed, separated by pipes (<code>|</code>). A leading and trailing pipe is also recommended for clarity of reading, and if there's otherwise parsing ambiguity. Spaces between pipes and cell content are trimmed. Block-level elements cannot be inserted in a table.</p> -<p data-sourcepos="3034:1-3036:40">The <a href="@">delimiter row</a> consists of cells whose only content are hyphens (<code>-</code>), +<p data-sourcepos="3428:1-3430:40">The <a href="@">delimiter row</a> consists of cells whose only content are hyphens (<code>-</code>), and optionally, a leading or trailing colon (<code>:</code>), or both, to indicate left, right, or center alignment respectively.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3038:1-3057:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| foo | bar |</span> +<pre data-sourcepos="3432:1-3436:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| foo | bar |</span> <span id="LC2" class="line" lang="plaintext">| --- | --- |</span> -<span id="LC3" class="line" lang="plaintext">| baz | bim |</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><table></span> -<span id="LC6" class="line" lang="plaintext"><thead></span> -<span id="LC7" class="line" lang="plaintext"><tr></span> -<span id="LC8" class="line" lang="plaintext"><th>foo</th></span> -<span id="LC9" class="line" lang="plaintext"><th>bar</th></span> -<span id="LC10" class="line" lang="plaintext"></tr></span> -<span id="LC11" class="line" lang="plaintext"></thead></span> -<span id="LC12" class="line" lang="plaintext"><tbody></span> -<span id="LC13" class="line" lang="plaintext"><tr></span> -<span id="LC14" class="line" lang="plaintext"><td>baz</td></span> -<span id="LC15" class="line" lang="plaintext"><td>bim</td></span> -<span id="LC16" class="line" lang="plaintext"></tr></span> -<span id="LC17" class="line" lang="plaintext"></tbody></span> -<span id="LC18" class="line" lang="plaintext"></table></span></code></pre> +<span id="LC3" class="line" lang="plaintext">| baz | bim |</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3059:1-3060:74">Cells in one column don't need to match length, though it's easier to read if +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3438:1-3453:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span> +<span id="LC2" class="line" lang="plaintext"><thead></span> +<span id="LC3" class="line" lang="plaintext"><tr></span> +<span id="LC4" class="line" lang="plaintext"><th>foo</th></span> +<span id="LC5" class="line" lang="plaintext"><th>bar</th></span> +<span id="LC6" class="line" lang="plaintext"></tr></span> +<span id="LC7" class="line" lang="plaintext"></thead></span> +<span id="LC8" class="line" lang="plaintext"><tbody></span> +<span id="LC9" class="line" lang="plaintext"><tr></span> +<span id="LC10" class="line" lang="plaintext"><td>baz</td></span> +<span id="LC11" class="line" lang="plaintext"><td>bim</td></span> +<span id="LC12" class="line" lang="plaintext"></tr></span> +<span id="LC13" class="line" lang="plaintext"></tbody></span> +<span id="LC14" class="line" lang="plaintext"></table></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="3455:1-3456:74">Cells in one column don't need to match length, though it's easier to read if they are. Likewise, use of leading and trailing pipes may be inconsistent:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3062:1-3081:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| abc | defghi |</span> +<pre data-sourcepos="3458:1-3462:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| abc | defghi |</span> <span id="LC2" class="line" lang="plaintext">:-: | -----------:</span> -<span id="LC3" class="line" lang="plaintext">bar | baz</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><table></span> -<span id="LC6" class="line" lang="plaintext"><thead></span> -<span id="LC7" class="line" lang="plaintext"><tr></span> -<span id="LC8" class="line" lang="plaintext"><th align="center">abc</th></span> -<span id="LC9" class="line" lang="plaintext"><th align="right">defghi</th></span> -<span id="LC10" class="line" lang="plaintext"></tr></span> -<span id="LC11" class="line" lang="plaintext"></thead></span> -<span id="LC12" class="line" lang="plaintext"><tbody></span> -<span id="LC13" class="line" lang="plaintext"><tr></span> -<span id="LC14" class="line" lang="plaintext"><td align="center">bar</td></span> -<span id="LC15" class="line" lang="plaintext"><td align="right">baz</td></span> -<span id="LC16" class="line" lang="plaintext"></tr></span> -<span id="LC17" class="line" lang="plaintext"></tbody></span> -<span id="LC18" class="line" lang="plaintext"></table></span></code></pre> +<span id="LC3" class="line" lang="plaintext">bar | baz</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3083:1-3084:13">Include a pipe in a cell's content by escaping it, including inside other +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3464:1-3479:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span> +<span id="LC2" class="line" lang="plaintext"><thead></span> +<span id="LC3" class="line" lang="plaintext"><tr></span> +<span id="LC4" class="line" lang="plaintext"><th align="center">abc</th></span> +<span id="LC5" class="line" lang="plaintext"><th align="right">defghi</th></span> +<span id="LC6" class="line" lang="plaintext"></tr></span> +<span id="LC7" class="line" lang="plaintext"></thead></span> +<span id="LC8" class="line" lang="plaintext"><tbody></span> +<span id="LC9" class="line" lang="plaintext"><tr></span> +<span id="LC10" class="line" lang="plaintext"><td align="center">bar</td></span> +<span id="LC11" class="line" lang="plaintext"><td align="right">baz</td></span> +<span id="LC12" class="line" lang="plaintext"></tr></span> +<span id="LC13" class="line" lang="plaintext"></tbody></span> +<span id="LC14" class="line" lang="plaintext"></table></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="3481:1-3482:13">Include a pipe in a cell's content by escaping it, including inside other inline spans:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3086:1-3107:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| f\|oo |</span> +<pre data-sourcepos="3484:1-3489:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| f\|oo |</span> <span id="LC2" class="line" lang="plaintext">| ------ |</span> <span id="LC3" class="line" lang="plaintext">| b `\|` az |</span> -<span id="LC4" class="line" lang="plaintext">| b **\|** im |</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><table></span> -<span id="LC7" class="line" lang="plaintext"><thead></span> +<span id="LC4" class="line" lang="plaintext">| b **\|** im |</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3491:1-3507:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span> +<span id="LC2" class="line" lang="plaintext"><thead></span> +<span id="LC3" class="line" lang="plaintext"><tr></span> +<span id="LC4" class="line" lang="plaintext"><th>f|oo</th></span> +<span id="LC5" class="line" lang="plaintext"></tr></span> +<span id="LC6" class="line" lang="plaintext"></thead></span> +<span id="LC7" class="line" lang="plaintext"><tbody></span> <span id="LC8" class="line" lang="plaintext"><tr></span> -<span id="LC9" class="line" lang="plaintext"><th>f|oo</th></span> +<span id="LC9" class="line" lang="plaintext"><td>b <code>|</code> az</td></span> <span id="LC10" class="line" lang="plaintext"></tr></span> -<span id="LC11" class="line" lang="plaintext"></thead></span> -<span id="LC12" class="line" lang="plaintext"><tbody></span> -<span id="LC13" class="line" lang="plaintext"><tr></span> -<span id="LC14" class="line" lang="plaintext"><td>b <code>|</code> az</td></span> -<span id="LC15" class="line" lang="plaintext"></tr></span> -<span id="LC16" class="line" lang="plaintext"><tr></span> -<span id="LC17" class="line" lang="plaintext"><td>b <strong>|</strong> im</td></span> -<span id="LC18" class="line" lang="plaintext"></tr></span> -<span id="LC19" class="line" lang="plaintext"></tbody></span> -<span id="LC20" class="line" lang="plaintext"></table></span></code></pre> +<span id="LC11" class="line" lang="plaintext"><tr></span> +<span id="LC12" class="line" lang="plaintext"><td>b <strong>|</strong> im</td></span> +<span id="LC13" class="line" lang="plaintext"></tr></span> +<span id="LC14" class="line" lang="plaintext"></tbody></span> +<span id="LC15" class="line" lang="plaintext"></table></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3109:1-3110:22">The table is broken at the first empty line, or beginning of another +<p data-sourcepos="3509:1-3510:22">The table is broken at the first empty line, or beginning of another block-level structure:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3112:1-3135:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| abc | def |</span> +<pre data-sourcepos="3512:1-3517:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| abc | def |</span> <span id="LC2" class="line" lang="plaintext">| --- | --- |</span> <span id="LC3" class="line" lang="plaintext">| bar | baz |</span> -<span id="LC4" class="line" lang="plaintext">> bar</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><table></span> -<span id="LC7" class="line" lang="plaintext"><thead></span> -<span id="LC8" class="line" lang="plaintext"><tr></span> -<span id="LC9" class="line" lang="plaintext"><th>abc</th></span> -<span id="LC10" class="line" lang="plaintext"><th>def</th></span> -<span id="LC11" class="line" lang="plaintext"></tr></span> -<span id="LC12" class="line" lang="plaintext"></thead></span> -<span id="LC13" class="line" lang="plaintext"><tbody></span> -<span id="LC14" class="line" lang="plaintext"><tr></span> -<span id="LC15" class="line" lang="plaintext"><td>bar</td></span> -<span id="LC16" class="line" lang="plaintext"><td>baz</td></span> -<span id="LC17" class="line" lang="plaintext"></tr></span> -<span id="LC18" class="line" lang="plaintext"></tbody></span> -<span id="LC19" class="line" lang="plaintext"></table></span> -<span id="LC20" class="line" lang="plaintext"><blockquote></span> -<span id="LC21" class="line" lang="plaintext"><p>bar</p></span> -<span id="LC22" class="line" lang="plaintext"></blockquote></span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3137:1-3164:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| abc | def |</span> +<span id="LC4" class="line" lang="plaintext">> bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3519:1-3537:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span> +<span id="LC2" class="line" lang="plaintext"><thead></span> +<span id="LC3" class="line" lang="plaintext"><tr></span> +<span id="LC4" class="line" lang="plaintext"><th>abc</th></span> +<span id="LC5" class="line" lang="plaintext"><th>def</th></span> +<span id="LC6" class="line" lang="plaintext"></tr></span> +<span id="LC7" class="line" lang="plaintext"></thead></span> +<span id="LC8" class="line" lang="plaintext"><tbody></span> +<span id="LC9" class="line" lang="plaintext"><tr></span> +<span id="LC10" class="line" lang="plaintext"><td>bar</td></span> +<span id="LC11" class="line" lang="plaintext"><td>baz</td></span> +<span id="LC12" class="line" lang="plaintext"></tr></span> +<span id="LC13" class="line" lang="plaintext"></tbody></span> +<span id="LC14" class="line" lang="plaintext"></table></span> +<span id="LC15" class="line" lang="plaintext"><blockquote></span> +<span id="LC16" class="line" lang="plaintext"><p>bar</p></span> +<span id="LC17" class="line" lang="plaintext"></blockquote></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3539:1-3546:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| abc | def |</span> <span id="LC2" class="line" lang="plaintext">| --- | --- |</span> <span id="LC3" class="line" lang="plaintext">| bar | baz |</span> <span id="LC4" class="line" lang="plaintext">bar</span> <span id="LC5" class="line" lang="plaintext"></span> -<span id="LC6" class="line" lang="plaintext">bar</span> -<span id="LC7" class="line" lang="plaintext">.</span> -<span id="LC8" class="line" lang="plaintext"><table></span> -<span id="LC9" class="line" lang="plaintext"><thead></span> -<span id="LC10" class="line" lang="plaintext"><tr></span> -<span id="LC11" class="line" lang="plaintext"><th>abc</th></span> -<span id="LC12" class="line" lang="plaintext"><th>def</th></span> -<span id="LC13" class="line" lang="plaintext"></tr></span> -<span id="LC14" class="line" lang="plaintext"></thead></span> -<span id="LC15" class="line" lang="plaintext"><tbody></span> -<span id="LC16" class="line" lang="plaintext"><tr></span> -<span id="LC17" class="line" lang="plaintext"><td>bar</td></span> -<span id="LC18" class="line" lang="plaintext"><td>baz</td></span> -<span id="LC19" class="line" lang="plaintext"></tr></span> -<span id="LC20" class="line" lang="plaintext"><tr></span> -<span id="LC21" class="line" lang="plaintext"><td>bar</td></span> -<span id="LC22" class="line" lang="plaintext"><td></td></span> -<span id="LC23" class="line" lang="plaintext"></tr></span> -<span id="LC24" class="line" lang="plaintext"></tbody></span> -<span id="LC25" class="line" lang="plaintext"></table></span> -<span id="LC26" class="line" lang="plaintext"><p>bar</p></span></code></pre> -<copy-code></copy-code> -</div> -<p data-sourcepos="3166:1-3167:31">The header row must match the [delimiter row] in the number of cells. If not, +<span id="LC6" class="line" lang="plaintext">bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3548:1-3568:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span> +<span id="LC2" class="line" lang="plaintext"><thead></span> +<span id="LC3" class="line" lang="plaintext"><tr></span> +<span id="LC4" class="line" lang="plaintext"><th>abc</th></span> +<span id="LC5" class="line" lang="plaintext"><th>def</th></span> +<span id="LC6" class="line" lang="plaintext"></tr></span> +<span id="LC7" class="line" lang="plaintext"></thead></span> +<span id="LC8" class="line" lang="plaintext"><tbody></span> +<span id="LC9" class="line" lang="plaintext"><tr></span> +<span id="LC10" class="line" lang="plaintext"><td>bar</td></span> +<span id="LC11" class="line" lang="plaintext"><td>baz</td></span> +<span id="LC12" class="line" lang="plaintext"></tr></span> +<span id="LC13" class="line" lang="plaintext"><tr></span> +<span id="LC14" class="line" lang="plaintext"><td>bar</td></span> +<span id="LC15" class="line" lang="plaintext"><td></td></span> +<span id="LC16" class="line" lang="plaintext"></tr></span> +<span id="LC17" class="line" lang="plaintext"></tbody></span> +<span id="LC18" class="line" lang="plaintext"></table></span> +<span id="LC19" class="line" lang="plaintext"><p>bar</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="3570:1-3571:31">The header row must match the [delimiter row] in the number of cells. If not, a table will not be recognized:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3169:1-3177:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| abc | def |</span> +<pre data-sourcepos="3573:1-3577:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| abc | def |</span> <span id="LC2" class="line" lang="plaintext">| --- |</span> -<span id="LC3" class="line" lang="plaintext">| bar |</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>| abc | def |</span> -<span id="LC6" class="line" lang="plaintext">| --- |</span> -<span id="LC7" class="line" lang="plaintext">| bar |</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">| bar |</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3179:1-3181:65">The remainder of the table's rows may vary in the number of cells. If there +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3579:1-3583:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>| abc | def |</span> +<span id="LC2" class="line" lang="plaintext">| --- |</span> +<span id="LC3" class="line" lang="plaintext">| bar |</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="3585:1-3587:65">The remainder of the table's rows may vary in the number of cells. If there are a number of cells fewer than the number of cells in the header row, empty cells are inserted. If there are greater, the excess is ignored:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3183:1-3207:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| abc | def |</span> +<pre data-sourcepos="3589:1-3594:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| abc | def |</span> <span id="LC2" class="line" lang="plaintext">| --- | --- |</span> <span id="LC3" class="line" lang="plaintext">| bar |</span> -<span id="LC4" class="line" lang="plaintext">| bar | baz | boo |</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><table></span> -<span id="LC7" class="line" lang="plaintext"><thead></span> -<span id="LC8" class="line" lang="plaintext"><tr></span> -<span id="LC9" class="line" lang="plaintext"><th>abc</th></span> -<span id="LC10" class="line" lang="plaintext"><th>def</th></span> -<span id="LC11" class="line" lang="plaintext"></tr></span> -<span id="LC12" class="line" lang="plaintext"></thead></span> -<span id="LC13" class="line" lang="plaintext"><tbody></span> -<span id="LC14" class="line" lang="plaintext"><tr></span> -<span id="LC15" class="line" lang="plaintext"><td>bar</td></span> -<span id="LC16" class="line" lang="plaintext"><td></td></span> -<span id="LC17" class="line" lang="plaintext"></tr></span> -<span id="LC18" class="line" lang="plaintext"><tr></span> -<span id="LC19" class="line" lang="plaintext"><td>bar</td></span> -<span id="LC20" class="line" lang="plaintext"><td>baz</td></span> -<span id="LC21" class="line" lang="plaintext"></tr></span> -<span id="LC22" class="line" lang="plaintext"></tbody></span> -<span id="LC23" class="line" lang="plaintext"></table></span></code></pre> -<copy-code></copy-code> -</div> -<p data-sourcepos="3209:1-3209:75">If there are no rows in the body, no <code><tbody></code> is generated in HTML output:</p> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3211:1-3223:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| abc | def |</span> -<span id="LC2" class="line" lang="plaintext">| --- | --- |</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><table></span> -<span id="LC5" class="line" lang="plaintext"><thead></span> -<span id="LC6" class="line" lang="plaintext"><tr></span> -<span id="LC7" class="line" lang="plaintext"><th>abc</th></span> -<span id="LC8" class="line" lang="plaintext"><th>def</th></span> -<span id="LC9" class="line" lang="plaintext"></tr></span> -<span id="LC10" class="line" lang="plaintext"></thead></span> -<span id="LC11" class="line" lang="plaintext"></table></span></code></pre> +<span id="LC4" class="line" lang="plaintext">| bar | baz | boo |</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3596:1-3615:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span> +<span id="LC2" class="line" lang="plaintext"><thead></span> +<span id="LC3" class="line" lang="plaintext"><tr></span> +<span id="LC4" class="line" lang="plaintext"><th>abc</th></span> +<span id="LC5" class="line" lang="plaintext"><th>def</th></span> +<span id="LC6" class="line" lang="plaintext"></tr></span> +<span id="LC7" class="line" lang="plaintext"></thead></span> +<span id="LC8" class="line" lang="plaintext"><tbody></span> +<span id="LC9" class="line" lang="plaintext"><tr></span> +<span id="LC10" class="line" lang="plaintext"><td>bar</td></span> +<span id="LC11" class="line" lang="plaintext"><td></td></span> +<span id="LC12" class="line" lang="plaintext"></tr></span> +<span id="LC13" class="line" lang="plaintext"><tr></span> +<span id="LC14" class="line" lang="plaintext"><td>bar</td></span> +<span id="LC15" class="line" lang="plaintext"><td>baz</td></span> +<span id="LC16" class="line" lang="plaintext"></tr></span> +<span id="LC17" class="line" lang="plaintext"></tbody></span> +<span id="LC18" class="line" lang="plaintext"></table></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="3617:1-3617:75">If there are no rows in the body, no <code><tbody></code> is generated in HTML output:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3619:1-3622:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| abc | def |</span> +<span id="LC2" class="line" lang="plaintext">| --- | --- |</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3624:1-3633:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><table></span> +<span id="LC2" class="line" lang="plaintext"><thead></span> +<span id="LC3" class="line" lang="plaintext"><tr></span> +<span id="LC4" class="line" lang="plaintext"><th>abc</th></span> +<span id="LC5" class="line" lang="plaintext"><th>def</th></span> +<span id="LC6" class="line" lang="plaintext"></tr></span> +<span id="LC7" class="line" lang="plaintext"></thead></span> +<span id="LC8" class="line" lang="plaintext"></table></span></code></pre> <copy-code></copy-code> </div> </div> -<h1 data-sourcepos="3227:1-3227:18" dir="auto"> +<h1 data-sourcepos="3637:1-3637:18" dir="auto"> <a id="user-content-container-blocks" class="anchor" href="#container-blocks" aria-hidden="true"></a>Container blocks</h1> -<p data-sourcepos="3229:1-3232:45" dir="auto">A <a href="#container-blocks">container block</a> is a block that has other +<p data-sourcepos="3639:1-3642:45" dir="auto">A <a href="#container-blocks">container block</a> is a block that has other blocks as its contents. There are two basic kinds of container blocks: [block quotes] and [list items]. [Lists] are meta-containers for [list items].</p> -<p data-sourcepos="3234:1-3235:26" dir="auto">We define the syntax for container blocks recursively. The general +<p data-sourcepos="3644:1-3645:26" dir="auto">We define the syntax for container blocks recursively. The general form of the definition is:</p> -<blockquote data-sourcepos="3237:1-3239:35" dir="auto"> -<p data-sourcepos="3237:3-3239:35">If X is a sequence of blocks, then the result of +<blockquote data-sourcepos="3647:1-3649:35" dir="auto"> +<p data-sourcepos="3647:3-3649:35">If X is a sequence of blocks, then the result of transforming X in such-and-such a way is a container of type Y with these blocks as its content.</p> </blockquote> -<p data-sourcepos="3241:1-3245:52" dir="auto">So, we explain what counts as a block quote or list item by explaining +<p data-sourcepos="3651:1-3655:52" dir="auto">So, we explain what counts as a block quote or list item by explaining how these can be <em>generated</em> from their contents. This should suffice to define the syntax, although it does not give a recipe for <em>parsing</em> these constructions. (A recipe is provided below in the section entitled <a href="#appendix-a-parsing-strategy">A parsing strategy</a>.)</p> -<h2 data-sourcepos="3247:1-3247:15" dir="auto"> +<h2 data-sourcepos="3657:1-3657:15" dir="auto"> <a id="user-content-block-quotes" class="anchor" href="#block-quotes" aria-hidden="true"></a>Block quotes</h2> -<p data-sourcepos="3249:1-3251:78" dir="auto">A <a href="@">block quote marker</a> +<p data-sourcepos="3659:1-3661:78" dir="auto">A <a href="@">block quote marker</a> consists of 0-3 spaces of initial indent, plus (a) the character <code>></code> together with a following space, or (b) a single character <code>></code> not followed by a space.</p> -<p data-sourcepos="3253:1-3253:42" dir="auto">The following rules define [block quotes]:</p> -<ol data-sourcepos="3255:1-3272:0" dir="auto"> -<li data-sourcepos="3255:1-3259:0"> -<p data-sourcepos="3255:5-3258:54"><strong>Basic case.</strong> If a string of lines <em>Ls</em> constitute a sequence +<p data-sourcepos="3663:1-3663:42" dir="auto">The following rules define [block quotes]:</p> +<ol data-sourcepos="3665:1-3682:0" dir="auto"> +<li data-sourcepos="3665:1-3669:0"> +<p data-sourcepos="3665:5-3668:54"><strong>Basic case.</strong> If a string of lines <em>Ls</em> constitute a sequence of blocks <em>Bs</em>, then the result of prepending a [block quote marker] to the beginning of each line in <em>Ls</em> is a <a href="#block-quotes">block quote</a> containing <em>Bs</em>.</p> </li> -<li data-sourcepos="3260:1-3269:0"> -<p data-sourcepos="3260:5-3268:48"><strong>Laziness.</strong> If a string of lines <em>Ls</em> constitute a <a href="#block-quotes">block +<li data-sourcepos="3670:1-3679:0"> +<p data-sourcepos="3670:5-3678:48"><strong>Laziness.</strong> If a string of lines <em>Ls</em> constitute a <a href="#block-quotes">block quote</a> with contents <em>Bs</em>, then the result of deleting the initial [block quote marker] from one or more lines in which the next [non-whitespace character] after the [block @@ -2884,375 +3296,425 @@ text] is a block quote with <em>Bs</em> as its content. that will be parsed as part of the content of a paragraph, but does not occur at the beginning of the paragraph.</p> </li> -<li data-sourcepos="3270:1-3272:0"> -<p data-sourcepos="3270:5-3271:65"><strong>Consecutiveness.</strong> A document cannot contain two [block +<li data-sourcepos="3680:1-3682:0"> +<p data-sourcepos="3680:5-3681:65"><strong>Consecutiveness.</strong> A document cannot contain two [block quotes] in a row unless there is a [blank line] between them.</p> </li> </ol> -<p data-sourcepos="3273:1-3273:54" dir="auto">Nothing else counts as a <a href="#block-quotes">block quote</a>.</p> -<p data-sourcepos="3275:1-3275:25" dir="auto">Here is a simple example:</p> +<p data-sourcepos="3683:1-3683:54" dir="auto">Nothing else counts as a <a href="#block-quotes">block quote</a>.</p> +<p data-sourcepos="3685:1-3685:25" dir="auto">Here is a simple example:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3277:1-3287:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> # Foo</span> +<pre data-sourcepos="3687:1-3691:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> # Foo</span> <span id="LC2" class="line" lang="plaintext">> bar</span> -<span id="LC3" class="line" lang="plaintext">> baz</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><blockquote></span> -<span id="LC6" class="line" lang="plaintext"><h1>Foo</h1></span> -<span id="LC7" class="line" lang="plaintext"><p>bar</span> -<span id="LC8" class="line" lang="plaintext">baz</p></span> -<span id="LC9" class="line" lang="plaintext"></blockquote></span></code></pre> +<span id="LC3" class="line" lang="plaintext">> baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3693:1-3699:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><h1>Foo</h1></span> +<span id="LC3" class="line" lang="plaintext"><p>bar</span> +<span id="LC4" class="line" lang="plaintext">baz</p></span> +<span id="LC5" class="line" lang="plaintext"></blockquote></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3290:1-3290:51" dir="auto">The spaces after the <code>></code> characters can be omitted:</p> +<p data-sourcepos="3702:1-3702:51" dir="auto">The spaces after the <code>></code> characters can be omitted:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3292:1-3302:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">># Foo</span> +<pre data-sourcepos="3704:1-3708:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">># Foo</span> <span id="LC2" class="line" lang="plaintext">>bar</span> -<span id="LC3" class="line" lang="plaintext">> baz</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><blockquote></span> -<span id="LC6" class="line" lang="plaintext"><h1>Foo</h1></span> -<span id="LC7" class="line" lang="plaintext"><p>bar</span> -<span id="LC8" class="line" lang="plaintext">baz</p></span> -<span id="LC9" class="line" lang="plaintext"></blockquote></span></code></pre> +<span id="LC3" class="line" lang="plaintext">> baz</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3305:1-3305:46" dir="auto">The <code>></code> characters can be indented 1-3 spaces:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3307:1-3317:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> > # Foo</span> +<pre data-sourcepos="3710:1-3716:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><h1>Foo</h1></span> +<span id="LC3" class="line" lang="plaintext"><p>bar</span> +<span id="LC4" class="line" lang="plaintext">baz</p></span> +<span id="LC5" class="line" lang="plaintext"></blockquote></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="3719:1-3719:46" dir="auto">The <code>></code> characters can be indented 1-3 spaces:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3721:1-3725:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> > # Foo</span> <span id="LC2" class="line" lang="plaintext"> > bar</span> -<span id="LC3" class="line" lang="plaintext"> > baz</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><blockquote></span> -<span id="LC6" class="line" lang="plaintext"><h1>Foo</h1></span> -<span id="LC7" class="line" lang="plaintext"><p>bar</span> -<span id="LC8" class="line" lang="plaintext">baz</p></span> -<span id="LC9" class="line" lang="plaintext"></blockquote></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> > baz</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3320:1-3320:34" dir="auto">Four spaces gives us a code block:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3322:1-3331:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> > # Foo</span> +<pre data-sourcepos="3727:1-3733:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><h1>Foo</h1></span> +<span id="LC3" class="line" lang="plaintext"><p>bar</span> +<span id="LC4" class="line" lang="plaintext">baz</p></span> +<span id="LC5" class="line" lang="plaintext"></blockquote></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="3736:1-3736:34" dir="auto">Four spaces gives us a code block:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3738:1-3742:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> > # Foo</span> <span id="LC2" class="line" lang="plaintext"> > bar</span> -<span id="LC3" class="line" lang="plaintext"> > baz</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><pre><code>&gt; # Foo</span> -<span id="LC6" class="line" lang="plaintext">&gt; bar</span> -<span id="LC7" class="line" lang="plaintext">&gt; baz</span> -<span id="LC8" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> > baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3744:1-3749:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>&gt; # Foo</span> +<span id="LC2" class="line" lang="plaintext">&gt; bar</span> +<span id="LC3" class="line" lang="plaintext">&gt; baz</span> +<span id="LC4" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3334:1-3335:30" dir="auto">The Laziness clause allows us to omit the <code>></code> before +<p data-sourcepos="3752:1-3753:30" dir="auto">The Laziness clause allows us to omit the <code>></code> before [paragraph continuation text]:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3337:1-3347:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> # Foo</span> +<pre data-sourcepos="3755:1-3759:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> # Foo</span> <span id="LC2" class="line" lang="plaintext">> bar</span> -<span id="LC3" class="line" lang="plaintext">baz</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><blockquote></span> -<span id="LC6" class="line" lang="plaintext"><h1>Foo</h1></span> -<span id="LC7" class="line" lang="plaintext"><p>bar</span> -<span id="LC8" class="line" lang="plaintext">baz</p></span> -<span id="LC9" class="line" lang="plaintext"></blockquote></span></code></pre> +<span id="LC3" class="line" lang="plaintext">baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3761:1-3767:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><h1>Foo</h1></span> +<span id="LC3" class="line" lang="plaintext"><p>bar</span> +<span id="LC4" class="line" lang="plaintext">baz</p></span> +<span id="LC5" class="line" lang="plaintext"></blockquote></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3350:1-3351:19" dir="auto">A block quote can contain some lazy and some non-lazy +<p data-sourcepos="3770:1-3771:19" dir="auto">A block quote can contain some lazy and some non-lazy continuation lines:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3353:1-3363:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> bar</span> +<pre data-sourcepos="3773:1-3777:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> bar</span> <span id="LC2" class="line" lang="plaintext">baz</span> -<span id="LC3" class="line" lang="plaintext">> foo</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><blockquote></span> -<span id="LC6" class="line" lang="plaintext"><p>bar</span> -<span id="LC7" class="line" lang="plaintext">baz</span> -<span id="LC8" class="line" lang="plaintext">foo</p></span> -<span id="LC9" class="line" lang="plaintext"></blockquote></span></code></pre> +<span id="LC3" class="line" lang="plaintext">> foo</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3779:1-3785:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><p>bar</span> +<span id="LC3" class="line" lang="plaintext">baz</span> +<span id="LC4" class="line" lang="plaintext">foo</p></span> +<span id="LC5" class="line" lang="plaintext"></blockquote></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3366:1-3368:61" dir="auto">Laziness only applies to lines that would have been continuations of +<p data-sourcepos="3788:1-3790:61" dir="auto">Laziness only applies to lines that would have been continuations of paragraphs had they been prepended with [block quote markers]. For example, the <code>> </code> cannot be omitted in the second line of</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3370:1-3373:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="gt">> foo</span></span> +<pre data-sourcepos="3792:1-3795:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="gt">> foo</span></span> <span id="LC2" class="line" lang="markdown"><span class="gt">> ---</span></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3375:1-3375:29" dir="auto">without changing the meaning:</p> +<p data-sourcepos="3797:1-3797:29" dir="auto">without changing the meaning:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3377:1-3385:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span> -<span id="LC2" class="line" lang="plaintext">---</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><blockquote></span> -<span id="LC5" class="line" lang="plaintext"><p>foo</p></span> -<span id="LC6" class="line" lang="plaintext"></blockquote></span> -<span id="LC7" class="line" lang="plaintext"><hr /></span></code></pre> +<pre data-sourcepos="3799:1-3802:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span> +<span id="LC2" class="line" lang="plaintext">---</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3388:1-3388:52" dir="auto">Similarly, if we omit the <code>> </code> in the second line of</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3390:1-3393:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="gt">> - foo</span></span> +<pre data-sourcepos="3804:1-3809:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><p>foo</p></span> +<span id="LC3" class="line" lang="plaintext"></blockquote></span> +<span id="LC4" class="line" lang="plaintext"><hr /></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="3812:1-3812:52" dir="auto">Similarly, if we omit the <code>> </code> in the second line of</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3814:1-3817:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="gt">> - foo</span></span> <span id="LC2" class="line" lang="markdown"><span class="gt">> - bar</span></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3395:1-3395:47" dir="auto">then the block quote ends after the first line:</p> +<p data-sourcepos="3819:1-3819:47" dir="auto">then the block quote ends after the first line:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3397:1-3409:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> - foo</span> -<span id="LC2" class="line" lang="plaintext">- bar</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><blockquote></span> -<span id="LC5" class="line" lang="plaintext"><ul></span> -<span id="LC6" class="line" lang="plaintext"><li>foo</li></span> -<span id="LC7" class="line" lang="plaintext"></ul></span> -<span id="LC8" class="line" lang="plaintext"></blockquote></span> -<span id="LC9" class="line" lang="plaintext"><ul></span> -<span id="LC10" class="line" lang="plaintext"><li>bar</li></span> -<span id="LC11" class="line" lang="plaintext"></ul></span></code></pre> +<pre data-sourcepos="3821:1-3824:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> - foo</span> +<span id="LC2" class="line" lang="plaintext">- bar</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3412:1-3413:53" dir="auto">For the same reason, we can't omit the <code>> </code> in front of +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3826:1-3835:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><ul></span> +<span id="LC3" class="line" lang="plaintext"><li>foo</li></span> +<span id="LC4" class="line" lang="plaintext"></ul></span> +<span id="LC5" class="line" lang="plaintext"></blockquote></span> +<span id="LC6" class="line" lang="plaintext"><ul></span> +<span id="LC7" class="line" lang="plaintext"><li>bar</li></span> +<span id="LC8" class="line" lang="plaintext"></ul></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="3838:1-3839:53" dir="auto">For the same reason, we can't omit the <code>> </code> in front of subsequent lines of an indented or fenced code block:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3415:1-3425:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span> -<span id="LC2" class="line" lang="plaintext"> bar</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><blockquote></span> -<span id="LC5" class="line" lang="plaintext"><pre><code>foo</span> -<span id="LC6" class="line" lang="plaintext"></code></pre></span> -<span id="LC7" class="line" lang="plaintext"></blockquote></span> -<span id="LC8" class="line" lang="plaintext"><pre><code>bar</span> -<span id="LC9" class="line" lang="plaintext"></code></pre></span></code></pre> +<pre data-sourcepos="3841:1-3844:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span> +<span id="LC2" class="line" lang="plaintext"> bar</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3428:1-3438:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> ```</span> +<pre data-sourcepos="3846:1-3853:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><pre><code>foo</span> +<span id="LC3" class="line" lang="plaintext"></code></pre></span> +<span id="LC4" class="line" lang="plaintext"></blockquote></span> +<span id="LC5" class="line" lang="plaintext"><pre><code>bar</span> +<span id="LC6" class="line" lang="plaintext"></code></pre></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3856:1-3860:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> ```</span> <span id="LC2" class="line" lang="plaintext">foo</span> -<span id="LC3" class="line" lang="plaintext">```</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><blockquote></span> -<span id="LC6" class="line" lang="plaintext"><pre><code></code></pre></span> -<span id="LC7" class="line" lang="plaintext"></blockquote></span> -<span id="LC8" class="line" lang="plaintext"><p>foo</p></span> -<span id="LC9" class="line" lang="plaintext"><pre><code></code></pre></span></code></pre> +<span id="LC3" class="line" lang="plaintext">```</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3441:1-3442:19" dir="auto">Note that in the following case, we have a [lazy +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3862:1-3868:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><pre><code></code></pre></span> +<span id="LC3" class="line" lang="plaintext"></blockquote></span> +<span id="LC4" class="line" lang="plaintext"><p>foo</p></span> +<span id="LC5" class="line" lang="plaintext"><pre><code></code></pre></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="3871:1-3872:19" dir="auto">Note that in the following case, we have a [lazy continuation line]:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3444:1-3452:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span> -<span id="LC2" class="line" lang="plaintext"> - bar</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><blockquote></span> -<span id="LC5" class="line" lang="plaintext"><p>foo</span> -<span id="LC6" class="line" lang="plaintext">- bar</p></span> -<span id="LC7" class="line" lang="plaintext"></blockquote></span></code></pre> +<pre data-sourcepos="3874:1-3877:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span> +<span id="LC2" class="line" lang="plaintext"> - bar</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3455:1-3455:24" dir="auto">To see why, note that in</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3457:1-3460:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="gt">> foo</span></span> +<pre data-sourcepos="3879:1-3884:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><p>foo</span> +<span id="LC3" class="line" lang="plaintext">- bar</p></span> +<span id="LC4" class="line" lang="plaintext"></blockquote></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="3887:1-3887:24" dir="auto">To see why, note that in</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3889:1-3892:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="gt">> foo</span></span> <span id="LC2" class="line" lang="markdown"><span class="gt">> - bar</span></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3462:1-3464:61" dir="auto">the <code>- bar</code> is indented too far to start a list, and can't +<p data-sourcepos="3894:1-3896:61" dir="auto">the <code>- bar</code> is indented too far to start a list, and can't be an indented code block because indented code blocks cannot interrupt paragraphs, so it is [paragraph continuation text].</p> -<p data-sourcepos="3466:1-3466:27" dir="auto">A block quote can be empty:</p> +<p data-sourcepos="3898:1-3898:27" dir="auto">A block quote can be empty:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3468:1-3473:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><blockquote></span> -<span id="LC4" class="line" lang="plaintext"></blockquote></span></code></pre> +<pre data-sourcepos="3900:1-3902:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3476:1-3483:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">></span> +<pre data-sourcepos="3904:1-3907:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"></blockquote></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3910:1-3914:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">></span> <span id="LC2" class="line" lang="plaintext">> </span> -<span id="LC3" class="line" lang="plaintext">> </span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><blockquote></span> -<span id="LC6" class="line" lang="plaintext"></blockquote></span></code></pre> +<span id="LC3" class="line" lang="plaintext">> </span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3486:1-3486:52" dir="auto">A block quote can have initial or final blank lines:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3488:1-3496:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">></span> +<pre data-sourcepos="3916:1-3919:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"></blockquote></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="3922:1-3922:52" dir="auto">A block quote can have initial or final blank lines:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3924:1-3928:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">></span> <span id="LC2" class="line" lang="plaintext">> foo</span> -<span id="LC3" class="line" lang="plaintext">> </span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><blockquote></span> -<span id="LC6" class="line" lang="plaintext"><p>foo</p></span> -<span id="LC7" class="line" lang="plaintext"></blockquote></span></code></pre> +<span id="LC3" class="line" lang="plaintext">> </span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3930:1-3934:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><p>foo</p></span> +<span id="LC3" class="line" lang="plaintext"></blockquote></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3499:1-3499:43" dir="auto">A blank line always separates block quotes:</p> +<p data-sourcepos="3937:1-3937:43" dir="auto">A blank line always separates block quotes:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3501:1-3512:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span> +<pre data-sourcepos="3939:1-3943:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">> bar</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><blockquote></span> -<span id="LC6" class="line" lang="plaintext"><p>foo</p></span> -<span id="LC7" class="line" lang="plaintext"></blockquote></span> -<span id="LC8" class="line" lang="plaintext"><blockquote></span> -<span id="LC9" class="line" lang="plaintext"><p>bar</p></span> -<span id="LC10" class="line" lang="plaintext"></blockquote></span></code></pre> +<span id="LC3" class="line" lang="plaintext">> bar</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3515:1-3518:44" dir="auto">(Most current Markdown implementations, including John Gruber's +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3945:1-3952:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><p>foo</p></span> +<span id="LC3" class="line" lang="plaintext"></blockquote></span> +<span id="LC4" class="line" lang="plaintext"><blockquote></span> +<span id="LC5" class="line" lang="plaintext"><p>bar</p></span> +<span id="LC6" class="line" lang="plaintext"></blockquote></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="3955:1-3958:44" dir="auto">(Most current Markdown implementations, including John Gruber's original <code>Markdown.pl</code>, will parse this example as a single block quote with two paragraphs. But it seems better to allow the author to decide whether two block quotes or one are wanted.)</p> -<p data-sourcepos="3520:1-3521:28" dir="auto">Consecutiveness means that if we put these block quotes together, +<p data-sourcepos="3960:1-3961:28" dir="auto">Consecutiveness means that if we put these block quotes together, we get a single block quote:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3523:1-3531:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span> -<span id="LC2" class="line" lang="plaintext">> bar</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><blockquote></span> -<span id="LC5" class="line" lang="plaintext"><p>foo</span> -<span id="LC6" class="line" lang="plaintext">bar</p></span> -<span id="LC7" class="line" lang="plaintext"></blockquote></span></code></pre> +<pre data-sourcepos="3963:1-3966:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span> +<span id="LC2" class="line" lang="plaintext">> bar</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3534:1-3534:46" dir="auto">To get a block quote with two paragraphs, use:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3536:1-3545:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span> +<pre data-sourcepos="3968:1-3973:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><p>foo</span> +<span id="LC3" class="line" lang="plaintext">bar</p></span> +<span id="LC4" class="line" lang="plaintext"></blockquote></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="3976:1-3976:46" dir="auto">To get a block quote with two paragraphs, use:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3978:1-3982:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> foo</span> <span id="LC2" class="line" lang="plaintext">></span> -<span id="LC3" class="line" lang="plaintext">> bar</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><blockquote></span> -<span id="LC6" class="line" lang="plaintext"><p>foo</p></span> -<span id="LC7" class="line" lang="plaintext"><p>bar</p></span> -<span id="LC8" class="line" lang="plaintext"></blockquote></span></code></pre> +<span id="LC3" class="line" lang="plaintext">> bar</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3548:1-3548:38" dir="auto">Block quotes can interrupt paragraphs:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3550:1-3558:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span> -<span id="LC2" class="line" lang="plaintext">> bar</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>foo</p></span> -<span id="LC5" class="line" lang="plaintext"><blockquote></span> -<span id="LC6" class="line" lang="plaintext"><p>bar</p></span> -<span id="LC7" class="line" lang="plaintext"></blockquote></span></code></pre> +<pre data-sourcepos="3984:1-3989:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><p>foo</p></span> +<span id="LC3" class="line" lang="plaintext"><p>bar</p></span> +<span id="LC4" class="line" lang="plaintext"></blockquote></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="3992:1-3992:38" dir="auto">Block quotes can interrupt paragraphs:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3994:1-3997:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span> +<span id="LC2" class="line" lang="plaintext">> bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="3999:1-4004:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo</p></span> +<span id="LC2" class="line" lang="plaintext"><blockquote></span> +<span id="LC3" class="line" lang="plaintext"><p>bar</p></span> +<span id="LC4" class="line" lang="plaintext"></blockquote></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3561:1-3562:7" dir="auto">In general, blank lines are not needed before or after block +<p data-sourcepos="4007:1-4008:7" dir="auto">In general, blank lines are not needed before or after block quotes:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3564:1-3576:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> aaa</span> +<pre data-sourcepos="4010:1-4014:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> aaa</span> <span id="LC2" class="line" lang="plaintext">***</span> -<span id="LC3" class="line" lang="plaintext">> bbb</span> -<span id="LC4" class="line" lang="plaintext">.</span> +<span id="LC3" class="line" lang="plaintext">> bbb</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4016:1-4024:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><p>aaa</p></span> +<span id="LC3" class="line" lang="plaintext"></blockquote></span> +<span id="LC4" class="line" lang="plaintext"><hr /></span> <span id="LC5" class="line" lang="plaintext"><blockquote></span> -<span id="LC6" class="line" lang="plaintext"><p>aaa</p></span> -<span id="LC7" class="line" lang="plaintext"></blockquote></span> -<span id="LC8" class="line" lang="plaintext"><hr /></span> -<span id="LC9" class="line" lang="plaintext"><blockquote></span> -<span id="LC10" class="line" lang="plaintext"><p>bbb</p></span> -<span id="LC11" class="line" lang="plaintext"></blockquote></span></code></pre> +<span id="LC6" class="line" lang="plaintext"><p>bbb</p></span> +<span id="LC7" class="line" lang="plaintext"></blockquote></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3579:1-3580:40" dir="auto">However, because of laziness, a blank line is needed between +<p data-sourcepos="4027:1-4028:40" dir="auto">However, because of laziness, a blank line is needed between a block quote and a following paragraph:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3582:1-3590:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> bar</span> -<span id="LC2" class="line" lang="plaintext">baz</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><blockquote></span> -<span id="LC5" class="line" lang="plaintext"><p>bar</span> -<span id="LC6" class="line" lang="plaintext">baz</p></span> -<span id="LC7" class="line" lang="plaintext"></blockquote></span></code></pre> +<pre data-sourcepos="4030:1-4033:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> bar</span> +<span id="LC2" class="line" lang="plaintext">baz</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3593:1-3602:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> bar</span> +<pre data-sourcepos="4035:1-4040:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><p>bar</span> +<span id="LC3" class="line" lang="plaintext">baz</p></span> +<span id="LC4" class="line" lang="plaintext"></blockquote></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4043:1-4047:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> bar</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">baz</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><blockquote></span> -<span id="LC6" class="line" lang="plaintext"><p>bar</p></span> -<span id="LC7" class="line" lang="plaintext"></blockquote></span> -<span id="LC8" class="line" lang="plaintext"><p>baz</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4049:1-4054:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><p>bar</p></span> +<span id="LC3" class="line" lang="plaintext"></blockquote></span> +<span id="LC4" class="line" lang="plaintext"><p>baz</p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3605:1-3614:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> bar</span> +<pre data-sourcepos="4057:1-4061:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> bar</span> <span id="LC2" class="line" lang="plaintext">></span> -<span id="LC3" class="line" lang="plaintext">baz</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><blockquote></span> -<span id="LC6" class="line" lang="plaintext"><p>bar</p></span> -<span id="LC7" class="line" lang="plaintext"></blockquote></span> -<span id="LC8" class="line" lang="plaintext"><p>baz</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4063:1-4068:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><p>bar</p></span> +<span id="LC3" class="line" lang="plaintext"></blockquote></span> +<span id="LC4" class="line" lang="plaintext"><p>baz</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3617:1-3619:19" dir="auto">It is a consequence of the Laziness rule that any number +<p data-sourcepos="4071:1-4073:19" dir="auto">It is a consequence of the Laziness rule that any number of initial <code>></code>s may be omitted on a continuation line of a nested block quote:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3621:1-3633:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> > > foo</span> -<span id="LC2" class="line" lang="plaintext">bar</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><blockquote></span> -<span id="LC5" class="line" lang="plaintext"><blockquote></span> -<span id="LC6" class="line" lang="plaintext"><blockquote></span> -<span id="LC7" class="line" lang="plaintext"><p>foo</span> -<span id="LC8" class="line" lang="plaintext">bar</p></span> -<span id="LC9" class="line" lang="plaintext"></blockquote></span> -<span id="LC10" class="line" lang="plaintext"></blockquote></span> -<span id="LC11" class="line" lang="plaintext"></blockquote></span></code></pre> +<pre data-sourcepos="4075:1-4078:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> > > foo</span> +<span id="LC2" class="line" lang="plaintext">bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4080:1-4089:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><blockquote></span> +<span id="LC3" class="line" lang="plaintext"><blockquote></span> +<span id="LC4" class="line" lang="plaintext"><p>foo</span> +<span id="LC5" class="line" lang="plaintext">bar</p></span> +<span id="LC6" class="line" lang="plaintext"></blockquote></span> +<span id="LC7" class="line" lang="plaintext"></blockquote></span> +<span id="LC8" class="line" lang="plaintext"></blockquote></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3636:1-3650:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">>>> foo</span> +<pre data-sourcepos="4092:1-4096:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">>>> foo</span> <span id="LC2" class="line" lang="plaintext">> bar</span> -<span id="LC3" class="line" lang="plaintext">>>baz</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><blockquote></span> -<span id="LC6" class="line" lang="plaintext"><blockquote></span> -<span id="LC7" class="line" lang="plaintext"><blockquote></span> -<span id="LC8" class="line" lang="plaintext"><p>foo</span> -<span id="LC9" class="line" lang="plaintext">bar</span> -<span id="LC10" class="line" lang="plaintext">baz</p></span> -<span id="LC11" class="line" lang="plaintext"></blockquote></span> -<span id="LC12" class="line" lang="plaintext"></blockquote></span> -<span id="LC13" class="line" lang="plaintext"></blockquote></span></code></pre> +<span id="LC3" class="line" lang="plaintext">>>baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4098:1-4108:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><blockquote></span> +<span id="LC3" class="line" lang="plaintext"><blockquote></span> +<span id="LC4" class="line" lang="plaintext"><p>foo</span> +<span id="LC5" class="line" lang="plaintext">bar</span> +<span id="LC6" class="line" lang="plaintext">baz</p></span> +<span id="LC7" class="line" lang="plaintext"></blockquote></span> +<span id="LC8" class="line" lang="plaintext"></blockquote></span> +<span id="LC9" class="line" lang="plaintext"></blockquote></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3653:1-3656:8" dir="auto">When including an indented code block in a block quote, +<p data-sourcepos="4111:1-4114:8" dir="auto">When including an indented code block in a block quote, remember that the [block quote marker] includes both the <code>></code> and a following space. So <em>five spaces</em> are needed after the <code>></code>:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3658:1-3670:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> code</span> +<pre data-sourcepos="4116:1-4120:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> code</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">> not code</span> -<span id="LC4" class="line" lang="plaintext">.</span> +<span id="LC3" class="line" lang="plaintext">> not code</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4122:1-4130:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><pre><code>code</span> +<span id="LC3" class="line" lang="plaintext"></code></pre></span> +<span id="LC4" class="line" lang="plaintext"></blockquote></span> <span id="LC5" class="line" lang="plaintext"><blockquote></span> -<span id="LC6" class="line" lang="plaintext"><pre><code>code</span> -<span id="LC7" class="line" lang="plaintext"></code></pre></span> -<span id="LC8" class="line" lang="plaintext"></blockquote></span> -<span id="LC9" class="line" lang="plaintext"><blockquote></span> -<span id="LC10" class="line" lang="plaintext"><p>not code</p></span> -<span id="LC11" class="line" lang="plaintext"></blockquote></span></code></pre> +<span id="LC6" class="line" lang="plaintext"><p>not code</p></span> +<span id="LC7" class="line" lang="plaintext"></blockquote></span></code></pre> <copy-code></copy-code> </div> -<h2 data-sourcepos="3674:1-3674:13" dir="auto"> +<h2 data-sourcepos="4134:1-4134:13" dir="auto"> <a id="user-content-list-items" class="anchor" href="#list-items" aria-hidden="true"></a>List items</h2> -<p data-sourcepos="3676:1-3677:49" dir="auto">A <a href="@">list marker</a> is a +<p data-sourcepos="4136:1-4137:49" dir="auto">A <a href="@">list marker</a> is a [bullet list marker] or an [ordered list marker].</p> -<p data-sourcepos="3679:1-3680:32" dir="auto">A <a href="@">bullet list marker</a> +<p data-sourcepos="4139:1-4140:32" dir="auto">A <a href="@">bullet list marker</a> is a <code>-</code>, <code>+</code>, or <code>*</code> character.</p> -<p data-sourcepos="3682:1-3686:18" dir="auto">An <a href="@">ordered list marker</a> +<p data-sourcepos="4142:1-4146:18" dir="auto">An <a href="@">ordered list marker</a> is a sequence of 1--9 arabic digits (<code>0-9</code>), followed by either a <code>.</code> character or a <code>)</code> character. (The reason for the length limit is that with 10 digits we start seeing integer overflows in some browsers.)</p> -<p data-sourcepos="3688:1-3688:40" dir="auto">The following rules define [list items]:</p> -<ol data-sourcepos="3690:1-3709:0" dir="auto"> -<li data-sourcepos="3690:1-3709:0"> -<p data-sourcepos="3690:5-3698:45"><strong>Basic case.</strong> If a sequence of lines <em>Ls</em> constitute a sequence of +<p data-sourcepos="4148:1-4148:40" dir="auto">The following rules define [list items]:</p> +<ol data-sourcepos="4150:1-4169:0" dir="auto"> +<li data-sourcepos="4150:1-4169:0"> +<p data-sourcepos="4150:5-4158:45"><strong>Basic case.</strong> If a sequence of lines <em>Ls</em> constitute a sequence of blocks <em>Bs</em> starting with a [non-whitespace character], and <em>M</em> is a list marker of width <em>W</em> followed by 1 ≤ <em>N</em> ≤ 4 spaces, then the result of prepending <em>M</em> and the following spaces to the first line of @@ -3261,119 +3723,131 @@ list item with <em>Bs</em> as its contents. The type of the list item (bullet or ordered) is determined by the type of its list marker. If the list item is ordered, then it is also assigned a start number, based on the ordered list marker.</p> -<p data-sourcepos="3700:5-3700:15">Exceptions:</p> -<ol data-sourcepos="3702:5-3709:0"> -<li data-sourcepos="3702:5-3706:57">When the first list item in a [list] interrupts +<p data-sourcepos="4160:5-4160:15">Exceptions:</p> +<ol data-sourcepos="4162:5-4169:0"> +<li data-sourcepos="4162:5-4166:57">When the first list item in a [list] interrupts a paragraph---that is, when it starts on a line that would otherwise count as [paragraph continuation text]---then (a) the lines <em>Ls</em> must not begin with a blank line, and (b) if the list item is ordered, the start number must be 1.</li> -<li data-sourcepos="3707:5-3709:0">If any line is a [thematic break][thematic breaks] then +<li data-sourcepos="4167:5-4169:0">If any line is a [thematic break][thematic breaks] then that line is not a list item.</li> </ol> </li> </ol> -<p data-sourcepos="3710:1-3710:34" dir="auto">For example, let <em>Ls</em> be the lines</p> +<p data-sourcepos="4170:1-4170:34" dir="auto">For example, let <em>Ls</em> be the lines</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3712:1-3727:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">A paragraph</span> +<pre data-sourcepos="4172:1-4179:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">A paragraph</span> <span id="LC2" class="line" lang="plaintext">with two lines.</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext"> indented code</span> <span id="LC5" class="line" lang="plaintext"></span> -<span id="LC6" class="line" lang="plaintext">> A block quote.</span> -<span id="LC7" class="line" lang="plaintext">.</span> -<span id="LC8" class="line" lang="plaintext"><p>A paragraph</span> -<span id="LC9" class="line" lang="plaintext">with two lines.</p></span> -<span id="LC10" class="line" lang="plaintext"><pre><code>indented code</span> -<span id="LC11" class="line" lang="plaintext"></code></pre></span> -<span id="LC12" class="line" lang="plaintext"><blockquote></span> -<span id="LC13" class="line" lang="plaintext"><p>A block quote.</p></span> -<span id="LC14" class="line" lang="plaintext"></blockquote></span></code></pre> -<copy-code></copy-code> -</div> -<p data-sourcepos="3730:1-3732:30" dir="auto">And let <em>M</em> be the marker <code>1.</code>, and <em>N</em> = 2. Then rule #1 says +<span id="LC6" class="line" lang="plaintext">> A block quote.</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4181:1-4189:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>A paragraph</span> +<span id="LC2" class="line" lang="plaintext">with two lines.</p></span> +<span id="LC3" class="line" lang="plaintext"><pre><code>indented code</span> +<span id="LC4" class="line" lang="plaintext"></code></pre></span> +<span id="LC5" class="line" lang="plaintext"><blockquote></span> +<span id="LC6" class="line" lang="plaintext"><p>A block quote.</p></span> +<span id="LC7" class="line" lang="plaintext"></blockquote></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="4192:1-4194:30" dir="auto">And let <em>M</em> be the marker <code>1.</code>, and <em>N</em> = 2. Then rule #1 says that the following is an ordered list item with start number 1, and the same contents as <em>Ls</em>:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3734:1-3753:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. A paragraph</span> +<pre data-sourcepos="4196:1-4203:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. A paragraph</span> <span id="LC2" class="line" lang="plaintext"> with two lines.</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext"> indented code</span> <span id="LC5" class="line" lang="plaintext"></span> -<span id="LC6" class="line" lang="plaintext"> > A block quote.</span> -<span id="LC7" class="line" lang="plaintext">.</span> -<span id="LC8" class="line" lang="plaintext"><ol></span> -<span id="LC9" class="line" lang="plaintext"><li></span> -<span id="LC10" class="line" lang="plaintext"><p>A paragraph</span> -<span id="LC11" class="line" lang="plaintext">with two lines.</p></span> -<span id="LC12" class="line" lang="plaintext"><pre><code>indented code</span> -<span id="LC13" class="line" lang="plaintext"></code></pre></span> -<span id="LC14" class="line" lang="plaintext"><blockquote></span> -<span id="LC15" class="line" lang="plaintext"><p>A block quote.</p></span> -<span id="LC16" class="line" lang="plaintext"></blockquote></span> -<span id="LC17" class="line" lang="plaintext"></li></span> -<span id="LC18" class="line" lang="plaintext"></ol></span></code></pre> +<span id="LC6" class="line" lang="plaintext"> > A block quote.</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4205:1-4217:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>A paragraph</span> +<span id="LC4" class="line" lang="plaintext">with two lines.</p></span> +<span id="LC5" class="line" lang="plaintext"><pre><code>indented code</span> +<span id="LC6" class="line" lang="plaintext"></code></pre></span> +<span id="LC7" class="line" lang="plaintext"><blockquote></span> +<span id="LC8" class="line" lang="plaintext"><p>A block quote.</p></span> +<span id="LC9" class="line" lang="plaintext"></blockquote></span> +<span id="LC10" class="line" lang="plaintext"></li></span> +<span id="LC11" class="line" lang="plaintext"></ol></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3756:1-3762:5" dir="auto">The most important thing to notice is that the position of +<p data-sourcepos="4220:1-4226:5" dir="auto">The most important thing to notice is that the position of the text after the list marker determines how much indentation is needed in subsequent blocks in the list item. If the list marker takes up two spaces, and there are three spaces between the list marker and the next [non-whitespace character], then blocks must be indented five spaces in order to fall under the list item.</p> -<p data-sourcepos="3764:1-3765:24" dir="auto">Here are some examples showing how far content must be indented to be +<p data-sourcepos="4228:1-4229:24" dir="auto">Here are some examples showing how far content must be indented to be put under the list item:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3767:1-3776:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- one</span> +<pre data-sourcepos="4231:1-4235:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- one</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext"> two</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><ul></span> -<span id="LC6" class="line" lang="plaintext"><li>one</li></span> -<span id="LC7" class="line" lang="plaintext"></ul></span> -<span id="LC8" class="line" lang="plaintext"><p>two</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> two</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4237:1-4242:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>one</li></span> +<span id="LC3" class="line" lang="plaintext"></ul></span> +<span id="LC4" class="line" lang="plaintext"><p>two</p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3779:1-3790:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- one</span> +<pre data-sourcepos="4245:1-4249:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- one</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext"> two</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><ul></span> -<span id="LC6" class="line" lang="plaintext"><li></span> -<span id="LC7" class="line" lang="plaintext"><p>one</p></span> -<span id="LC8" class="line" lang="plaintext"><p>two</p></span> -<span id="LC9" class="line" lang="plaintext"></li></span> -<span id="LC10" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> two</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4251:1-4258:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>one</p></span> +<span id="LC4" class="line" lang="plaintext"><p>two</p></span> +<span id="LC5" class="line" lang="plaintext"></li></span> +<span id="LC6" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3793:1-3803:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> - one</span> +<pre data-sourcepos="4261:1-4265:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> - one</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext"> two</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><ul></span> -<span id="LC6" class="line" lang="plaintext"><li>one</li></span> -<span id="LC7" class="line" lang="plaintext"></ul></span> -<span id="LC8" class="line" lang="plaintext"><pre><code> two</span> -<span id="LC9" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> two</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4267:1-4273:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>one</li></span> +<span id="LC3" class="line" lang="plaintext"></ul></span> +<span id="LC4" class="line" lang="plaintext"><pre><code> two</span> +<span id="LC5" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3806:1-3817:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> - one</span> +<pre data-sourcepos="4276:1-4280:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> - one</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext"> two</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><ul></span> -<span id="LC6" class="line" lang="plaintext"><li></span> -<span id="LC7" class="line" lang="plaintext"><p>one</p></span> -<span id="LC8" class="line" lang="plaintext"><p>two</p></span> -<span id="LC9" class="line" lang="plaintext"></li></span> -<span id="LC10" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> two</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4282:1-4289:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>one</p></span> +<span id="LC4" class="line" lang="plaintext"><p>two</p></span> +<span id="LC5" class="line" lang="plaintext"></li></span> +<span id="LC6" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3820:1-3826:13" dir="auto">It is tempting to think of this in terms of columns: the continuation +<p data-sourcepos="4292:1-4298:13" dir="auto">It is tempting to think of this in terms of columns: the continuation blocks must be indented at least to the column of the first [non-whitespace character] after the list marker. However, that is not quite right. The spaces after the list marker determine how much relative indentation @@ -3381,74 +3855,82 @@ is needed. Which column this indentation reaches will depend on how the list item is embedded in other constructions, as shown by this example:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3828:1-3843:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> > > 1. one</span> +<pre data-sourcepos="4300:1-4304:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> > > 1. one</span> <span id="LC2" class="line" lang="plaintext">>></span> -<span id="LC3" class="line" lang="plaintext">>> two</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><blockquote></span> -<span id="LC6" class="line" lang="plaintext"><blockquote></span> -<span id="LC7" class="line" lang="plaintext"><ol></span> -<span id="LC8" class="line" lang="plaintext"><li></span> -<span id="LC9" class="line" lang="plaintext"><p>one</p></span> -<span id="LC10" class="line" lang="plaintext"><p>two</p></span> -<span id="LC11" class="line" lang="plaintext"></li></span> -<span id="LC12" class="line" lang="plaintext"></ol></span> -<span id="LC13" class="line" lang="plaintext"></blockquote></span> -<span id="LC14" class="line" lang="plaintext"></blockquote></span></code></pre> +<span id="LC3" class="line" lang="plaintext">>> two</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3846:1-3848:67" dir="auto">Here <code>two</code> occurs in the same column as the list marker <code>1.</code>, +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4306:1-4317:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><blockquote></span> +<span id="LC3" class="line" lang="plaintext"><ol></span> +<span id="LC4" class="line" lang="plaintext"><li></span> +<span id="LC5" class="line" lang="plaintext"><p>one</p></span> +<span id="LC6" class="line" lang="plaintext"><p>two</p></span> +<span id="LC7" class="line" lang="plaintext"></li></span> +<span id="LC8" class="line" lang="plaintext"></ol></span> +<span id="LC9" class="line" lang="plaintext"></blockquote></span> +<span id="LC10" class="line" lang="plaintext"></blockquote></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="4320:1-4322:67" dir="auto">Here <code>two</code> occurs in the same column as the list marker <code>1.</code>, but is actually contained in the list item, because there is sufficient indentation after the last containing blockquote marker.</p> -<p data-sourcepos="3850:1-3853:38" dir="auto">The converse is also possible. In the following example, the word <code>two</code> +<p data-sourcepos="4324:1-4327:38" dir="auto">The converse is also possible. In the following example, the word <code>two</code> occurs far to the right of the initial text of the list item, <code>one</code>, but it is not considered part of the list item, because it is not indented far enough past the blockquote marker:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3855:1-3868:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">>>- one</span> +<pre data-sourcepos="4329:1-4333:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">>>- one</span> <span id="LC2" class="line" lang="plaintext">>></span> -<span id="LC3" class="line" lang="plaintext"> > > two</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><blockquote></span> -<span id="LC6" class="line" lang="plaintext"><blockquote></span> -<span id="LC7" class="line" lang="plaintext"><ul></span> -<span id="LC8" class="line" lang="plaintext"><li>one</li></span> -<span id="LC9" class="line" lang="plaintext"></ul></span> -<span id="LC10" class="line" lang="plaintext"><p>two</p></span> -<span id="LC11" class="line" lang="plaintext"></blockquote></span> -<span id="LC12" class="line" lang="plaintext"></blockquote></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> > > two</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3871:1-3872:51" dir="auto">Note that at least one space is needed between the list marker and +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4335:1-4344:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><blockquote></span> +<span id="LC3" class="line" lang="plaintext"><ul></span> +<span id="LC4" class="line" lang="plaintext"><li>one</li></span> +<span id="LC5" class="line" lang="plaintext"></ul></span> +<span id="LC6" class="line" lang="plaintext"><p>two</p></span> +<span id="LC7" class="line" lang="plaintext"></blockquote></span> +<span id="LC8" class="line" lang="plaintext"></blockquote></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="4347:1-4348:51" dir="auto">Note that at least one space is needed between the list marker and any following content, so these are not list items:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3874:1-3881:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">-one</span> +<pre data-sourcepos="4350:1-4354:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">-one</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">2.two</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>-one</p></span> -<span id="LC6" class="line" lang="plaintext"><p>2.two</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">2.two</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3884:1-3885:15" dir="auto">A list item may contain blocks that are separated by more than +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4356:1-4359:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>-one</p></span> +<span id="LC2" class="line" lang="plaintext"><p>2.two</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="4362:1-4363:15" dir="auto">A list item may contain blocks that are separated by more than one blank line.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3887:1-3899:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> +<pre data-sourcepos="4365:1-4370:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext"></span> -<span id="LC4" class="line" lang="plaintext"> bar</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><ul></span> -<span id="LC7" class="line" lang="plaintext"><li></span> -<span id="LC8" class="line" lang="plaintext"><p>foo</p></span> -<span id="LC9" class="line" lang="plaintext"><p>bar</p></span> -<span id="LC10" class="line" lang="plaintext"></li></span> -<span id="LC11" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC4" class="line" lang="plaintext"> bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4372:1-4379:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>foo</p></span> +<span id="LC4" class="line" lang="plaintext"><p>bar</p></span> +<span id="LC5" class="line" lang="plaintext"></li></span> +<span id="LC6" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3902:1-3902:42" dir="auto">A list item may contain any kind of block:</p> +<p data-sourcepos="4382:1-4382:42" dir="auto">A list item may contain any kind of block:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3904:1-3926:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. foo</span> +<pre data-sourcepos="4384:1-4394:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. foo</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext"> ```</span> <span id="LC4" class="line" lang="plaintext"> bar</span> @@ -3456,84 +3938,98 @@ one blank line.</p> <span id="LC6" class="line" lang="plaintext"></span> <span id="LC7" class="line" lang="plaintext"> baz</span> <span id="LC8" class="line" lang="plaintext"></span> -<span id="LC9" class="line" lang="plaintext"> > bam</span> -<span id="LC10" class="line" lang="plaintext">.</span> -<span id="LC11" class="line" lang="plaintext"><ol></span> -<span id="LC12" class="line" lang="plaintext"><li></span> -<span id="LC13" class="line" lang="plaintext"><p>foo</p></span> -<span id="LC14" class="line" lang="plaintext"><pre><code>bar</span> -<span id="LC15" class="line" lang="plaintext"></code></pre></span> -<span id="LC16" class="line" lang="plaintext"><p>baz</p></span> -<span id="LC17" class="line" lang="plaintext"><blockquote></span> -<span id="LC18" class="line" lang="plaintext"><p>bam</p></span> -<span id="LC19" class="line" lang="plaintext"></blockquote></span> -<span id="LC20" class="line" lang="plaintext"></li></span> -<span id="LC21" class="line" lang="plaintext"></ol></span></code></pre> -<copy-code></copy-code> -</div> -<p data-sourcepos="3929:1-3930:43" dir="auto">A list item that contains an indented code block will preserve +<span id="LC9" class="line" lang="plaintext"> > bam</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4396:1-4408:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>foo</p></span> +<span id="LC4" class="line" lang="plaintext"><pre><code>bar</span> +<span id="LC5" class="line" lang="plaintext"></code></pre></span> +<span id="LC6" class="line" lang="plaintext"><p>baz</p></span> +<span id="LC7" class="line" lang="plaintext"><blockquote></span> +<span id="LC8" class="line" lang="plaintext"><p>bam</p></span> +<span id="LC9" class="line" lang="plaintext"></blockquote></span> +<span id="LC10" class="line" lang="plaintext"></li></span> +<span id="LC11" class="line" lang="plaintext"></ol></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="4411:1-4412:43" dir="auto">A list item that contains an indented code block will preserve empty lines within the code block verbatim.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3932:1-3950:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- Foo</span> +<pre data-sourcepos="4414:1-4421:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- Foo</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext"> bar</span> <span id="LC4" class="line" lang="plaintext"></span> <span id="LC5" class="line" lang="plaintext"></span> -<span id="LC6" class="line" lang="plaintext"> baz</span> -<span id="LC7" class="line" lang="plaintext">.</span> -<span id="LC8" class="line" lang="plaintext"><ul></span> -<span id="LC9" class="line" lang="plaintext"><li></span> -<span id="LC10" class="line" lang="plaintext"><p>Foo</p></span> -<span id="LC11" class="line" lang="plaintext"><pre><code>bar</span> -<span id="LC12" class="line" lang="plaintext"></span> -<span id="LC13" class="line" lang="plaintext"></span> -<span id="LC14" class="line" lang="plaintext">baz</span> -<span id="LC15" class="line" lang="plaintext"></code></pre></span> -<span id="LC16" class="line" lang="plaintext"></li></span> -<span id="LC17" class="line" lang="plaintext"></ul></span></code></pre> -<copy-code></copy-code> -</div> -<p data-sourcepos="3952:1-3952:65" dir="auto">Note that ordered list start numbers must be nine digits or less:</p> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3954:1-3960:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">123456789. ok</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><ol start="123456789"></span> -<span id="LC4" class="line" lang="plaintext"><li>ok</li></span> -<span id="LC5" class="line" lang="plaintext"></ol></span></code></pre> +<span id="LC6" class="line" lang="plaintext"> baz</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3963:1-3967:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1234567890. not ok</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>1234567890. not ok</p></span></code></pre> +<pre data-sourcepos="4423:1-4434:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>Foo</p></span> +<span id="LC4" class="line" lang="plaintext"><pre><code>bar</span> +<span id="LC5" class="line" lang="plaintext"></span> +<span id="LC6" class="line" lang="plaintext"></span> +<span id="LC7" class="line" lang="plaintext">baz</span> +<span id="LC8" class="line" lang="plaintext"></code></pre></span> +<span id="LC9" class="line" lang="plaintext"></li></span> +<span id="LC10" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3970:1-3970:33" dir="auto">A start number may begin with 0s:</p> +<p data-sourcepos="4436:1-4436:65" dir="auto">Note that ordered list start numbers must be nine digits or less:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3972:1-3978:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">0. ok</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><ol start="0"></span> -<span id="LC4" class="line" lang="plaintext"><li>ok</li></span> -<span id="LC5" class="line" lang="plaintext"></ol></span></code></pre> +<pre data-sourcepos="4438:1-4440:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">123456789. ok</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3981:1-3987:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">003. ok</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><ol start="3"></span> -<span id="LC4" class="line" lang="plaintext"><li>ok</li></span> -<span id="LC5" class="line" lang="plaintext"></ol></span></code></pre> +<pre data-sourcepos="4442:1-4446:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol start="123456789"></span> +<span id="LC2" class="line" lang="plaintext"><li>ok</li></span> +<span id="LC3" class="line" lang="plaintext"></ol></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4449:1-4451:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1234567890. not ok</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4453:1-4455:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>1234567890. not ok</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="4458:1-4458:33" dir="auto">A start number may begin with 0s:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4460:1-4462:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">0. ok</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="3990:1-3990:35" dir="auto">A start number may not be negative:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3992:1-3996:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">-1. not ok</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>-1. not ok</p></span></code></pre> +<pre data-sourcepos="4464:1-4468:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol start="0"></span> +<span id="LC2" class="line" lang="plaintext"><li>ok</li></span> +<span id="LC3" class="line" lang="plaintext"></ol></span></code></pre> <copy-code></copy-code> </div> -<ol start="2" data-sourcepos="4000:1-4010:0" dir="auto"> -<li data-sourcepos="4000:1-4010:0"> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4471:1-4473:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">003. ok</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4475:1-4479:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol start="3"></span> +<span id="LC2" class="line" lang="plaintext"><li>ok</li></span> +<span id="LC3" class="line" lang="plaintext"></ol></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="4482:1-4482:35" dir="auto">A start number may not be negative:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4484:1-4486:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">-1. not ok</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4488:1-4490:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>-1. not ok</p></span></code></pre> +<copy-code></copy-code> +</div> +<ol start="2" data-sourcepos="4494:1-4504:0" dir="auto"> +<li data-sourcepos="4494:1-4504:0"> <strong>Item starting with indented code.</strong> If a sequence of lines <em>Ls</em> constitute a sequence of blocks <em>Bs</em> starting with an indented code block, and <em>M</em> is a list marker of width <em>W</em> followed by @@ -3545,94 +4041,104 @@ list item (bullet or ordered) is determined by the type of its list marker. If the list item is ordered, then it is also assigned a start number, based on the ordered list marker.</li> </ol> -<p data-sourcepos="4011:1-4013:39" dir="auto">An indented code block will have to be indented four spaces beyond +<p data-sourcepos="4505:1-4507:39" dir="auto">An indented code block will have to be indented four spaces beyond the edge of the region where text will be included in the list item. In the following case that is 6 spaces:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4015:1-4027:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> +<pre data-sourcepos="4509:1-4513:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext"> bar</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><ul></span> -<span id="LC6" class="line" lang="plaintext"><li></span> -<span id="LC7" class="line" lang="plaintext"><p>foo</p></span> -<span id="LC8" class="line" lang="plaintext"><pre><code>bar</span> -<span id="LC9" class="line" lang="plaintext"></code></pre></span> -<span id="LC10" class="line" lang="plaintext"></li></span> -<span id="LC11" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> bar</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4030:1-4030:33" dir="auto">And in this case it is 11 spaces:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4032:1-4044:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> 10. foo</span> +<pre data-sourcepos="4515:1-4523:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>foo</p></span> +<span id="LC4" class="line" lang="plaintext"><pre><code>bar</span> +<span id="LC5" class="line" lang="plaintext"></code></pre></span> +<span id="LC6" class="line" lang="plaintext"></li></span> +<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="4526:1-4526:33" dir="auto">And in this case it is 11 spaces:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4528:1-4532:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> 10. foo</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext"> bar</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><ol start="10"></span> -<span id="LC6" class="line" lang="plaintext"><li></span> -<span id="LC7" class="line" lang="plaintext"><p>foo</p></span> -<span id="LC8" class="line" lang="plaintext"><pre><code>bar</span> -<span id="LC9" class="line" lang="plaintext"></code></pre></span> -<span id="LC10" class="line" lang="plaintext"></li></span> -<span id="LC11" class="line" lang="plaintext"></ol></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4534:1-4542:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol start="10"></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>foo</p></span> +<span id="LC4" class="line" lang="plaintext"><pre><code>bar</span> +<span id="LC5" class="line" lang="plaintext"></code></pre></span> +<span id="LC6" class="line" lang="plaintext"></li></span> +<span id="LC7" class="line" lang="plaintext"></ol></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4047:1-4049:12" dir="auto">If the <em>first</em> block in the list item is an indented code block, +<p data-sourcepos="4545:1-4547:12" dir="auto">If the <em>first</em> block in the list item is an indented code block, then by rule #2, the contents must be indented <em>one</em> space after the list marker:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4051:1-4063:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> indented code</span> +<pre data-sourcepos="4549:1-4555:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> indented code</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext">paragraph</span> <span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext"> more code</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><pre><code>indented code</span> -<span id="LC8" class="line" lang="plaintext"></code></pre></span> -<span id="LC9" class="line" lang="plaintext"><p>paragraph</p></span> -<span id="LC10" class="line" lang="plaintext"><pre><code>more code</span> -<span id="LC11" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC5" class="line" lang="plaintext"> more code</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4066:1-4082:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. indented code</span> +<pre data-sourcepos="4557:1-4563:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>indented code</span> +<span id="LC2" class="line" lang="plaintext"></code></pre></span> +<span id="LC3" class="line" lang="plaintext"><p>paragraph</p></span> +<span id="LC4" class="line" lang="plaintext"><pre><code>more code</span> +<span id="LC5" class="line" lang="plaintext"></code></pre></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4566:1-4572:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. indented code</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext"> paragraph</span> <span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext"> more code</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><ol></span> -<span id="LC8" class="line" lang="plaintext"><li></span> -<span id="LC9" class="line" lang="plaintext"><pre><code>indented code</span> -<span id="LC10" class="line" lang="plaintext"></code></pre></span> -<span id="LC11" class="line" lang="plaintext"><p>paragraph</p></span> -<span id="LC12" class="line" lang="plaintext"><pre><code>more code</span> -<span id="LC13" class="line" lang="plaintext"></code></pre></span> -<span id="LC14" class="line" lang="plaintext"></li></span> -<span id="LC15" class="line" lang="plaintext"></ol></span></code></pre> +<span id="LC5" class="line" lang="plaintext"> more code</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4574:1-4584:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><pre><code>indented code</span> +<span id="LC4" class="line" lang="plaintext"></code></pre></span> +<span id="LC5" class="line" lang="plaintext"><p>paragraph</p></span> +<span id="LC6" class="line" lang="plaintext"><pre><code>more code</span> +<span id="LC7" class="line" lang="plaintext"></code></pre></span> +<span id="LC8" class="line" lang="plaintext"></li></span> +<span id="LC9" class="line" lang="plaintext"></ol></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4085:1-4086:22" dir="auto">Note that an additional space indent is interpreted as space +<p data-sourcepos="4587:1-4588:22" dir="auto">Note that an additional space indent is interpreted as space inside the code block:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4088:1-4104:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. indented code</span> +<pre data-sourcepos="4590:1-4596:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. indented code</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext"> paragraph</span> <span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext"> more code</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><ol></span> -<span id="LC8" class="line" lang="plaintext"><li></span> -<span id="LC9" class="line" lang="plaintext"><pre><code> indented code</span> -<span id="LC10" class="line" lang="plaintext"></code></pre></span> -<span id="LC11" class="line" lang="plaintext"><p>paragraph</p></span> -<span id="LC12" class="line" lang="plaintext"><pre><code>more code</span> -<span id="LC13" class="line" lang="plaintext"></code></pre></span> -<span id="LC14" class="line" lang="plaintext"></li></span> -<span id="LC15" class="line" lang="plaintext"></ol></span></code></pre> +<span id="LC5" class="line" lang="plaintext"> more code</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4107:1-4113:55" dir="auto">Note that rules #1 and #2 only apply to two cases: (a) cases +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4598:1-4608:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><pre><code> indented code</span> +<span id="LC4" class="line" lang="plaintext"></code></pre></span> +<span id="LC5" class="line" lang="plaintext"><p>paragraph</p></span> +<span id="LC6" class="line" lang="plaintext"><pre><code>more code</span> +<span id="LC7" class="line" lang="plaintext"></code></pre></span> +<span id="LC8" class="line" lang="plaintext"></li></span> +<span id="LC9" class="line" lang="plaintext"></ol></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="4611:1-4617:55" dir="auto">Note that rules #1 and #2 only apply to two cases: (a) cases in which the lines to be included in a list item begin with a [non-whitespace character], and (b) cases in which they begin with an indented code @@ -3640,44 +4146,50 @@ block. In a case like the following, where the first block begins with a three-space indent, the rules do not allow us to form a list item by indenting the whole thing and prepending a list marker:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4115:1-4122:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> foo</span> +<pre data-sourcepos="4619:1-4623:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> foo</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">bar</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>foo</p></span> -<span id="LC6" class="line" lang="plaintext"><p>bar</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">bar</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4125:1-4134:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> +<pre data-sourcepos="4625:1-4628:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo</p></span> +<span id="LC2" class="line" lang="plaintext"><p>bar</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4631:1-4635:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext"> bar</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><ul></span> -<span id="LC6" class="line" lang="plaintext"><li>foo</li></span> -<span id="LC7" class="line" lang="plaintext"></ul></span> -<span id="LC8" class="line" lang="plaintext"><p>bar</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4637:1-4642:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>foo</li></span> +<span id="LC3" class="line" lang="plaintext"></ul></span> +<span id="LC4" class="line" lang="plaintext"><p>bar</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4137:1-4140:15" dir="auto">This is not a significant restriction, because when a block begins +<p data-sourcepos="4645:1-4648:15" dir="auto">This is not a significant restriction, because when a block begins with 1-3 spaces indent, the indentation can always be removed without a change in interpretation, allowing rule #1 to be applied. So, in the above case:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4142:1-4153:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> +<pre data-sourcepos="4650:1-4654:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext"> bar</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><ul></span> -<span id="LC6" class="line" lang="plaintext"><li></span> -<span id="LC7" class="line" lang="plaintext"><p>foo</p></span> -<span id="LC8" class="line" lang="plaintext"><p>bar</p></span> -<span id="LC9" class="line" lang="plaintext"></li></span> -<span id="LC10" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4656:1-4663:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>foo</p></span> +<span id="LC4" class="line" lang="plaintext"><p>bar</p></span> +<span id="LC5" class="line" lang="plaintext"></li></span> +<span id="LC6" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<ol start="3" data-sourcepos="4156:1-4167:0" dir="auto"> -<li data-sourcepos="4156:1-4167:0"> +<ol start="3" data-sourcepos="4666:1-4677:0" dir="auto"> +<li data-sourcepos="4666:1-4677:0"> <strong>Item starting with a blank line.</strong> If a sequence of lines <em>Ls</em> starting with a single [blank line] constitute a (possibly empty) sequence of blocks <em>Bs</em>, not separated from each other by more than @@ -3690,211 +4202,235 @@ list item (bullet or ordered) is determined by the type of its list marker. If the list item is ordered, then it is also assigned a start number, based on the ordered list marker.</li> </ol> -<p data-sourcepos="4168:1-4168:72" dir="auto">Here are some list items that start with a blank line but are not empty:</p> +<p data-sourcepos="4678:1-4678:72" dir="auto">Here are some list items that start with a blank line but are not empty:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4170:1-4191:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">-</span> +<pre data-sourcepos="4680:1-4689:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">-</span> <span id="LC2" class="line" lang="plaintext"> foo</span> <span id="LC3" class="line" lang="plaintext">-</span> <span id="LC4" class="line" lang="plaintext"> ```</span> <span id="LC5" class="line" lang="plaintext"> bar</span> <span id="LC6" class="line" lang="plaintext"> ```</span> <span id="LC7" class="line" lang="plaintext">-</span> -<span id="LC8" class="line" lang="plaintext"> baz</span> -<span id="LC9" class="line" lang="plaintext">.</span> -<span id="LC10" class="line" lang="plaintext"><ul></span> -<span id="LC11" class="line" lang="plaintext"><li>foo</li></span> -<span id="LC12" class="line" lang="plaintext"><li></span> -<span id="LC13" class="line" lang="plaintext"><pre><code>bar</span> -<span id="LC14" class="line" lang="plaintext"></code></pre></span> -<span id="LC15" class="line" lang="plaintext"></li></span> -<span id="LC16" class="line" lang="plaintext"><li></span> -<span id="LC17" class="line" lang="plaintext"><pre><code>baz</span> -<span id="LC18" class="line" lang="plaintext"></code></pre></span> -<span id="LC19" class="line" lang="plaintext"></li></span> -<span id="LC20" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC8" class="line" lang="plaintext"> baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4691:1-4703:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>foo</li></span> +<span id="LC3" class="line" lang="plaintext"><li></span> +<span id="LC4" class="line" lang="plaintext"><pre><code>bar</span> +<span id="LC5" class="line" lang="plaintext"></code></pre></span> +<span id="LC6" class="line" lang="plaintext"></li></span> +<span id="LC7" class="line" lang="plaintext"><li></span> +<span id="LC8" class="line" lang="plaintext"><pre><code>baz</span> +<span id="LC9" class="line" lang="plaintext"></code></pre></span> +<span id="LC10" class="line" lang="plaintext"></li></span> +<span id="LC11" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4193:1-4194:66" dir="auto">When the list item starts with a blank line, the number of spaces +<p data-sourcepos="4705:1-4706:66" dir="auto">When the list item starts with a blank line, the number of spaces following the list marker doesn't change the required indentation:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4196:1-4203:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- </span> -<span id="LC2" class="line" lang="plaintext"> foo</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><ul></span> -<span id="LC5" class="line" lang="plaintext"><li>foo</li></span> -<span id="LC6" class="line" lang="plaintext"></ul></span></code></pre> +<pre data-sourcepos="4708:1-4711:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- </span> +<span id="LC2" class="line" lang="plaintext"> foo</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4713:1-4717:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>foo</li></span> +<span id="LC3" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4206:1-4208:5" dir="auto">A list item can begin with at most one blank line. +<p data-sourcepos="4720:1-4722:5" dir="auto">A list item can begin with at most one blank line. In the following example, <code>foo</code> is not part of the list item:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4210:1-4219:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">-</span> +<pre data-sourcepos="4724:1-4728:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">-</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext"> foo</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><ul></span> -<span id="LC6" class="line" lang="plaintext"><li></li></span> -<span id="LC7" class="line" lang="plaintext"></ul></span> -<span id="LC8" class="line" lang="plaintext"><p>foo</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> foo</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4730:1-4735:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></li></span> +<span id="LC3" class="line" lang="plaintext"></ul></span> +<span id="LC4" class="line" lang="plaintext"><p>foo</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4222:1-4222:34" dir="auto">Here is an empty bullet list item:</p> +<p data-sourcepos="4738:1-4738:34" dir="auto">Here is an empty bullet list item:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4224:1-4234:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> +<pre data-sourcepos="4740:1-4744:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> <span id="LC2" class="line" lang="plaintext">-</span> -<span id="LC3" class="line" lang="plaintext">- bar</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><ul></span> -<span id="LC6" class="line" lang="plaintext"><li>foo</li></span> -<span id="LC7" class="line" lang="plaintext"><li></li></span> -<span id="LC8" class="line" lang="plaintext"><li>bar</li></span> -<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC3" class="line" lang="plaintext">- bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4746:1-4752:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>foo</li></span> +<span id="LC3" class="line" lang="plaintext"><li></li></span> +<span id="LC4" class="line" lang="plaintext"><li>bar</li></span> +<span id="LC5" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4237:1-4237:72" dir="auto">It does not matter whether there are spaces following the [list marker]:</p> +<p data-sourcepos="4755:1-4755:72" dir="auto">It does not matter whether there are spaces following the [list marker]:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4239:1-4249:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> +<pre data-sourcepos="4757:1-4761:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> <span id="LC2" class="line" lang="plaintext">- </span> -<span id="LC3" class="line" lang="plaintext">- bar</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><ul></span> -<span id="LC6" class="line" lang="plaintext"><li>foo</li></span> -<span id="LC7" class="line" lang="plaintext"><li></li></span> -<span id="LC8" class="line" lang="plaintext"><li>bar</li></span> -<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC3" class="line" lang="plaintext">- bar</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4252:1-4252:35" dir="auto">Here is an empty ordered list item:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4254:1-4264:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. foo</span> +<pre data-sourcepos="4763:1-4769:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>foo</li></span> +<span id="LC3" class="line" lang="plaintext"><li></li></span> +<span id="LC4" class="line" lang="plaintext"><li>bar</li></span> +<span id="LC5" class="line" lang="plaintext"></ul></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="4772:1-4772:35" dir="auto">Here is an empty ordered list item:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4774:1-4778:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. foo</span> <span id="LC2" class="line" lang="plaintext">2.</span> -<span id="LC3" class="line" lang="plaintext">3. bar</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><ol></span> -<span id="LC6" class="line" lang="plaintext"><li>foo</li></span> -<span id="LC7" class="line" lang="plaintext"><li></li></span> -<span id="LC8" class="line" lang="plaintext"><li>bar</li></span> -<span id="LC9" class="line" lang="plaintext"></ol></span></code></pre> +<span id="LC3" class="line" lang="plaintext">3. bar</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4267:1-4267:48" dir="auto">A list may start or end with an empty list item:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4269:1-4275:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><ul></span> -<span id="LC4" class="line" lang="plaintext"><li></li></span> -<span id="LC5" class="line" lang="plaintext"></ul></span></code></pre> +<pre data-sourcepos="4780:1-4786:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span> +<span id="LC2" class="line" lang="plaintext"><li>foo</li></span> +<span id="LC3" class="line" lang="plaintext"><li></li></span> +<span id="LC4" class="line" lang="plaintext"><li>bar</li></span> +<span id="LC5" class="line" lang="plaintext"></ol></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="4789:1-4789:48" dir="auto">A list may start or end with an empty list item:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4791:1-4793:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4795:1-4799:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></li></span> +<span id="LC3" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4277:1-4277:57" dir="auto">However, an empty list item cannot interrupt a paragraph:</p> +<p data-sourcepos="4801:1-4801:57" dir="auto">However, an empty list item cannot interrupt a paragraph:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4279:1-4290:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span> +<pre data-sourcepos="4803:1-4809:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span> <span id="LC2" class="line" lang="plaintext">*</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext">foo</span> -<span id="LC5" class="line" lang="plaintext">1.</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><p>foo</span> -<span id="LC8" class="line" lang="plaintext">*</p></span> -<span id="LC9" class="line" lang="plaintext"><p>foo</span> -<span id="LC10" class="line" lang="plaintext">1.</p></span></code></pre> +<span id="LC5" class="line" lang="plaintext">1.</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4811:1-4816:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo</span> +<span id="LC2" class="line" lang="plaintext">*</p></span> +<span id="LC3" class="line" lang="plaintext"><p>foo</span> +<span id="LC4" class="line" lang="plaintext">1.</p></span></code></pre> <copy-code></copy-code> </div> -<ol start="4" data-sourcepos="4293:1-4298:0" dir="auto"> -<li data-sourcepos="4293:1-4298:0"> +<ol start="4" data-sourcepos="4819:1-4824:0" dir="auto"> +<li data-sourcepos="4819:1-4824:0"> <strong>Indentation.</strong> If a sequence of lines <em>Ls</em> constitutes a list item according to rule #1, #2, or #3, then the result of indenting each line of <em>Ls</em> by 1-3 spaces (the same for each line) also constitutes a list item with the same contents and attributes. If a line is empty, then it need not be indented.</li> </ol> -<p data-sourcepos="4299:1-4299:19" dir="auto">Indented one space:</p> +<p data-sourcepos="4825:1-4825:19" dir="auto">Indented one space:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4301:1-4320:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> 1. A paragraph</span> +<pre data-sourcepos="4827:1-4834:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> 1. A paragraph</span> <span id="LC2" class="line" lang="plaintext"> with two lines.</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext"> indented code</span> <span id="LC5" class="line" lang="plaintext"></span> -<span id="LC6" class="line" lang="plaintext"> > A block quote.</span> -<span id="LC7" class="line" lang="plaintext">.</span> -<span id="LC8" class="line" lang="plaintext"><ol></span> -<span id="LC9" class="line" lang="plaintext"><li></span> -<span id="LC10" class="line" lang="plaintext"><p>A paragraph</span> -<span id="LC11" class="line" lang="plaintext">with two lines.</p></span> -<span id="LC12" class="line" lang="plaintext"><pre><code>indented code</span> -<span id="LC13" class="line" lang="plaintext"></code></pre></span> -<span id="LC14" class="line" lang="plaintext"><blockquote></span> -<span id="LC15" class="line" lang="plaintext"><p>A block quote.</p></span> -<span id="LC16" class="line" lang="plaintext"></blockquote></span> -<span id="LC17" class="line" lang="plaintext"></li></span> -<span id="LC18" class="line" lang="plaintext"></ol></span></code></pre> +<span id="LC6" class="line" lang="plaintext"> > A block quote.</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4323:1-4323:20" dir="auto">Indented two spaces:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4325:1-4344:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> 1. A paragraph</span> +<pre data-sourcepos="4836:1-4848:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>A paragraph</span> +<span id="LC4" class="line" lang="plaintext">with two lines.</p></span> +<span id="LC5" class="line" lang="plaintext"><pre><code>indented code</span> +<span id="LC6" class="line" lang="plaintext"></code></pre></span> +<span id="LC7" class="line" lang="plaintext"><blockquote></span> +<span id="LC8" class="line" lang="plaintext"><p>A block quote.</p></span> +<span id="LC9" class="line" lang="plaintext"></blockquote></span> +<span id="LC10" class="line" lang="plaintext"></li></span> +<span id="LC11" class="line" lang="plaintext"></ol></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="4851:1-4851:20" dir="auto">Indented two spaces:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4853:1-4860:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> 1. A paragraph</span> <span id="LC2" class="line" lang="plaintext"> with two lines.</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext"> indented code</span> <span id="LC5" class="line" lang="plaintext"></span> -<span id="LC6" class="line" lang="plaintext"> > A block quote.</span> -<span id="LC7" class="line" lang="plaintext">.</span> -<span id="LC8" class="line" lang="plaintext"><ol></span> -<span id="LC9" class="line" lang="plaintext"><li></span> -<span id="LC10" class="line" lang="plaintext"><p>A paragraph</span> -<span id="LC11" class="line" lang="plaintext">with two lines.</p></span> -<span id="LC12" class="line" lang="plaintext"><pre><code>indented code</span> -<span id="LC13" class="line" lang="plaintext"></code></pre></span> -<span id="LC14" class="line" lang="plaintext"><blockquote></span> -<span id="LC15" class="line" lang="plaintext"><p>A block quote.</p></span> -<span id="LC16" class="line" lang="plaintext"></blockquote></span> -<span id="LC17" class="line" lang="plaintext"></li></span> -<span id="LC18" class="line" lang="plaintext"></ol></span></code></pre> +<span id="LC6" class="line" lang="plaintext"> > A block quote.</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4347:1-4347:22" dir="auto">Indented three spaces:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4349:1-4368:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> 1. A paragraph</span> +<pre data-sourcepos="4862:1-4874:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>A paragraph</span> +<span id="LC4" class="line" lang="plaintext">with two lines.</p></span> +<span id="LC5" class="line" lang="plaintext"><pre><code>indented code</span> +<span id="LC6" class="line" lang="plaintext"></code></pre></span> +<span id="LC7" class="line" lang="plaintext"><blockquote></span> +<span id="LC8" class="line" lang="plaintext"><p>A block quote.</p></span> +<span id="LC9" class="line" lang="plaintext"></blockquote></span> +<span id="LC10" class="line" lang="plaintext"></li></span> +<span id="LC11" class="line" lang="plaintext"></ol></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="4877:1-4877:22" dir="auto">Indented three spaces:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4879:1-4886:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> 1. A paragraph</span> <span id="LC2" class="line" lang="plaintext"> with two lines.</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext"> indented code</span> <span id="LC5" class="line" lang="plaintext"></span> -<span id="LC6" class="line" lang="plaintext"> > A block quote.</span> -<span id="LC7" class="line" lang="plaintext">.</span> -<span id="LC8" class="line" lang="plaintext"><ol></span> -<span id="LC9" class="line" lang="plaintext"><li></span> -<span id="LC10" class="line" lang="plaintext"><p>A paragraph</span> -<span id="LC11" class="line" lang="plaintext">with two lines.</p></span> -<span id="LC12" class="line" lang="plaintext"><pre><code>indented code</span> -<span id="LC13" class="line" lang="plaintext"></code></pre></span> -<span id="LC14" class="line" lang="plaintext"><blockquote></span> -<span id="LC15" class="line" lang="plaintext"><p>A block quote.</p></span> -<span id="LC16" class="line" lang="plaintext"></blockquote></span> -<span id="LC17" class="line" lang="plaintext"></li></span> -<span id="LC18" class="line" lang="plaintext"></ol></span></code></pre> +<span id="LC6" class="line" lang="plaintext"> > A block quote.</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4888:1-4900:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>A paragraph</span> +<span id="LC4" class="line" lang="plaintext">with two lines.</p></span> +<span id="LC5" class="line" lang="plaintext"><pre><code>indented code</span> +<span id="LC6" class="line" lang="plaintext"></code></pre></span> +<span id="LC7" class="line" lang="plaintext"><blockquote></span> +<span id="LC8" class="line" lang="plaintext"><p>A block quote.</p></span> +<span id="LC9" class="line" lang="plaintext"></blockquote></span> +<span id="LC10" class="line" lang="plaintext"></li></span> +<span id="LC11" class="line" lang="plaintext"></ol></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4371:1-4371:38" dir="auto">Four spaces indent gives a code block:</p> +<p data-sourcepos="4903:1-4903:38" dir="auto">Four spaces indent gives a code block:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4373:1-4388:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> 1. A paragraph</span> +<pre data-sourcepos="4905:1-4912:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> 1. A paragraph</span> <span id="LC2" class="line" lang="plaintext"> with two lines.</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext"> indented code</span> <span id="LC5" class="line" lang="plaintext"></span> -<span id="LC6" class="line" lang="plaintext"> > A block quote.</span> -<span id="LC7" class="line" lang="plaintext">.</span> -<span id="LC8" class="line" lang="plaintext"><pre><code>1. A paragraph</span> -<span id="LC9" class="line" lang="plaintext"> with two lines.</span> -<span id="LC10" class="line" lang="plaintext"></span> -<span id="LC11" class="line" lang="plaintext"> indented code</span> -<span id="LC12" class="line" lang="plaintext"></span> -<span id="LC13" class="line" lang="plaintext"> &gt; A block quote.</span> -<span id="LC14" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC6" class="line" lang="plaintext"> > A block quote.</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4914:1-4922:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>1. A paragraph</span> +<span id="LC2" class="line" lang="plaintext"> with two lines.</span> +<span id="LC3" class="line" lang="plaintext"></span> +<span id="LC4" class="line" lang="plaintext"> indented code</span> +<span id="LC5" class="line" lang="plaintext"></span> +<span id="LC6" class="line" lang="plaintext"> &gt; A block quote.</span> +<span id="LC7" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> -<ol start="5" data-sourcepos="4392:1-4400:0" dir="auto"> -<li data-sourcepos="4392:1-4400:0"> +<ol start="5" data-sourcepos="4926:1-4934:0" dir="auto"> +<li data-sourcepos="4926:1-4934:0"> <strong>Laziness.</strong> If a string of lines <em>Ls</em> constitute a <a href="#list-items">list item</a> with contents <em>Bs</em>, then the result of deleting some or all of the indentation from one or more lines in which the @@ -3904,225 +4440,247 @@ list item with the same contents and attributes. The unindented lines are called <a href="@">lazy continuation line</a>s.</li> </ol> -<p data-sourcepos="4401:1-4401:50" dir="auto">Here is an example with [lazy continuation lines]:</p> +<p data-sourcepos="4935:1-4935:50" dir="auto">Here is an example with [lazy continuation lines]:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4403:1-4422:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> 1. A paragraph</span> +<pre data-sourcepos="4937:1-4944:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> 1. A paragraph</span> <span id="LC2" class="line" lang="plaintext">with two lines.</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext"> indented code</span> <span id="LC5" class="line" lang="plaintext"></span> -<span id="LC6" class="line" lang="plaintext"> > A block quote.</span> -<span id="LC7" class="line" lang="plaintext">.</span> -<span id="LC8" class="line" lang="plaintext"><ol></span> -<span id="LC9" class="line" lang="plaintext"><li></span> -<span id="LC10" class="line" lang="plaintext"><p>A paragraph</span> -<span id="LC11" class="line" lang="plaintext">with two lines.</p></span> -<span id="LC12" class="line" lang="plaintext"><pre><code>indented code</span> -<span id="LC13" class="line" lang="plaintext"></code></pre></span> -<span id="LC14" class="line" lang="plaintext"><blockquote></span> -<span id="LC15" class="line" lang="plaintext"><p>A block quote.</p></span> -<span id="LC16" class="line" lang="plaintext"></blockquote></span> -<span id="LC17" class="line" lang="plaintext"></li></span> -<span id="LC18" class="line" lang="plaintext"></ol></span></code></pre> +<span id="LC6" class="line" lang="plaintext"> > A block quote.</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4425:1-4425:37" dir="auto">Indentation can be partially deleted:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4427:1-4435:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> 1. A paragraph</span> -<span id="LC2" class="line" lang="plaintext"> with two lines.</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><ol></span> -<span id="LC5" class="line" lang="plaintext"><li>A paragraph</span> -<span id="LC6" class="line" lang="plaintext">with two lines.</li></span> -<span id="LC7" class="line" lang="plaintext"></ol></span></code></pre> +<pre data-sourcepos="4946:1-4958:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>A paragraph</span> +<span id="LC4" class="line" lang="plaintext">with two lines.</p></span> +<span id="LC5" class="line" lang="plaintext"><pre><code>indented code</span> +<span id="LC6" class="line" lang="plaintext"></code></pre></span> +<span id="LC7" class="line" lang="plaintext"><blockquote></span> +<span id="LC8" class="line" lang="plaintext"><p>A block quote.</p></span> +<span id="LC9" class="line" lang="plaintext"></blockquote></span> +<span id="LC10" class="line" lang="plaintext"></li></span> +<span id="LC11" class="line" lang="plaintext"></ol></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="4961:1-4961:37" dir="auto">Indentation can be partially deleted:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4963:1-4966:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> 1. A paragraph</span> +<span id="LC2" class="line" lang="plaintext"> with two lines.</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4968:1-4973:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span> +<span id="LC2" class="line" lang="plaintext"><li>A paragraph</span> +<span id="LC3" class="line" lang="plaintext">with two lines.</li></span> +<span id="LC4" class="line" lang="plaintext"></ol></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4438:1-4438:63" dir="auto">These examples show how laziness can work in nested structures:</p> +<p data-sourcepos="4976:1-4976:63" dir="auto">These examples show how laziness can work in nested structures:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4440:1-4454:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> 1. > Blockquote</span> -<span id="LC2" class="line" lang="plaintext">continued here.</span> -<span id="LC3" class="line" lang="plaintext">.</span> +<pre data-sourcepos="4978:1-4981:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> 1. > Blockquote</span> +<span id="LC2" class="line" lang="plaintext">continued here.</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="4983:1-4994:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><ol></span> +<span id="LC3" class="line" lang="plaintext"><li></span> <span id="LC4" class="line" lang="plaintext"><blockquote></span> -<span id="LC5" class="line" lang="plaintext"><ol></span> -<span id="LC6" class="line" lang="plaintext"><li></span> -<span id="LC7" class="line" lang="plaintext"><blockquote></span> -<span id="LC8" class="line" lang="plaintext"><p>Blockquote</span> -<span id="LC9" class="line" lang="plaintext">continued here.</p></span> -<span id="LC10" class="line" lang="plaintext"></blockquote></span> -<span id="LC11" class="line" lang="plaintext"></li></span> -<span id="LC12" class="line" lang="plaintext"></ol></span> -<span id="LC13" class="line" lang="plaintext"></blockquote></span></code></pre> +<span id="LC5" class="line" lang="plaintext"><p>Blockquote</span> +<span id="LC6" class="line" lang="plaintext">continued here.</p></span> +<span id="LC7" class="line" lang="plaintext"></blockquote></span> +<span id="LC8" class="line" lang="plaintext"></li></span> +<span id="LC9" class="line" lang="plaintext"></ol></span> +<span id="LC10" class="line" lang="plaintext"></blockquote></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4457:1-4471:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> 1. > Blockquote</span> -<span id="LC2" class="line" lang="plaintext">> continued here.</span> -<span id="LC3" class="line" lang="plaintext">.</span> +<pre data-sourcepos="4997:1-5000:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> 1. > Blockquote</span> +<span id="LC2" class="line" lang="plaintext">> continued here.</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5002:1-5013:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><blockquote></span> +<span id="LC2" class="line" lang="plaintext"><ol></span> +<span id="LC3" class="line" lang="plaintext"><li></span> <span id="LC4" class="line" lang="plaintext"><blockquote></span> -<span id="LC5" class="line" lang="plaintext"><ol></span> -<span id="LC6" class="line" lang="plaintext"><li></span> -<span id="LC7" class="line" lang="plaintext"><blockquote></span> -<span id="LC8" class="line" lang="plaintext"><p>Blockquote</span> -<span id="LC9" class="line" lang="plaintext">continued here.</p></span> -<span id="LC10" class="line" lang="plaintext"></blockquote></span> -<span id="LC11" class="line" lang="plaintext"></li></span> -<span id="LC12" class="line" lang="plaintext"></ol></span> -<span id="LC13" class="line" lang="plaintext"></blockquote></span></code></pre> +<span id="LC5" class="line" lang="plaintext"><p>Blockquote</span> +<span id="LC6" class="line" lang="plaintext">continued here.</p></span> +<span id="LC7" class="line" lang="plaintext"></blockquote></span> +<span id="LC8" class="line" lang="plaintext"></li></span> +<span id="LC9" class="line" lang="plaintext"></ol></span> +<span id="LC10" class="line" lang="plaintext"></blockquote></span></code></pre> <copy-code></copy-code> </div> -<ol start="6" data-sourcepos="4475:1-4477:0" dir="auto"> -<li data-sourcepos="4475:1-4477:0"> +<ol start="6" data-sourcepos="5017:1-5019:0" dir="auto"> +<li data-sourcepos="5017:1-5019:0"> <strong>That's all.</strong> Nothing that is not counted as a list item by rules #1--5 counts as a <a href="#list-items">list item</a>.</li> </ol> -<p data-sourcepos="4478:1-4481:17" dir="auto">The rules for sublists follow from the general rules +<p data-sourcepos="5020:1-5023:17" dir="auto">The rules for sublists follow from the general rules [above][List items]. A sublist must be indented the same number of spaces a paragraph would need to be in order to be included in the list item.</p> -<p data-sourcepos="4483:1-4483:43" dir="auto">So, in this case we need two spaces indent:</p> +<p data-sourcepos="5025:1-5025:43" dir="auto">So, in this case we need two spaces indent:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4485:1-4506:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> +<pre data-sourcepos="5027:1-5032:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> <span id="LC2" class="line" lang="plaintext"> - bar</span> <span id="LC3" class="line" lang="plaintext"> - baz</span> -<span id="LC4" class="line" lang="plaintext"> - boo</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><ul></span> -<span id="LC7" class="line" lang="plaintext"><li>foo</span> -<span id="LC8" class="line" lang="plaintext"><ul></span> -<span id="LC9" class="line" lang="plaintext"><li>bar</span> -<span id="LC10" class="line" lang="plaintext"><ul></span> -<span id="LC11" class="line" lang="plaintext"><li>baz</span> -<span id="LC12" class="line" lang="plaintext"><ul></span> -<span id="LC13" class="line" lang="plaintext"><li>boo</li></span> -<span id="LC14" class="line" lang="plaintext"></ul></span> -<span id="LC15" class="line" lang="plaintext"></li></span> -<span id="LC16" class="line" lang="plaintext"></ul></span> -<span id="LC17" class="line" lang="plaintext"></li></span> -<span id="LC18" class="line" lang="plaintext"></ul></span> -<span id="LC19" class="line" lang="plaintext"></li></span> -<span id="LC20" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC4" class="line" lang="plaintext"> - boo</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5034:1-5050:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>foo</span> +<span id="LC3" class="line" lang="plaintext"><ul></span> +<span id="LC4" class="line" lang="plaintext"><li>bar</span> +<span id="LC5" class="line" lang="plaintext"><ul></span> +<span id="LC6" class="line" lang="plaintext"><li>baz</span> +<span id="LC7" class="line" lang="plaintext"><ul></span> +<span id="LC8" class="line" lang="plaintext"><li>boo</li></span> +<span id="LC9" class="line" lang="plaintext"></ul></span> +<span id="LC10" class="line" lang="plaintext"></li></span> +<span id="LC11" class="line" lang="plaintext"></ul></span> +<span id="LC12" class="line" lang="plaintext"></li></span> +<span id="LC13" class="line" lang="plaintext"></ul></span> +<span id="LC14" class="line" lang="plaintext"></li></span> +<span id="LC15" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4509:1-4509:18" dir="auto">One is not enough:</p> +<p data-sourcepos="5053:1-5053:18" dir="auto">One is not enough:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4511:1-4523:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> +<pre data-sourcepos="5055:1-5060:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> <span id="LC2" class="line" lang="plaintext"> - bar</span> <span id="LC3" class="line" lang="plaintext"> - baz</span> -<span id="LC4" class="line" lang="plaintext"> - boo</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><ul></span> -<span id="LC7" class="line" lang="plaintext"><li>foo</li></span> -<span id="LC8" class="line" lang="plaintext"><li>bar</li></span> -<span id="LC9" class="line" lang="plaintext"><li>baz</li></span> -<span id="LC10" class="line" lang="plaintext"><li>boo</li></span> -<span id="LC11" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC4" class="line" lang="plaintext"> - boo</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4526:1-4526:52" dir="auto">Here we need four, because the list marker is wider:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4528:1-4539:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">10) foo</span> -<span id="LC2" class="line" lang="plaintext"> - bar</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><ol start="10"></span> -<span id="LC5" class="line" lang="plaintext"><li>foo</span> -<span id="LC6" class="line" lang="plaintext"><ul></span> -<span id="LC7" class="line" lang="plaintext"><li>bar</li></span> -<span id="LC8" class="line" lang="plaintext"></ul></span> -<span id="LC9" class="line" lang="plaintext"></li></span> -<span id="LC10" class="line" lang="plaintext"></ol></span></code></pre> +<pre data-sourcepos="5062:1-5069:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>foo</li></span> +<span id="LC3" class="line" lang="plaintext"><li>bar</li></span> +<span id="LC4" class="line" lang="plaintext"><li>baz</li></span> +<span id="LC5" class="line" lang="plaintext"><li>boo</li></span> +<span id="LC6" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4542:1-4542:20" dir="auto">Three is not enough:</p> +<p data-sourcepos="5072:1-5072:52" dir="auto">Here we need four, because the list marker is wider:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4544:1-4554:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">10) foo</span> -<span id="LC2" class="line" lang="plaintext"> - bar</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><ol start="10"></span> -<span id="LC5" class="line" lang="plaintext"><li>foo</li></span> -<span id="LC6" class="line" lang="plaintext"></ol></span> -<span id="LC7" class="line" lang="plaintext"><ul></span> -<span id="LC8" class="line" lang="plaintext"><li>bar</li></span> -<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre> +<pre data-sourcepos="5074:1-5077:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">10) foo</span> +<span id="LC2" class="line" lang="plaintext"> - bar</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4557:1-4557:45" dir="auto">A list may be the first block in a list item:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4559:1-4569:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- - foo</span> -<span id="LC2" class="line" lang="plaintext">.</span> +<pre data-sourcepos="5079:1-5087:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol start="10"></span> +<span id="LC2" class="line" lang="plaintext"><li>foo</span> <span id="LC3" class="line" lang="plaintext"><ul></span> -<span id="LC4" class="line" lang="plaintext"><li></span> -<span id="LC5" class="line" lang="plaintext"><ul></span> -<span id="LC6" class="line" lang="plaintext"><li>foo</li></span> -<span id="LC7" class="line" lang="plaintext"></ul></span> -<span id="LC8" class="line" lang="plaintext"></li></span> -<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC4" class="line" lang="plaintext"><li>bar</li></span> +<span id="LC5" class="line" lang="plaintext"></ul></span> +<span id="LC6" class="line" lang="plaintext"></li></span> +<span id="LC7" class="line" lang="plaintext"></ol></span></code></pre> <copy-code></copy-code> </div> +<p data-sourcepos="5090:1-5090:20" dir="auto">Three is not enough:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4572:1-4586:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. - 2. foo</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><ol></span> +<pre data-sourcepos="5092:1-5095:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">10) foo</span> +<span id="LC2" class="line" lang="plaintext"> - bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5097:1-5104:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol start="10"></span> +<span id="LC2" class="line" lang="plaintext"><li>foo</li></span> +<span id="LC3" class="line" lang="plaintext"></ol></span> +<span id="LC4" class="line" lang="plaintext"><ul></span> +<span id="LC5" class="line" lang="plaintext"><li>bar</li></span> +<span id="LC6" class="line" lang="plaintext"></ul></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="5107:1-5107:45" dir="auto">A list may be the first block in a list item:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5109:1-5111:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- - foo</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5113:1-5121:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><ul></span> +<span id="LC4" class="line" lang="plaintext"><li>foo</li></span> +<span id="LC5" class="line" lang="plaintext"></ul></span> +<span id="LC6" class="line" lang="plaintext"></li></span> +<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5124:1-5126:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. - 2. foo</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5128:1-5140:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><ul></span> <span id="LC4" class="line" lang="plaintext"><li></span> -<span id="LC5" class="line" lang="plaintext"><ul></span> -<span id="LC6" class="line" lang="plaintext"><li></span> -<span id="LC7" class="line" lang="plaintext"><ol start="2"></span> -<span id="LC8" class="line" lang="plaintext"><li>foo</li></span> -<span id="LC9" class="line" lang="plaintext"></ol></span> +<span id="LC5" class="line" lang="plaintext"><ol start="2"></span> +<span id="LC6" class="line" lang="plaintext"><li>foo</li></span> +<span id="LC7" class="line" lang="plaintext"></ol></span> +<span id="LC8" class="line" lang="plaintext"></li></span> +<span id="LC9" class="line" lang="plaintext"></ul></span> <span id="LC10" class="line" lang="plaintext"></li></span> -<span id="LC11" class="line" lang="plaintext"></ul></span> -<span id="LC12" class="line" lang="plaintext"></li></span> -<span id="LC13" class="line" lang="plaintext"></ol></span></code></pre> +<span id="LC11" class="line" lang="plaintext"></ol></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4589:1-4589:34" dir="auto">A list item can contain a heading:</p> +<p data-sourcepos="5143:1-5143:34" dir="auto">A list item can contain a heading:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4591:1-4605:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- # Foo</span> +<pre data-sourcepos="5145:1-5150:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- # Foo</span> <span id="LC2" class="line" lang="plaintext">- Bar</span> <span id="LC3" class="line" lang="plaintext"> ---</span> -<span id="LC4" class="line" lang="plaintext"> baz</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><ul></span> -<span id="LC7" class="line" lang="plaintext"><li></span> -<span id="LC8" class="line" lang="plaintext"><h1>Foo</h1></span> -<span id="LC9" class="line" lang="plaintext"></li></span> -<span id="LC10" class="line" lang="plaintext"><li></span> -<span id="LC11" class="line" lang="plaintext"><h2>Bar</h2></span> -<span id="LC12" class="line" lang="plaintext">baz</li></span> -<span id="LC13" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC4" class="line" lang="plaintext"> baz</span></code></pre> <copy-code></copy-code> </div> -<h3 data-sourcepos="4608:1-4608:14" dir="auto"> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5152:1-5161:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><h1>Foo</h1></span> +<span id="LC4" class="line" lang="plaintext"></li></span> +<span id="LC5" class="line" lang="plaintext"><li></span> +<span id="LC6" class="line" lang="plaintext"><h2>Bar</h2></span> +<span id="LC7" class="line" lang="plaintext">baz</li></span> +<span id="LC8" class="line" lang="plaintext"></ul></span></code></pre> +<copy-code></copy-code> +</div> +<h3 data-sourcepos="5164:1-5164:14" dir="auto"> <a id="user-content-motivation" class="anchor" href="#motivation" aria-hidden="true"></a>Motivation</h3> -<p data-sourcepos="4610:1-4610:64" dir="auto">John Gruber's Markdown spec says the following about list items:</p> -<ol data-sourcepos="4612:1-4631:0" dir="auto"> -<li data-sourcepos="4612:1-4615:0"> -<p data-sourcepos="4612:4-4614:20">"List markers typically start at the left margin, but may be indented +<p data-sourcepos="5166:1-5166:64" dir="auto">John Gruber's Markdown spec says the following about list items:</p> +<ol data-sourcepos="5168:1-5187:0" dir="auto"> +<li data-sourcepos="5168:1-5171:0"> +<p data-sourcepos="5168:4-5170:20">"List markers typically start at the left margin, but may be indented by up to three spaces. List markers must be followed by one or more spaces or a tab."</p> </li> -<li data-sourcepos="4616:1-4618:0"> -<p data-sourcepos="4616:4-4617:48">"To make lists look nice, you can wrap items with hanging indents.... +<li data-sourcepos="5172:1-5174:0"> +<p data-sourcepos="5172:4-5173:48">"To make lists look nice, you can wrap items with hanging indents.... But if you don't want to, you don't have to."</p> </li> -<li data-sourcepos="4619:1-4622:0"> -<p data-sourcepos="4619:4-4621:8">"List items may consist of multiple paragraphs. Each subsequent +<li data-sourcepos="5175:1-5178:0"> +<p data-sourcepos="5175:4-5177:8">"List items may consist of multiple paragraphs. Each subsequent paragraph in a list item must be indented by either 4 spaces or one tab."</p> </li> -<li data-sourcepos="4623:1-4625:0"> -<p data-sourcepos="4623:4-4624:55">"It looks nice if you indent every line of the subsequent paragraphs, +<li data-sourcepos="5179:1-5181:0"> +<p data-sourcepos="5179:4-5180:55">"It looks nice if you indent every line of the subsequent paragraphs, but here again, Markdown will allow you to be lazy."</p> </li> -<li data-sourcepos="4626:1-4628:0"> -<p data-sourcepos="4626:4-4627:35">"To put a blockquote within a list item, the blockquote's <code>></code> +<li data-sourcepos="5182:1-5184:0"> +<p data-sourcepos="5182:4-5183:35">"To put a blockquote within a list item, the blockquote's <code>></code> delimiters need to be indented."</p> </li> -<li data-sourcepos="4629:1-4631:0"> -<p data-sourcepos="4629:4-4630:44">"To put a code block within a list item, the code block needs to be +<li data-sourcepos="5185:1-5187:0"> +<p data-sourcepos="5185:4-5186:44">"To put a code block within a list item, the code block needs to be indented twice — 8 spaces or two tabs."</p> </li> </ol> -<p data-sourcepos="4632:1-4641:18" dir="auto">These rules specify that a paragraph under a list item must be indented +<p data-sourcepos="5188:1-5197:18" dir="auto">These rules specify that a paragraph under a list item must be indented four spaces (presumably, from the left margin, rather than the start of the list marker, but this is not said), and that code under a list item must be indented eight spaces instead of the usual four. They also say @@ -4132,7 +4690,7 @@ about other kinds of block-level content, it is certainly reasonable to infer that <em>all</em> block elements under a list item, including other lists, must be indented four spaces. This principle has been called the <em>four-space rule</em>.</p> -<p data-sourcepos="4643:1-4654:48" dir="auto">The four-space rule is clear and principled, and if the reference +<p data-sourcepos="5199:1-5210:48" dir="auto">The four-space rule is clear and principled, and if the reference implementation <code>Markdown.pl</code> had followed it, it probably would have become the standard. However, <code>Markdown.pl</code> allowed paragraphs and sublists to start with only two spaces indentation, at least on the @@ -4144,33 +4702,33 @@ determining what comes under a list item. (Pandoc and python-Markdown, for example, stuck with Gruber's syntax description and the four-space rule, while discount, redcarpet, marked, PHP Markdown, and others followed <code>Markdown.pl</code>'s behavior more closely.)</p> -<p data-sourcepos="4656:1-4661:45" dir="auto">Unfortunately, given the divergences between implementations, there +<p data-sourcepos="5212:1-5217:45" dir="auto">Unfortunately, given the divergences between implementations, there is no way to give a spec for list items that will be guaranteed not to break any existing documents. However, the spec given here should correctly handle lists formatted with either the four-space rule or the more forgiving <code>Markdown.pl</code> behavior, provided they are laid out in a way that is natural for a human to read.</p> -<p data-sourcepos="4663:1-4669:22" dir="auto">The strategy here is to let the width and indentation of the list marker +<p data-sourcepos="5219:1-5225:22" dir="auto">The strategy here is to let the width and indentation of the list marker determine the indentation necessary for blocks to fall under the list item, rather than having a fixed and arbitrary number. The writer can think of the body of the list item as a unit which gets indented to the right enough to fit the list marker (and any indentation on the list marker). (The laziness rule, #5, then allows continuation lines to be unindented if needed.)</p> -<p data-sourcepos="4671:1-4673:39" dir="auto">This rule is superior, we claim, to any rule requiring a fixed level of +<p data-sourcepos="5227:1-5229:39" dir="auto">This rule is superior, we claim, to any rule requiring a fixed level of indentation from the margin. The four-space rule is clear but unnatural. It is quite unintuitive that</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4675:1-4681:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="p">-</span> foo</span> +<pre data-sourcepos="5231:1-5237:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="p">-</span> foo</span> <span id="LC2" class="line" lang="markdown"></span> <span id="LC3" class="line" lang="markdown"> bar</span> <span id="LC4" class="line" lang="markdown"></span> <span id="LC5" class="line" lang="markdown"><span class="p"> -</span> baz</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4683:1-4683:60" dir="auto">should be parsed as two lists with an intervening paragraph,</p> +<p data-sourcepos="5239:1-5239:60" dir="auto">should be parsed as two lists with an intervening paragraph,</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4685:1-4693:3" class="code highlight js-syntax-highlight language-html" lang="html" v-pre="true"><code><span id="LC1" class="line" lang="html"><span class="nt"><ul></span></span> +<pre data-sourcepos="5241:1-5249:3" class="code highlight js-syntax-highlight language-html" lang="html" v-pre="true"><code><span id="LC1" class="line" lang="html"><span class="nt"><ul></span></span> <span id="LC2" class="line" lang="html"><span class="nt"><li></span>foo<span class="nt"></li></span></span> <span id="LC3" class="line" lang="html"><span class="nt"></ul></span></span> <span id="LC4" class="line" lang="html"><span class="nt"><p></span>bar<span class="nt"></p></span></span> @@ -4179,9 +4737,9 @@ unnatural. It is quite unintuitive that</p> <span id="LC7" class="line" lang="html"><span class="nt"></ul></span></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4695:1-4695:58" dir="auto">as the four-space rule demands, rather than a single list,</p> +<p data-sourcepos="5251:1-5251:58" dir="auto">as the four-space rule demands, rather than a single list,</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4697:1-4707:3" class="code highlight js-syntax-highlight language-html" lang="html" v-pre="true"><code><span id="LC1" class="line" lang="html"><span class="nt"><ul></span></span> +<pre data-sourcepos="5253:1-5263:3" class="code highlight js-syntax-highlight language-html" lang="html" v-pre="true"><code><span id="LC1" class="line" lang="html"><span class="nt"><ul></span></span> <span id="LC2" class="line" lang="html"><span class="nt"><li></span></span> <span id="LC3" class="line" lang="html"><span class="nt"><p></span>foo<span class="nt"></p></span></span> <span id="LC4" class="line" lang="html"><span class="nt"><p></span>bar<span class="nt"></p></span></span> @@ -4192,22 +4750,22 @@ unnatural. It is quite unintuitive that</p> <span id="LC9" class="line" lang="html"><span class="nt"></ul></span></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4709:1-4710:62" dir="auto">The choice of four spaces is arbitrary. It can be learned, but it is +<p data-sourcepos="5265:1-5266:62" dir="auto">The choice of four spaces is arbitrary. It can be learned, but it is not likely to be guessed, and it trips up beginners regularly.</p> -<p data-sourcepos="4712:1-4716:20" dir="auto">Would it help to adopt a two-space rule? The problem is that such +<p data-sourcepos="5268:1-5272:20" dir="auto">Would it help to adopt a two-space rule? The problem is that such a rule, together with the rule allowing 1--3 spaces indentation of the initial list marker, allows text that is indented <em>less than</em> the original list marker to be included in the list item. For example, <code>Markdown.pl</code> parses</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4718:1-4722:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="p"> -</span> one</span> +<pre data-sourcepos="5274:1-5278:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="p"> -</span> one</span> <span id="LC2" class="line" lang="markdown"></span> <span id="LC3" class="line" lang="markdown"> two</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4724:1-4724:59" dir="auto">as a single list item, with <code>two</code> a continuation paragraph:</p> +<p data-sourcepos="5280:1-5280:59" dir="auto">as a single list item, with <code>two</code> a continuation paragraph:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4726:1-4733:3" class="code highlight js-syntax-highlight language-html" lang="html" v-pre="true"><code><span id="LC1" class="line" lang="html"><span class="nt"><ul></span></span> +<pre data-sourcepos="5282:1-5289:3" class="code highlight js-syntax-highlight language-html" lang="html" v-pre="true"><code><span id="LC1" class="line" lang="html"><span class="nt"><ul></span></span> <span id="LC2" class="line" lang="html"><span class="nt"><li></span></span> <span id="LC3" class="line" lang="html"><span class="nt"><p></span>one<span class="nt"></p></span></span> <span id="LC4" class="line" lang="html"><span class="nt"><p></span>two<span class="nt"></p></span></span> @@ -4215,16 +4773,16 @@ original list marker to be included in the list item. For example, <span id="LC6" class="line" lang="html"><span class="nt"></ul></span></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4735:1-4735:13" dir="auto">and similarly</p> +<p data-sourcepos="5291:1-5291:13" dir="auto">and similarly</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4737:1-4741:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="gt">> - one</span></span> +<pre data-sourcepos="5293:1-5297:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="gt">> - one</span></span> <span id="LC2" class="line" lang="markdown"><span class="gt">></span></span> <span id="LC3" class="line" lang="markdown"><span class="gt">> two</span></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4743:1-4743:2" dir="auto">as</p> +<p data-sourcepos="5299:1-5299:2" dir="auto">as</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4745:1-4754:3" class="code highlight js-syntax-highlight language-html" lang="html" v-pre="true"><code><span id="LC1" class="line" lang="html"><span class="nt"><blockquote></span></span> +<pre data-sourcepos="5301:1-5310:3" class="code highlight js-syntax-highlight language-html" lang="html" v-pre="true"><code><span id="LC1" class="line" lang="html"><span class="nt"><blockquote></span></span> <span id="LC2" class="line" lang="html"><span class="nt"><ul></span></span> <span id="LC3" class="line" lang="html"><span class="nt"><li></span></span> <span id="LC4" class="line" lang="html"><span class="nt"><p></span>one<span class="nt"></p></span></span> @@ -4234,33 +4792,33 @@ original list marker to be included in the list item. For example, <span id="LC8" class="line" lang="html"><span class="nt"></blockquote></span></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4756:1-4756:30" dir="auto">This is extremely unintuitive.</p> -<p data-sourcepos="4758:1-4763:52" dir="auto">Rather than requiring a fixed indent from the margin, we could require +<p data-sourcepos="5312:1-5312:30" dir="auto">This is extremely unintuitive.</p> +<p data-sourcepos="5314:1-5319:52" dir="auto">Rather than requiring a fixed indent from the margin, we could require a fixed indent (say, two spaces, or even one space) from the list marker (which may itself be indented). This proposal would remove the last anomaly discussed. Unlike the spec presented above, it would count the following as a list item with a subparagraph, even though the paragraph <code>bar</code> is not indented as far as the first paragraph <code>foo</code>:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4765:1-4769:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="p"> 10.</span> foo</span> +<pre data-sourcepos="5321:1-5325:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="p"> 10.</span> foo</span> <span id="LC2" class="line" lang="markdown"></span> <span id="LC3" class="line" lang="markdown"> bar </span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4771:1-4774:62" dir="auto">Arguably this text does read like a list item with <code>bar</code> as a subparagraph, +<p data-sourcepos="5327:1-5330:62" dir="auto">Arguably this text does read like a list item with <code>bar</code> as a subparagraph, which may count in favor of the proposal. However, on this proposal indented code would have to be indented six spaces after the list marker. And this would break a lot of existing Markdown, which has the pattern:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4776:1-4780:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="p">1.</span> foo</span> +<pre data-sourcepos="5332:1-5336:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="p">1.</span> foo</span> <span id="LC2" class="line" lang="markdown"></span> <span id="LC3" class="line" lang="markdown"><span class="sb"> indented code</span></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4782:1-4784:28" dir="auto">where the code is indented eight spaces. The spec above, by contrast, will +<p data-sourcepos="5338:1-5340:28" dir="auto">where the code is indented eight spaces. The spec above, by contrast, will parse this text as expected, since the code block's indentation is measured from the beginning of <code>foo</code>.</p> -<p data-sourcepos="4786:1-4792:62" dir="auto">The one case that needs special treatment is a list item that <em>starts</em> +<p data-sourcepos="5342:1-5348:62" dir="auto">The one case that needs special treatment is a list item that <em>starts</em> with indented code. How much indentation is required in that case, since we don't have a "first paragraph" to measure from? Rule #2 simply stipulates that in such cases, we require one space indentation from the list marker @@ -4268,272 +4826,292 @@ that in such cases, we require one space indentation from the list marker four-space rule in cases where the list marker plus its initial indentation takes four spaces (a common case), but diverge in other cases.</p> <div> -<h2 data-sourcepos="4796:1-4796:30"> +<h2 data-sourcepos="5352:1-5352:30"> <a id="user-content-task-list-items-extension" class="anchor" href="#task-list-items-extension" aria-hidden="true"></a>Task list items (extension)</h2> -<p data-sourcepos="4798:1-4799:26">GFM enables the <code>tasklist</code> extension, where an additional processing step is +<p data-sourcepos="5354:1-5355:26">GFM enables the <code>tasklist</code> extension, where an additional processing step is performed on [list items].</p> -<p data-sourcepos="4801:1-4803:46">A <a href="@">task list item</a> is a [list item][list items] where the first block in it +<p data-sourcepos="5357:1-5359:46">A <a href="@">task list item</a> is a [list item][list items] where the first block in it is a paragraph which begins with a [task list item marker] and at least one whitespace character before any other content.</p> -<p data-sourcepos="4805:1-4807:55">A <a href="@">task list item marker</a> consists of an optional number of spaces, a left +<p data-sourcepos="5361:1-5363:55">A <a href="@">task list item marker</a> consists of an optional number of spaces, a left bracket (<code>[</code>), either a whitespace character or the letter <code>x</code> in either lowercase or uppercase, and then a right bracket (<code>]</code>).</p> -<p data-sourcepos="4809:1-4810:70">When rendered, the [task list item marker] is replaced with a semantic checkbox element; +<p data-sourcepos="5365:1-5366:70">When rendered, the [task list item marker] is replaced with a semantic checkbox element; in an HTML output, this would be an <code><input type="checkbox"></code> element.</p> -<p data-sourcepos="4812:1-4813:50">If the character between the brackets is a whitespace character, the checkbox +<p data-sourcepos="5368:1-5369:50">If the character between the brackets is a whitespace character, the checkbox is unchecked. Otherwise, the checkbox is checked.</p> -<p data-sourcepos="4815:1-4818:28">This spec does not define how the checkbox elements are interacted with: in practice, +<p data-sourcepos="5371:1-5374:28">This spec does not define how the checkbox elements are interacted with: in practice, implementors are free to render the checkboxes as disabled or inmutable elements, or they may dynamically handle dynamic interactions (i.e. checking, unchecking) in the final rendered document.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4820:1-4828:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [ ] foo</span> -<span id="LC2" class="line" lang="plaintext">- [x] bar</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><ul></span> -<span id="LC5" class="line" lang="plaintext"><li><input disabled="" type="checkbox"> foo</li></span> -<span id="LC6" class="line" lang="plaintext"><li><input checked="" disabled="" type="checkbox"> bar</li></span> -<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre> +<pre data-sourcepos="5376:1-5379:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [ ] foo</span> +<span id="LC2" class="line" lang="plaintext">- [x] bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5381:1-5386:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li><input disabled="" type="checkbox"> foo</li></span> +<span id="LC3" class="line" lang="plaintext"><li><input checked="" disabled="" type="checkbox"> bar</li></span> +<span id="LC4" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4830:1-4830:37">Task lists can be arbitrarily nested:</p> +<p data-sourcepos="5388:1-5388:37">Task lists can be arbitrarily nested:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4832:1-4847:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [x] foo</span> +<pre data-sourcepos="5390:1-5395:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [x] foo</span> <span id="LC2" class="line" lang="plaintext"> - [ ] bar</span> <span id="LC3" class="line" lang="plaintext"> - [x] baz</span> -<span id="LC4" class="line" lang="plaintext">- [ ] bim</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><ul></span> -<span id="LC7" class="line" lang="plaintext"><li><input checked="" disabled="" type="checkbox"> foo</span> -<span id="LC8" class="line" lang="plaintext"><ul></span> -<span id="LC9" class="line" lang="plaintext"><li><input disabled="" type="checkbox"> bar</li></span> -<span id="LC10" class="line" lang="plaintext"><li><input checked="" disabled="" type="checkbox"> baz</li></span> -<span id="LC11" class="line" lang="plaintext"></ul></span> -<span id="LC12" class="line" lang="plaintext"></li></span> -<span id="LC13" class="line" lang="plaintext"><li><input disabled="" type="checkbox"> bim</li></span> -<span id="LC14" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC4" class="line" lang="plaintext">- [ ] bim</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5397:1-5407:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li><input checked="" disabled="" type="checkbox"> foo</span> +<span id="LC3" class="line" lang="plaintext"><ul></span> +<span id="LC4" class="line" lang="plaintext"><li><input disabled="" type="checkbox"> bar</li></span> +<span id="LC5" class="line" lang="plaintext"><li><input checked="" disabled="" type="checkbox"> baz</li></span> +<span id="LC6" class="line" lang="plaintext"></ul></span> +<span id="LC7" class="line" lang="plaintext"></li></span> +<span id="LC8" class="line" lang="plaintext"><li><input disabled="" type="checkbox"> bim</li></span> +<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> </div> -<h2 data-sourcepos="4851:1-4851:8" dir="auto"> +<h2 data-sourcepos="5411:1-5411:8" dir="auto"> <a id="user-content-lists" class="anchor" href="#lists" aria-hidden="true"></a>Lists</h2> -<p data-sourcepos="4853:1-4855:46" dir="auto">A <a href="@">list</a> is a sequence of one or more +<p data-sourcepos="5413:1-5415:46" dir="auto">A <a href="@">list</a> is a sequence of one or more list items [of the same type]. The list items may be separated by any number of blank lines.</p> -<p data-sourcepos="4857:1-4862:30" dir="auto">Two list items are <a href="@">of the same type</a> +<p data-sourcepos="5417:1-5422:30" dir="auto">Two list items are <a href="@">of the same type</a> if they begin with a [list marker] of the same type. Two list markers are of the same type if (a) they are bullet list markers using the same character (<code>-</code>, <code>+</code>, or <code>*</code>) or (b) they are ordered list numbers with the same delimiter (either <code>.</code> or <code>)</code>).</p> -<p data-sourcepos="4864:1-4868:39" dir="auto">A list is an <a href="@">ordered list</a> +<p data-sourcepos="5424:1-5428:39" dir="auto">A list is an <a href="@">ordered list</a> if its constituent list items begin with [ordered list markers], and a <a href="@">bullet list</a> if its constituent list items begin with [bullet list markers].</p> -<p data-sourcepos="4870:1-4873:12" dir="auto">The <a href="@">start number</a> +<p data-sourcepos="5430:1-5433:12" dir="auto">The <a href="@">start number</a> of an [ordered list] is determined by the list number of its initial list item. The numbers of subsequent list items are disregarded.</p> -<p data-sourcepos="4875:1-4880:65" dir="auto">A list is <a href="@">loose</a> if any of its constituent +<p data-sourcepos="5435:1-5440:65" dir="auto">A list is <a href="@">loose</a> if any of its constituent list items are separated by blank lines, or if any of its constituent list items directly contain two block-level elements with a blank line between them. Otherwise a list is <a href="@">tight</a>. (The difference in HTML output is that paragraphs in a loose list are wrapped in <code><p></code> tags, while paragraphs in a tight list are not.)</p> -<p data-sourcepos="4882:1-4882:64" dir="auto">Changing the bullet or ordered list delimiter starts a new list:</p> +<p data-sourcepos="5442:1-5442:64" dir="auto">Changing the bullet or ordered list delimiter starts a new list:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4884:1-4896:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> +<pre data-sourcepos="5444:1-5448:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> <span id="LC2" class="line" lang="plaintext">- bar</span> -<span id="LC3" class="line" lang="plaintext">+ baz</span> -<span id="LC4" class="line" lang="plaintext">.</span> +<span id="LC3" class="line" lang="plaintext">+ baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5450:1-5458:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>foo</li></span> +<span id="LC3" class="line" lang="plaintext"><li>bar</li></span> +<span id="LC4" class="line" lang="plaintext"></ul></span> <span id="LC5" class="line" lang="plaintext"><ul></span> -<span id="LC6" class="line" lang="plaintext"><li>foo</li></span> -<span id="LC7" class="line" lang="plaintext"><li>bar</li></span> -<span id="LC8" class="line" lang="plaintext"></ul></span> -<span id="LC9" class="line" lang="plaintext"><ul></span> -<span id="LC10" class="line" lang="plaintext"><li>baz</li></span> -<span id="LC11" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC6" class="line" lang="plaintext"><li>baz</li></span> +<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4899:1-4911:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. foo</span> +<pre data-sourcepos="5461:1-5465:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. foo</span> <span id="LC2" class="line" lang="plaintext">2. bar</span> -<span id="LC3" class="line" lang="plaintext">3) baz</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><ol></span> -<span id="LC6" class="line" lang="plaintext"><li>foo</li></span> -<span id="LC7" class="line" lang="plaintext"><li>bar</li></span> -<span id="LC8" class="line" lang="plaintext"></ol></span> -<span id="LC9" class="line" lang="plaintext"><ol start="3"></span> -<span id="LC10" class="line" lang="plaintext"><li>baz</li></span> -<span id="LC11" class="line" lang="plaintext"></ol></span></code></pre> +<span id="LC3" class="line" lang="plaintext">3) baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5467:1-5475:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span> +<span id="LC2" class="line" lang="plaintext"><li>foo</li></span> +<span id="LC3" class="line" lang="plaintext"><li>bar</li></span> +<span id="LC4" class="line" lang="plaintext"></ol></span> +<span id="LC5" class="line" lang="plaintext"><ol start="3"></span> +<span id="LC6" class="line" lang="plaintext"><li>baz</li></span> +<span id="LC7" class="line" lang="plaintext"></ol></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4914:1-4916:5" dir="auto">In CommonMark, a list can interrupt a paragraph. That is, +<p data-sourcepos="5478:1-5480:5" dir="auto">In CommonMark, a list can interrupt a paragraph. That is, no blank line is needed to separate a paragraph from a following list:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4918:1-4928:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> +<pre data-sourcepos="5482:1-5486:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo</span> <span id="LC2" class="line" lang="plaintext">- bar</span> -<span id="LC3" class="line" lang="plaintext">- baz</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>Foo</p></span> -<span id="LC6" class="line" lang="plaintext"><ul></span> -<span id="LC7" class="line" lang="plaintext"><li>bar</li></span> -<span id="LC8" class="line" lang="plaintext"><li>baz</li></span> -<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC3" class="line" lang="plaintext">- baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5488:1-5494:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo</p></span> +<span id="LC2" class="line" lang="plaintext"><ul></span> +<span id="LC3" class="line" lang="plaintext"><li>bar</li></span> +<span id="LC4" class="line" lang="plaintext"><li>baz</li></span> +<span id="LC5" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4930:1-4931:37" dir="auto"><code>Markdown.pl</code> does not allow this, through fear of triggering a list +<p data-sourcepos="5496:1-5497:37" dir="auto"><code>Markdown.pl</code> does not allow this, through fear of triggering a list via a numeral in a hard-wrapped line:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4933:1-4936:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown">The number of windows in my house is</span> +<pre data-sourcepos="5499:1-5502:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown">The number of windows in my house is</span> <span id="LC2" class="line" lang="markdown"><span class="p">14.</span> The number of doors is 6.</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4938:1-4940:6" dir="auto">Oddly, though, <code>Markdown.pl</code> <em>does</em> allow a blockquote to +<p data-sourcepos="5504:1-5506:6" dir="auto">Oddly, though, <code>Markdown.pl</code> <em>does</em> allow a blockquote to interrupt a paragraph, even though the same considerations might apply.</p> -<p data-sourcepos="4942:1-4944:35" dir="auto">In CommonMark, we do allow lists to interrupt paragraphs, for +<p data-sourcepos="5508:1-5510:35" dir="auto">In CommonMark, we do allow lists to interrupt paragraphs, for two reasons. First, it is natural and not uncommon for people to start lists without blank lines:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4946:1-4951:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown">I need to buy</span> +<pre data-sourcepos="5512:1-5517:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown">I need to buy</span> <span id="LC2" class="line" lang="markdown"><span class="p">-</span> new shoes</span> <span id="LC3" class="line" lang="markdown"><span class="p">-</span> a coat</span> <span id="LC4" class="line" lang="markdown"><span class="p">-</span> a plane ticket</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4953:1-4953:29" dir="auto">Second, we are attracted to a</p> -<blockquote data-sourcepos="4955:1-4958:54" dir="auto"> -<p data-sourcepos="4955:3-4958:54"><a href="@">principle of uniformity</a>: +<p data-sourcepos="5519:1-5519:29" dir="auto">Second, we are attracted to a</p> +<blockquote data-sourcepos="5521:1-5524:54" dir="auto"> +<p data-sourcepos="5521:3-5524:54"><a href="@">principle of uniformity</a>: if a chunk of text has a certain meaning, it will continue to have the same meaning when put into a container block (such as a list item or blockquote).</p> </blockquote> -<p data-sourcepos="4960:1-4961:47" dir="auto">(Indeed, the spec for [list items] and [block quotes] presupposes +<p data-sourcepos="5526:1-5527:47" dir="auto">(Indeed, the spec for [list items] and [block quotes] presupposes this principle.) This principle implies that if</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4963:1-4968:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="p"> *</span> I need to buy</span> +<pre data-sourcepos="5529:1-5534:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="p"> *</span> I need to buy</span> <span id="LC2" class="line" lang="markdown"><span class="p"> -</span> new shoes</span> <span id="LC3" class="line" lang="markdown"><span class="p"> -</span> a coat</span> <span id="LC4" class="line" lang="markdown"><span class="p"> -</span> a plane ticket</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4970:1-4973:4" dir="auto">is a list item containing a paragraph followed by a nested sublist, +<p data-sourcepos="5536:1-5539:4" dir="auto">is a list item containing a paragraph followed by a nested sublist, as all Markdown implementations agree it is (though the paragraph may be rendered without <code><p></code> tags, since the list is "tight"), then</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4975:1-4980:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown">I need to buy</span> +<pre data-sourcepos="5541:1-5546:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown">I need to buy</span> <span id="LC2" class="line" lang="markdown"><span class="p">-</span> new shoes</span> <span id="LC3" class="line" lang="markdown"><span class="p">-</span> a coat</span> <span id="LC4" class="line" lang="markdown"><span class="p">-</span> a plane ticket</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="4982:1-4982:61" dir="auto">by itself should be a paragraph followed by a nested sublist.</p> -<p data-sourcepos="4984:1-4989:30" dir="auto">Since it is well established Markdown practice to allow lists to +<p data-sourcepos="5548:1-5548:61" dir="auto">by itself should be a paragraph followed by a nested sublist.</p> +<p data-sourcepos="5550:1-5555:30" dir="auto">Since it is well established Markdown practice to allow lists to interrupt paragraphs inside list items, the [principle of uniformity] requires us to allow this outside list items as well. (<a href="http://docutils.sourceforge.net/rst.html" rel="nofollow noreferrer noopener" target="_blank">reStructuredText</a> takes a different approach, requiring blank lines before lists even inside other list items.)</p> -<p data-sourcepos="4991:1-4993:28" dir="auto">In order to solve of unwanted lists in paragraphs with +<p data-sourcepos="5557:1-5559:28" dir="auto">In order to solve of unwanted lists in paragraphs with hard-wrapped numerals, we allow only lists starting with <code>1</code> to interrupt paragraphs. Thus,</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4995:1-5001:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">The number of windows in my house is</span> -<span id="LC2" class="line" lang="plaintext">14. The number of doors is 6.</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>The number of windows in my house is</span> -<span id="LC5" class="line" lang="plaintext">14. The number of doors is 6.</p></span></code></pre> +<pre data-sourcepos="5561:1-5564:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">The number of windows in my house is</span> +<span id="LC2" class="line" lang="plaintext">14. The number of doors is 6.</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5003:1-5003:51" dir="auto">We may still get an unintended result in cases like</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5005:1-5013:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">The number of windows in my house is</span> -<span id="LC2" class="line" lang="plaintext">1. The number of doors is 6.</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>The number of windows in my house is</p></span> -<span id="LC5" class="line" lang="plaintext"><ol></span> -<span id="LC6" class="line" lang="plaintext"><li>The number of doors is 6.</li></span> -<span id="LC7" class="line" lang="plaintext"></ol></span></code></pre> +<pre data-sourcepos="5566:1-5569:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>The number of windows in my house is</span> +<span id="LC2" class="line" lang="plaintext">14. The number of doors is 6.</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="5571:1-5571:51" dir="auto">We may still get an unintended result in cases like</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5573:1-5576:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">The number of windows in my house is</span> +<span id="LC2" class="line" lang="plaintext">1. The number of doors is 6.</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5015:1-5015:57" dir="auto">but this rule should prevent most spurious list captures.</p> -<p data-sourcepos="5017:1-5017:53" dir="auto">There can be any number of blank lines between items:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5019:1-5038:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> +<pre data-sourcepos="5578:1-5583:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>The number of windows in my house is</p></span> +<span id="LC2" class="line" lang="plaintext"><ol></span> +<span id="LC3" class="line" lang="plaintext"><li>The number of doors is 6.</li></span> +<span id="LC4" class="line" lang="plaintext"></ol></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="5585:1-5585:57" dir="auto">but this rule should prevent most spurious list captures.</p> +<p data-sourcepos="5587:1-5587:53" dir="auto">There can be any number of blank lines between items:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5589:1-5596:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext">- bar</span> <span id="LC4" class="line" lang="plaintext"></span> <span id="LC5" class="line" lang="plaintext"></span> -<span id="LC6" class="line" lang="plaintext">- baz</span> -<span id="LC7" class="line" lang="plaintext">.</span> -<span id="LC8" class="line" lang="plaintext"><ul></span> -<span id="LC9" class="line" lang="plaintext"><li></span> -<span id="LC10" class="line" lang="plaintext"><p>foo</p></span> -<span id="LC11" class="line" lang="plaintext"></li></span> -<span id="LC12" class="line" lang="plaintext"><li></span> -<span id="LC13" class="line" lang="plaintext"><p>bar</p></span> -<span id="LC14" class="line" lang="plaintext"></li></span> -<span id="LC15" class="line" lang="plaintext"><li></span> -<span id="LC16" class="line" lang="plaintext"><p>baz</p></span> -<span id="LC17" class="line" lang="plaintext"></li></span> -<span id="LC18" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC6" class="line" lang="plaintext">- baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5598:1-5610:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>foo</p></span> +<span id="LC4" class="line" lang="plaintext"></li></span> +<span id="LC5" class="line" lang="plaintext"><li></span> +<span id="LC6" class="line" lang="plaintext"><p>bar</p></span> +<span id="LC7" class="line" lang="plaintext"></li></span> +<span id="LC8" class="line" lang="plaintext"><li></span> +<span id="LC9" class="line" lang="plaintext"><p>baz</p></span> +<span id="LC10" class="line" lang="plaintext"></li></span> +<span id="LC11" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5040:1-5062:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> +<pre data-sourcepos="5612:1-5619:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> <span id="LC2" class="line" lang="plaintext"> - bar</span> <span id="LC3" class="line" lang="plaintext"> - baz</span> <span id="LC4" class="line" lang="plaintext"></span> <span id="LC5" class="line" lang="plaintext"></span> -<span id="LC6" class="line" lang="plaintext"> bim</span> -<span id="LC7" class="line" lang="plaintext">.</span> -<span id="LC8" class="line" lang="plaintext"><ul></span> -<span id="LC9" class="line" lang="plaintext"><li>foo</span> -<span id="LC10" class="line" lang="plaintext"><ul></span> -<span id="LC11" class="line" lang="plaintext"><li>bar</span> -<span id="LC12" class="line" lang="plaintext"><ul></span> -<span id="LC13" class="line" lang="plaintext"><li></span> -<span id="LC14" class="line" lang="plaintext"><p>baz</p></span> -<span id="LC15" class="line" lang="plaintext"><p>bim</p></span> -<span id="LC16" class="line" lang="plaintext"></li></span> -<span id="LC17" class="line" lang="plaintext"></ul></span> -<span id="LC18" class="line" lang="plaintext"></li></span> -<span id="LC19" class="line" lang="plaintext"></ul></span> -<span id="LC20" class="line" lang="plaintext"></li></span> -<span id="LC21" class="line" lang="plaintext"></ul></span></code></pre> -<copy-code></copy-code> -</div> -<p data-sourcepos="5065:1-5068:8" dir="auto">To separate consecutive lists of the same type, or to separate a +<span id="LC6" class="line" lang="plaintext"> bim</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5621:1-5636:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>foo</span> +<span id="LC3" class="line" lang="plaintext"><ul></span> +<span id="LC4" class="line" lang="plaintext"><li>bar</span> +<span id="LC5" class="line" lang="plaintext"><ul></span> +<span id="LC6" class="line" lang="plaintext"><li></span> +<span id="LC7" class="line" lang="plaintext"><p>baz</p></span> +<span id="LC8" class="line" lang="plaintext"><p>bim</p></span> +<span id="LC9" class="line" lang="plaintext"></li></span> +<span id="LC10" class="line" lang="plaintext"></ul></span> +<span id="LC11" class="line" lang="plaintext"></li></span> +<span id="LC12" class="line" lang="plaintext"></ul></span> +<span id="LC13" class="line" lang="plaintext"></li></span> +<span id="LC14" class="line" lang="plaintext"></ul></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="5639:1-5642:8" dir="auto">To separate consecutive lists of the same type, or to separate a list from an indented code block that would otherwise be parsed as a subparagraph of the final list item, you can insert a blank HTML comment:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5070:1-5088:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> +<pre data-sourcepos="5644:1-5652:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> <span id="LC2" class="line" lang="plaintext">- bar</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext"><!-- --></span> <span id="LC5" class="line" lang="plaintext"></span> <span id="LC6" class="line" lang="plaintext">- baz</span> -<span id="LC7" class="line" lang="plaintext">- bim</span> -<span id="LC8" class="line" lang="plaintext">.</span> -<span id="LC9" class="line" lang="plaintext"><ul></span> -<span id="LC10" class="line" lang="plaintext"><li>foo</li></span> -<span id="LC11" class="line" lang="plaintext"><li>bar</li></span> -<span id="LC12" class="line" lang="plaintext"></ul></span> -<span id="LC13" class="line" lang="plaintext"><!-- --></span> -<span id="LC14" class="line" lang="plaintext"><ul></span> -<span id="LC15" class="line" lang="plaintext"><li>baz</li></span> -<span id="LC16" class="line" lang="plaintext"><li>bim</li></span> -<span id="LC17" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC7" class="line" lang="plaintext">- bim</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5654:1-5664:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>foo</li></span> +<span id="LC3" class="line" lang="plaintext"><li>bar</li></span> +<span id="LC4" class="line" lang="plaintext"></ul></span> +<span id="LC5" class="line" lang="plaintext"><!-- --></span> +<span id="LC6" class="line" lang="plaintext"><ul></span> +<span id="LC7" class="line" lang="plaintext"><li>baz</li></span> +<span id="LC8" class="line" lang="plaintext"><li>bim</li></span> +<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5091:1-5114:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> +<pre data-sourcepos="5667:1-5677:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- foo</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext"> notcode</span> <span id="LC4" class="line" lang="plaintext"></span> @@ -4541,394 +5119,436 @@ comment:</p> <span id="LC6" class="line" lang="plaintext"></span> <span id="LC7" class="line" lang="plaintext"><!-- --></span> <span id="LC8" class="line" lang="plaintext"></span> -<span id="LC9" class="line" lang="plaintext"> code</span> -<span id="LC10" class="line" lang="plaintext">.</span> -<span id="LC11" class="line" lang="plaintext"><ul></span> -<span id="LC12" class="line" lang="plaintext"><li></span> -<span id="LC13" class="line" lang="plaintext"><p>foo</p></span> -<span id="LC14" class="line" lang="plaintext"><p>notcode</p></span> -<span id="LC15" class="line" lang="plaintext"></li></span> -<span id="LC16" class="line" lang="plaintext"><li></span> -<span id="LC17" class="line" lang="plaintext"><p>foo</p></span> -<span id="LC18" class="line" lang="plaintext"></li></span> -<span id="LC19" class="line" lang="plaintext"></ul></span> -<span id="LC20" class="line" lang="plaintext"><!-- --></span> -<span id="LC21" class="line" lang="plaintext"><pre><code>code</span> -<span id="LC22" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC9" class="line" lang="plaintext"> code</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5679:1-5692:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>foo</p></span> +<span id="LC4" class="line" lang="plaintext"><p>notcode</p></span> +<span id="LC5" class="line" lang="plaintext"></li></span> +<span id="LC6" class="line" lang="plaintext"><li></span> +<span id="LC7" class="line" lang="plaintext"><p>foo</p></span> +<span id="LC8" class="line" lang="plaintext"></li></span> +<span id="LC9" class="line" lang="plaintext"></ul></span> +<span id="LC10" class="line" lang="plaintext"><!-- --></span> +<span id="LC11" class="line" lang="plaintext"><pre><code>code</span> +<span id="LC12" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5117:1-5120:5" dir="auto">List items need not be indented to the same level. The following +<p data-sourcepos="5695:1-5698:5" dir="auto">List items need not be indented to the same level. The following list items will be treated as items at the same list level, since none is indented enough to belong to the previous list item:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5122:1-5140:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span> +<pre data-sourcepos="5700:1-5708:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span> <span id="LC2" class="line" lang="plaintext"> - b</span> <span id="LC3" class="line" lang="plaintext"> - c</span> <span id="LC4" class="line" lang="plaintext"> - d</span> <span id="LC5" class="line" lang="plaintext"> - e</span> <span id="LC6" class="line" lang="plaintext"> - f</span> -<span id="LC7" class="line" lang="plaintext">- g</span> -<span id="LC8" class="line" lang="plaintext">.</span> -<span id="LC9" class="line" lang="plaintext"><ul></span> -<span id="LC10" class="line" lang="plaintext"><li>a</li></span> -<span id="LC11" class="line" lang="plaintext"><li>b</li></span> -<span id="LC12" class="line" lang="plaintext"><li>c</li></span> -<span id="LC13" class="line" lang="plaintext"><li>d</li></span> -<span id="LC14" class="line" lang="plaintext"><li>e</li></span> -<span id="LC15" class="line" lang="plaintext"><li>f</li></span> -<span id="LC16" class="line" lang="plaintext"><li>g</li></span> -<span id="LC17" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC7" class="line" lang="plaintext">- g</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5710:1-5720:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>a</li></span> +<span id="LC3" class="line" lang="plaintext"><li>b</li></span> +<span id="LC4" class="line" lang="plaintext"><li>c</li></span> +<span id="LC5" class="line" lang="plaintext"><li>d</li></span> +<span id="LC6" class="line" lang="plaintext"><li>e</li></span> +<span id="LC7" class="line" lang="plaintext"><li>f</li></span> +<span id="LC8" class="line" lang="plaintext"><li>g</li></span> +<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5143:1-5161:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. a</span> +<pre data-sourcepos="5723:1-5729:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. a</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext"> 2. b</span> <span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext"> 3. c</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><ol></span> +<span id="LC5" class="line" lang="plaintext"> 3. c</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5731:1-5743:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>a</p></span> +<span id="LC4" class="line" lang="plaintext"></li></span> +<span id="LC5" class="line" lang="plaintext"><li></span> +<span id="LC6" class="line" lang="plaintext"><p>b</p></span> +<span id="LC7" class="line" lang="plaintext"></li></span> <span id="LC8" class="line" lang="plaintext"><li></span> -<span id="LC9" class="line" lang="plaintext"><p>a</p></span> +<span id="LC9" class="line" lang="plaintext"><p>c</p></span> <span id="LC10" class="line" lang="plaintext"></li></span> -<span id="LC11" class="line" lang="plaintext"><li></span> -<span id="LC12" class="line" lang="plaintext"><p>b</p></span> -<span id="LC13" class="line" lang="plaintext"></li></span> -<span id="LC14" class="line" lang="plaintext"><li></span> -<span id="LC15" class="line" lang="plaintext"><p>c</p></span> -<span id="LC16" class="line" lang="plaintext"></li></span> -<span id="LC17" class="line" lang="plaintext"></ol></span></code></pre> +<span id="LC11" class="line" lang="plaintext"></ol></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5163:1-5165:52" dir="auto">Note, however, that list items may not be indented more than +<p data-sourcepos="5745:1-5747:52" dir="auto">Note, however, that list items may not be indented more than three spaces. Here <code>- e</code> is treated as a paragraph continuation line, because it is indented more than three spaces:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5167:1-5181:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span> +<pre data-sourcepos="5749:1-5755:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span> <span id="LC2" class="line" lang="plaintext"> - b</span> <span id="LC3" class="line" lang="plaintext"> - c</span> <span id="LC4" class="line" lang="plaintext"> - d</span> -<span id="LC5" class="line" lang="plaintext"> - e</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><ul></span> -<span id="LC8" class="line" lang="plaintext"><li>a</li></span> -<span id="LC9" class="line" lang="plaintext"><li>b</li></span> -<span id="LC10" class="line" lang="plaintext"><li>c</li></span> -<span id="LC11" class="line" lang="plaintext"><li>d</span> -<span id="LC12" class="line" lang="plaintext">- e</li></span> -<span id="LC13" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC5" class="line" lang="plaintext"> - e</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5757:1-5765:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>a</li></span> +<span id="LC3" class="line" lang="plaintext"><li>b</li></span> +<span id="LC4" class="line" lang="plaintext"><li>c</li></span> +<span id="LC5" class="line" lang="plaintext"><li>d</span> +<span id="LC6" class="line" lang="plaintext">- e</li></span> +<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5183:1-5185:11" dir="auto">And here, <code>3. c</code> is treated as in indented code block, +<p data-sourcepos="5767:1-5769:11" dir="auto">And here, <code>3. c</code> is treated as in indented code block, because it is indented four spaces and preceded by a blank line.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5187:1-5204:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. a</span> +<pre data-sourcepos="5771:1-5777:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. a</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext"> 2. b</span> <span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext"> 3. c</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><ol></span> -<span id="LC8" class="line" lang="plaintext"><li></span> -<span id="LC9" class="line" lang="plaintext"><p>a</p></span> -<span id="LC10" class="line" lang="plaintext"></li></span> -<span id="LC11" class="line" lang="plaintext"><li></span> -<span id="LC12" class="line" lang="plaintext"><p>b</p></span> -<span id="LC13" class="line" lang="plaintext"></li></span> -<span id="LC14" class="line" lang="plaintext"></ol></span> -<span id="LC15" class="line" lang="plaintext"><pre><code>3. c</span> -<span id="LC16" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC5" class="line" lang="plaintext"> 3. c</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5207:1-5208:22" dir="auto">This is a loose list, because there is a blank line between +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5779:1-5790:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>a</p></span> +<span id="LC4" class="line" lang="plaintext"></li></span> +<span id="LC5" class="line" lang="plaintext"><li></span> +<span id="LC6" class="line" lang="plaintext"><p>b</p></span> +<span id="LC7" class="line" lang="plaintext"></li></span> +<span id="LC8" class="line" lang="plaintext"></ol></span> +<span id="LC9" class="line" lang="plaintext"><pre><code>3. c</span> +<span id="LC10" class="line" lang="plaintext"></code></pre></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="5793:1-5794:22" dir="auto">This is a loose list, because there is a blank line between two of the list items:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5210:1-5227:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span> +<pre data-sourcepos="5796:1-5801:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span> <span id="LC2" class="line" lang="plaintext">- b</span> <span id="LC3" class="line" lang="plaintext"></span> -<span id="LC4" class="line" lang="plaintext">- c</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><ul></span> -<span id="LC7" class="line" lang="plaintext"><li></span> -<span id="LC8" class="line" lang="plaintext"><p>a</p></span> -<span id="LC9" class="line" lang="plaintext"></li></span> -<span id="LC10" class="line" lang="plaintext"><li></span> -<span id="LC11" class="line" lang="plaintext"><p>b</p></span> -<span id="LC12" class="line" lang="plaintext"></li></span> -<span id="LC13" class="line" lang="plaintext"><li></span> -<span id="LC14" class="line" lang="plaintext"><p>c</p></span> -<span id="LC15" class="line" lang="plaintext"></li></span> -<span id="LC16" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC4" class="line" lang="plaintext">- c</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5803:1-5815:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>a</p></span> +<span id="LC4" class="line" lang="plaintext"></li></span> +<span id="LC5" class="line" lang="plaintext"><li></span> +<span id="LC6" class="line" lang="plaintext"><p>b</p></span> +<span id="LC7" class="line" lang="plaintext"></li></span> +<span id="LC8" class="line" lang="plaintext"><li></span> +<span id="LC9" class="line" lang="plaintext"><p>c</p></span> +<span id="LC10" class="line" lang="plaintext"></li></span> +<span id="LC11" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5230:1-5230:37" dir="auto">So is this, with a empty second item:</p> +<p data-sourcepos="5818:1-5818:37" dir="auto">So is this, with a empty second item:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5232:1-5247:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">* a</span> +<pre data-sourcepos="5820:1-5825:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">* a</span> <span id="LC2" class="line" lang="plaintext">*</span> <span id="LC3" class="line" lang="plaintext"></span> -<span id="LC4" class="line" lang="plaintext">* c</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><ul></span> -<span id="LC7" class="line" lang="plaintext"><li></span> -<span id="LC8" class="line" lang="plaintext"><p>a</p></span> -<span id="LC9" class="line" lang="plaintext"></li></span> -<span id="LC10" class="line" lang="plaintext"><li></li></span> -<span id="LC11" class="line" lang="plaintext"><li></span> -<span id="LC12" class="line" lang="plaintext"><p>c</p></span> -<span id="LC13" class="line" lang="plaintext"></li></span> -<span id="LC14" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC4" class="line" lang="plaintext">* c</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5827:1-5837:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>a</p></span> +<span id="LC4" class="line" lang="plaintext"></li></span> +<span id="LC5" class="line" lang="plaintext"><li></li></span> +<span id="LC6" class="line" lang="plaintext"><li></span> +<span id="LC7" class="line" lang="plaintext"><p>c</p></span> +<span id="LC8" class="line" lang="plaintext"></li></span> +<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5250:1-5252:31" dir="auto">These are loose lists, even though there is no space between the items, +<p data-sourcepos="5840:1-5842:31" dir="auto">These are loose lists, even though there is no space between the items, because one of the items directly contains two block-level elements with a blank line between them:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5254:1-5273:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span> +<pre data-sourcepos="5844:1-5850:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span> <span id="LC2" class="line" lang="plaintext">- b</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext"> c</span> -<span id="LC5" class="line" lang="plaintext">- d</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><ul></span> -<span id="LC8" class="line" lang="plaintext"><li></span> -<span id="LC9" class="line" lang="plaintext"><p>a</p></span> -<span id="LC10" class="line" lang="plaintext"></li></span> -<span id="LC11" class="line" lang="plaintext"><li></span> -<span id="LC12" class="line" lang="plaintext"><p>b</p></span> -<span id="LC13" class="line" lang="plaintext"><p>c</p></span> -<span id="LC14" class="line" lang="plaintext"></li></span> -<span id="LC15" class="line" lang="plaintext"><li></span> -<span id="LC16" class="line" lang="plaintext"><p>d</p></span> -<span id="LC17" class="line" lang="plaintext"></li></span> -<span id="LC18" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC5" class="line" lang="plaintext">- d</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5852:1-5865:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>a</p></span> +<span id="LC4" class="line" lang="plaintext"></li></span> +<span id="LC5" class="line" lang="plaintext"><li></span> +<span id="LC6" class="line" lang="plaintext"><p>b</p></span> +<span id="LC7" class="line" lang="plaintext"><p>c</p></span> +<span id="LC8" class="line" lang="plaintext"></li></span> +<span id="LC9" class="line" lang="plaintext"><li></span> +<span id="LC10" class="line" lang="plaintext"><p>d</p></span> +<span id="LC11" class="line" lang="plaintext"></li></span> +<span id="LC12" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5276:1-5294:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span> +<pre data-sourcepos="5868:1-5874:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span> <span id="LC2" class="line" lang="plaintext">- b</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext"> [ref]: /url</span> -<span id="LC5" class="line" lang="plaintext">- d</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><ul></span> +<span id="LC5" class="line" lang="plaintext">- d</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5876:1-5888:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>a</p></span> +<span id="LC4" class="line" lang="plaintext"></li></span> +<span id="LC5" class="line" lang="plaintext"><li></span> +<span id="LC6" class="line" lang="plaintext"><p>b</p></span> +<span id="LC7" class="line" lang="plaintext"></li></span> <span id="LC8" class="line" lang="plaintext"><li></span> -<span id="LC9" class="line" lang="plaintext"><p>a</p></span> +<span id="LC9" class="line" lang="plaintext"><p>d</p></span> <span id="LC10" class="line" lang="plaintext"></li></span> -<span id="LC11" class="line" lang="plaintext"><li></span> -<span id="LC12" class="line" lang="plaintext"><p>b</p></span> -<span id="LC13" class="line" lang="plaintext"></li></span> -<span id="LC14" class="line" lang="plaintext"><li></span> -<span id="LC15" class="line" lang="plaintext"><p>d</p></span> -<span id="LC16" class="line" lang="plaintext"></li></span> -<span id="LC17" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC11" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5297:1-5297:66" dir="auto">This is a tight list, because the blank lines are in a code block:</p> +<p data-sourcepos="5891:1-5891:66" dir="auto">This is a tight list, because the blank lines are in a code block:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5299:1-5318:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span> +<pre data-sourcepos="5893:1-5901:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span> <span id="LC2" class="line" lang="plaintext">- ```</span> <span id="LC3" class="line" lang="plaintext"> b</span> <span id="LC4" class="line" lang="plaintext"></span> <span id="LC5" class="line" lang="plaintext"></span> <span id="LC6" class="line" lang="plaintext"> ```</span> -<span id="LC7" class="line" lang="plaintext">- c</span> -<span id="LC8" class="line" lang="plaintext">.</span> -<span id="LC9" class="line" lang="plaintext"><ul></span> -<span id="LC10" class="line" lang="plaintext"><li>a</li></span> -<span id="LC11" class="line" lang="plaintext"><li></span> -<span id="LC12" class="line" lang="plaintext"><pre><code>b</span> -<span id="LC13" class="line" lang="plaintext"></span> -<span id="LC14" class="line" lang="plaintext"></span> -<span id="LC15" class="line" lang="plaintext"></code></pre></span> -<span id="LC16" class="line" lang="plaintext"></li></span> -<span id="LC17" class="line" lang="plaintext"><li>c</li></span> -<span id="LC18" class="line" lang="plaintext"></ul></span></code></pre> -<copy-code></copy-code> -</div> -<p data-sourcepos="5321:1-5323:24" dir="auto">This is a tight list, because the blank line is between two +<span id="LC7" class="line" lang="plaintext">- c</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5903:1-5914:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>a</li></span> +<span id="LC3" class="line" lang="plaintext"><li></span> +<span id="LC4" class="line" lang="plaintext"><pre><code>b</span> +<span id="LC5" class="line" lang="plaintext"></span> +<span id="LC6" class="line" lang="plaintext"></span> +<span id="LC7" class="line" lang="plaintext"></code></pre></span> +<span id="LC8" class="line" lang="plaintext"></li></span> +<span id="LC9" class="line" lang="plaintext"><li>c</li></span> +<span id="LC10" class="line" lang="plaintext"></ul></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="5917:1-5919:24" dir="auto">This is a tight list, because the blank line is between two paragraphs of a sublist. So the sublist is loose while the outer list is tight:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5325:1-5343:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span> +<pre data-sourcepos="5921:1-5927:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span> <span id="LC2" class="line" lang="plaintext"> - b</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext"> c</span> -<span id="LC5" class="line" lang="plaintext">- d</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><ul></span> -<span id="LC8" class="line" lang="plaintext"><li>a</span> -<span id="LC9" class="line" lang="plaintext"><ul></span> -<span id="LC10" class="line" lang="plaintext"><li></span> -<span id="LC11" class="line" lang="plaintext"><p>b</p></span> -<span id="LC12" class="line" lang="plaintext"><p>c</p></span> -<span id="LC13" class="line" lang="plaintext"></li></span> -<span id="LC14" class="line" lang="plaintext"></ul></span> -<span id="LC15" class="line" lang="plaintext"></li></span> -<span id="LC16" class="line" lang="plaintext"><li>d</li></span> -<span id="LC17" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC5" class="line" lang="plaintext">- d</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5929:1-5941:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>a</span> +<span id="LC3" class="line" lang="plaintext"><ul></span> +<span id="LC4" class="line" lang="plaintext"><li></span> +<span id="LC5" class="line" lang="plaintext"><p>b</p></span> +<span id="LC6" class="line" lang="plaintext"><p>c</p></span> +<span id="LC7" class="line" lang="plaintext"></li></span> +<span id="LC8" class="line" lang="plaintext"></ul></span> +<span id="LC9" class="line" lang="plaintext"></li></span> +<span id="LC10" class="line" lang="plaintext"><li>d</li></span> +<span id="LC11" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5346:1-5347:12" dir="auto">This is a tight list, because the blank line is inside the +<p data-sourcepos="5944:1-5945:12" dir="auto">This is a tight list, because the blank line is inside the block quote:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5349:1-5363:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">* a</span> +<pre data-sourcepos="5947:1-5952:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">* a</span> <span id="LC2" class="line" lang="plaintext"> > b</span> <span id="LC3" class="line" lang="plaintext"> ></span> -<span id="LC4" class="line" lang="plaintext">* c</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><ul></span> -<span id="LC7" class="line" lang="plaintext"><li>a</span> -<span id="LC8" class="line" lang="plaintext"><blockquote></span> -<span id="LC9" class="line" lang="plaintext"><p>b</p></span> -<span id="LC10" class="line" lang="plaintext"></blockquote></span> -<span id="LC11" class="line" lang="plaintext"></li></span> -<span id="LC12" class="line" lang="plaintext"><li>c</li></span> -<span id="LC13" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC4" class="line" lang="plaintext">* c</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5954:1-5963:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>a</span> +<span id="LC3" class="line" lang="plaintext"><blockquote></span> +<span id="LC4" class="line" lang="plaintext"><p>b</p></span> +<span id="LC5" class="line" lang="plaintext"></blockquote></span> +<span id="LC6" class="line" lang="plaintext"></li></span> +<span id="LC7" class="line" lang="plaintext"><li>c</li></span> +<span id="LC8" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5366:1-5367:33" dir="auto">This list is tight, because the consecutive block elements +<p data-sourcepos="5966:1-5967:33" dir="auto">This list is tight, because the consecutive block elements are not separated by blank lines:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5369:1-5387:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span> +<pre data-sourcepos="5969:1-5976:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span> <span id="LC2" class="line" lang="plaintext"> > b</span> <span id="LC3" class="line" lang="plaintext"> ```</span> <span id="LC4" class="line" lang="plaintext"> c</span> <span id="LC5" class="line" lang="plaintext"> ```</span> -<span id="LC6" class="line" lang="plaintext">- d</span> -<span id="LC7" class="line" lang="plaintext">.</span> -<span id="LC8" class="line" lang="plaintext"><ul></span> -<span id="LC9" class="line" lang="plaintext"><li>a</span> -<span id="LC10" class="line" lang="plaintext"><blockquote></span> -<span id="LC11" class="line" lang="plaintext"><p>b</p></span> -<span id="LC12" class="line" lang="plaintext"></blockquote></span> -<span id="LC13" class="line" lang="plaintext"><pre><code>c</span> -<span id="LC14" class="line" lang="plaintext"></code></pre></span> -<span id="LC15" class="line" lang="plaintext"></li></span> -<span id="LC16" class="line" lang="plaintext"><li>d</li></span> -<span id="LC17" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC6" class="line" lang="plaintext">- d</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5390:1-5390:33" dir="auto">A single-paragraph list is tight:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5392:1-5398:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><ul></span> -<span id="LC4" class="line" lang="plaintext"><li>a</li></span> -<span id="LC5" class="line" lang="plaintext"></ul></span></code></pre> +<pre data-sourcepos="5978:1-5989:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>a</span> +<span id="LC3" class="line" lang="plaintext"><blockquote></span> +<span id="LC4" class="line" lang="plaintext"><p>b</p></span> +<span id="LC5" class="line" lang="plaintext"></blockquote></span> +<span id="LC6" class="line" lang="plaintext"><pre><code>c</span> +<span id="LC7" class="line" lang="plaintext"></code></pre></span> +<span id="LC8" class="line" lang="plaintext"></li></span> +<span id="LC9" class="line" lang="plaintext"><li>d</li></span> +<span id="LC10" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> +<p data-sourcepos="5992:1-5992:33" dir="auto">A single-paragraph list is tight:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5401:1-5412:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span> -<span id="LC2" class="line" lang="plaintext"> - b</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><ul></span> -<span id="LC5" class="line" lang="plaintext"><li>a</span> -<span id="LC6" class="line" lang="plaintext"><ul></span> -<span id="LC7" class="line" lang="plaintext"><li>b</li></span> -<span id="LC8" class="line" lang="plaintext"></ul></span> -<span id="LC9" class="line" lang="plaintext"></li></span> -<span id="LC10" class="line" lang="plaintext"></ul></span></code></pre> +<pre data-sourcepos="5994:1-5996:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="5998:1-6002:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>a</li></span> +<span id="LC3" class="line" lang="plaintext"></ul></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6005:1-6008:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span> +<span id="LC2" class="line" lang="plaintext"> - b</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5415:1-5416:36" dir="auto">This list is loose, because of the blank line between the +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6010:1-6018:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li>a</span> +<span id="LC3" class="line" lang="plaintext"><ul></span> +<span id="LC4" class="line" lang="plaintext"><li>b</li></span> +<span id="LC5" class="line" lang="plaintext"></ul></span> +<span id="LC6" class="line" lang="plaintext"></li></span> +<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="6021:1-6022:36" dir="auto">This list is loose, because of the blank line between the two block elements in the list item:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5418:1-5432:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. ```</span> +<pre data-sourcepos="6024:1-6030:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. ```</span> <span id="LC2" class="line" lang="plaintext"> foo</span> <span id="LC3" class="line" lang="plaintext"> ```</span> <span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext"> bar</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><ol></span> -<span id="LC8" class="line" lang="plaintext"><li></span> -<span id="LC9" class="line" lang="plaintext"><pre><code>foo</span> -<span id="LC10" class="line" lang="plaintext"></code></pre></span> -<span id="LC11" class="line" lang="plaintext"><p>bar</p></span> -<span id="LC12" class="line" lang="plaintext"></li></span> -<span id="LC13" class="line" lang="plaintext"></ol></span></code></pre> +<span id="LC5" class="line" lang="plaintext"> bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6032:1-6040:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ol></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><pre><code>foo</span> +<span id="LC4" class="line" lang="plaintext"></code></pre></span> +<span id="LC5" class="line" lang="plaintext"><p>bar</p></span> +<span id="LC6" class="line" lang="plaintext"></li></span> +<span id="LC7" class="line" lang="plaintext"></ol></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5435:1-5435:51" dir="auto">Here the outer list is loose, the inner list tight:</p> +<p data-sourcepos="6043:1-6043:51" dir="auto">Here the outer list is loose, the inner list tight:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5437:1-5452:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">* foo</span> +<pre data-sourcepos="6045:1-6050:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">* foo</span> <span id="LC2" class="line" lang="plaintext"> * bar</span> <span id="LC3" class="line" lang="plaintext"></span> -<span id="LC4" class="line" lang="plaintext"> baz</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><ul></span> -<span id="LC7" class="line" lang="plaintext"><li></span> -<span id="LC8" class="line" lang="plaintext"><p>foo</p></span> -<span id="LC9" class="line" lang="plaintext"><ul></span> -<span id="LC10" class="line" lang="plaintext"><li>bar</li></span> -<span id="LC11" class="line" lang="plaintext"></ul></span> -<span id="LC12" class="line" lang="plaintext"><p>baz</p></span> -<span id="LC13" class="line" lang="plaintext"></li></span> -<span id="LC14" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC4" class="line" lang="plaintext"> baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6052:1-6062:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>foo</p></span> +<span id="LC4" class="line" lang="plaintext"><ul></span> +<span id="LC5" class="line" lang="plaintext"><li>bar</li></span> +<span id="LC6" class="line" lang="plaintext"></ul></span> +<span id="LC7" class="line" lang="plaintext"><p>baz</p></span> +<span id="LC8" class="line" lang="plaintext"></li></span> +<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5455:1-5480:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span> +<pre data-sourcepos="6065:1-6073:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- a</span> <span id="LC2" class="line" lang="plaintext"> - b</span> <span id="LC3" class="line" lang="plaintext"> - c</span> <span id="LC4" class="line" lang="plaintext"></span> <span id="LC5" class="line" lang="plaintext">- d</span> <span id="LC6" class="line" lang="plaintext"> - e</span> -<span id="LC7" class="line" lang="plaintext"> - f</span> -<span id="LC8" class="line" lang="plaintext">.</span> -<span id="LC9" class="line" lang="plaintext"><ul></span> -<span id="LC10" class="line" lang="plaintext"><li></span> -<span id="LC11" class="line" lang="plaintext"><p>a</p></span> -<span id="LC12" class="line" lang="plaintext"><ul></span> -<span id="LC13" class="line" lang="plaintext"><li>b</li></span> -<span id="LC14" class="line" lang="plaintext"><li>c</li></span> -<span id="LC15" class="line" lang="plaintext"></ul></span> -<span id="LC16" class="line" lang="plaintext"></li></span> -<span id="LC17" class="line" lang="plaintext"><li></span> -<span id="LC18" class="line" lang="plaintext"><p>d</p></span> -<span id="LC19" class="line" lang="plaintext"><ul></span> -<span id="LC20" class="line" lang="plaintext"><li>e</li></span> -<span id="LC21" class="line" lang="plaintext"><li>f</li></span> -<span id="LC22" class="line" lang="plaintext"></ul></span> -<span id="LC23" class="line" lang="plaintext"></li></span> -<span id="LC24" class="line" lang="plaintext"></ul></span></code></pre> -<copy-code></copy-code> -</div> -<h1 data-sourcepos="5483:1-5483:9" dir="auto"> +<span id="LC7" class="line" lang="plaintext"> - f</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6075:1-6092:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p>a</p></span> +<span id="LC4" class="line" lang="plaintext"><ul></span> +<span id="LC5" class="line" lang="plaintext"><li>b</li></span> +<span id="LC6" class="line" lang="plaintext"><li>c</li></span> +<span id="LC7" class="line" lang="plaintext"></ul></span> +<span id="LC8" class="line" lang="plaintext"></li></span> +<span id="LC9" class="line" lang="plaintext"><li></span> +<span id="LC10" class="line" lang="plaintext"><p>d</p></span> +<span id="LC11" class="line" lang="plaintext"><ul></span> +<span id="LC12" class="line" lang="plaintext"><li>e</li></span> +<span id="LC13" class="line" lang="plaintext"><li>f</li></span> +<span id="LC14" class="line" lang="plaintext"></ul></span> +<span id="LC15" class="line" lang="plaintext"></li></span> +<span id="LC16" class="line" lang="plaintext"></ul></span></code></pre> +<copy-code></copy-code> +</div> +<h1 data-sourcepos="6095:1-6095:9" dir="auto"> <a id="user-content-inlines" class="anchor" href="#inlines" aria-hidden="true"></a>Inlines</h1> -<p data-sourcepos="5485:1-5487:21" dir="auto">Inlines are parsed sequentially from the beginning of the character +<p data-sourcepos="6097:1-6099:21" dir="auto">Inlines are parsed sequentially from the beginning of the character stream to the end (left to right, in left-to-right languages). Thus, for example, in</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5489:1-5493:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`hi`lo`</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><code>hi</code>lo`</p></span></code></pre> +<pre data-sourcepos="6101:1-6103:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`hi`lo`</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5495:1-5496:9" dir="auto"><code>hi</code> is parsed as code, leaving the backtick at the end as a literal +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6105:1-6107:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>hi</code>lo`</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="6109:1-6110:9" dir="auto"><code>hi</code> is parsed as code, leaving the backtick at the end as a literal backtick.</p> -<h2 data-sourcepos="5499:1-5499:20" dir="auto"> +<h2 data-sourcepos="6113:1-6113:20" dir="auto"> <a id="user-content-backslash-escapes" class="anchor" href="#backslash-escapes" aria-hidden="true"></a>Backslash escapes</h2> -<p data-sourcepos="5501:1-5501:57" dir="auto">Any ASCII punctuation character may be backslash-escaped:</p> +<p data-sourcepos="6115:1-6115:57" dir="auto">Any ASCII punctuation character may be backslash-escaped:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6117:1-6119:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~</span></code></pre> +<copy-code></copy-code> +</div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5503:1-5507:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>!&quot;#$%&amp;'()*+,-./:;&lt;=&gt;?@[\]^_`{|}~</p></span></code></pre> +<pre data-sourcepos="6121:1-6123:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>!&quot;#$%&amp;'()*+,-./:;&lt;=&gt;?@[\]^_`{|}~</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5510:1-5511:12" dir="auto">Backslashes before other characters are treated as literal +<p data-sourcepos="6126:1-6127:12" dir="auto">Backslashes before other characters are treated as literal backslashes:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5513:1-5517:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\→\A\a\ \3\φ\«</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>\→\A\a\ \3\φ\«</p></span></code></pre> +<pre data-sourcepos="6129:1-6131:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\→\A\a\ \3\φ\«</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5520:1-5521:39" dir="auto">Escaped characters are treated as regular characters and do +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6133:1-6135:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>\→\A\a\ \3\φ\«</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="6138:1-6139:39" dir="auto">Escaped characters are treated as regular characters and do not have their usual Markdown meanings:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5523:1-5543:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\*not emphasized*</span> +<pre data-sourcepos="6141:1-6151:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\*not emphasized*</span> <span id="LC2" class="line" lang="plaintext">\<br/> not a tag</span> <span id="LC3" class="line" lang="plaintext">\[not a link](/foo)</span> <span id="LC4" class="line" lang="plaintext">\`not code`</span> @@ -4936,108 +5556,130 @@ not have their usual Markdown meanings:</p> <span id="LC6" class="line" lang="plaintext">\* not a list</span> <span id="LC7" class="line" lang="plaintext">\# not a heading</span> <span id="LC8" class="line" lang="plaintext">\[foo]: /url "not a reference"</span> -<span id="LC9" class="line" lang="plaintext">\&ouml; not a character entity</span> -<span id="LC10" class="line" lang="plaintext">.</span> -<span id="LC11" class="line" lang="plaintext"><p>*not emphasized*</span> -<span id="LC12" class="line" lang="plaintext">&lt;br/&gt; not a tag</span> -<span id="LC13" class="line" lang="plaintext">[not a link](/foo)</span> -<span id="LC14" class="line" lang="plaintext">`not code`</span> -<span id="LC15" class="line" lang="plaintext">1. not a list</span> -<span id="LC16" class="line" lang="plaintext">* not a list</span> -<span id="LC17" class="line" lang="plaintext"># not a heading</span> -<span id="LC18" class="line" lang="plaintext">[foo]: /url &quot;not a reference&quot;</span> -<span id="LC19" class="line" lang="plaintext">&amp;ouml; not a character entity</p></span></code></pre> +<span id="LC9" class="line" lang="plaintext">\&ouml; not a character entity</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5546:1-5546:65" dir="auto">If a backslash is itself escaped, the following character is not:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5548:1-5552:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\\*emphasis*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>\<em>emphasis</em></p></span></code></pre> +<pre data-sourcepos="6153:1-6163:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*not emphasized*</span> +<span id="LC2" class="line" lang="plaintext">&lt;br/&gt; not a tag</span> +<span id="LC3" class="line" lang="plaintext">[not a link](/foo)</span> +<span id="LC4" class="line" lang="plaintext">`not code`</span> +<span id="LC5" class="line" lang="plaintext">1. not a list</span> +<span id="LC6" class="line" lang="plaintext">* not a list</span> +<span id="LC7" class="line" lang="plaintext"># not a heading</span> +<span id="LC8" class="line" lang="plaintext">[foo]: /url &quot;not a reference&quot;</span> +<span id="LC9" class="line" lang="plaintext">&amp;ouml; not a character entity</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5555:1-5555:58" dir="auto">A backslash at the end of the line is a [hard line break]:</p> +<p data-sourcepos="6166:1-6166:65" dir="auto">If a backslash is itself escaped, the following character is not:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5557:1-5563:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo\</span> -<span id="LC2" class="line" lang="plaintext">bar</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>foo<br /></span> -<span id="LC5" class="line" lang="plaintext">bar</p></span></code></pre> +<pre data-sourcepos="6168:1-6170:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\\*emphasis*</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5566:1-5567:9" dir="auto">Backslash escapes do not work in code blocks, code spans, autolinks, or +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6172:1-6174:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>\<em>emphasis</em></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="6177:1-6177:58" dir="auto">A backslash at the end of the line is a [hard line break]:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6179:1-6182:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo\</span> +<span id="LC2" class="line" lang="plaintext">bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6184:1-6187:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo<br /></span> +<span id="LC2" class="line" lang="plaintext">bar</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="6190:1-6191:9" dir="auto">Backslash escapes do not work in code blocks, code spans, autolinks, or raw HTML:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5569:1-5573:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`` \[\` ``</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><code>\[\`</code></p></span></code></pre> +<pre data-sourcepos="6193:1-6195:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`` \[\` ``</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5576:1-5581:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> \[\]</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><pre><code>\[\]</span> -<span id="LC4" class="line" lang="plaintext"></code></pre></span></code></pre> +<pre data-sourcepos="6197:1-6199:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>\[\`</code></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6202:1-6204:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> \[\]</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5584:1-5591:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~~</span> +<pre data-sourcepos="6206:1-6209:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>\[\]</span> +<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6212:1-6216:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~~</span> <span id="LC2" class="line" lang="plaintext">\[\]</span> -<span id="LC3" class="line" lang="plaintext">~~~</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><pre><code>\[\]</span> -<span id="LC6" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC3" class="line" lang="plaintext">~~~</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6218:1-6221:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>\[\]</span> +<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6224:1-6226:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><http://example.com?find=\*></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5594:1-5598:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><http://example.com?find=\*></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="http://example.com?find=%5C*">http://example.com?find=\*</a></p></span></code></pre> +<pre data-sourcepos="6228:1-6230:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://example.com?find=%5C*">http://example.com?find=\*</a></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5601:1-5605:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="/bar\/)"></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><a href="/bar\/)"></span></code></pre> +<pre data-sourcepos="6233:1-6235:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="/bar\/)"></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5608:1-5609:60" dir="auto">But they work in all other contexts, including URLs and link titles, +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6237:1-6239:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="/bar\/)"></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="6242:1-6243:60" dir="auto">But they work in all other contexts, including URLs and link titles, link references, and [info strings] in [fenced code blocks]:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5611:1-5615:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo](/bar\* "ti\*tle")</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="/bar*" title="ti*tle">foo</a></p></span></code></pre> +<pre data-sourcepos="6245:1-6247:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo](/bar\* "ti\*tle")</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6249:1-6251:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/bar*" title="ti*tle">foo</a></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5618:1-5624:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]</span> +<pre data-sourcepos="6254:1-6258:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]: /bar\* "ti\*tle"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/bar*" title="ti*tle">foo</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]: /bar\* "ti\*tle"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6260:1-6262:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/bar*" title="ti*tle">foo</a></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5627:1-5634:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``` foo\+bar</span> +<pre data-sourcepos="6265:1-6269:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``` foo\+bar</span> <span id="LC2" class="line" lang="plaintext">foo</span> -<span id="LC3" class="line" lang="plaintext">```</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><pre><code class="language-foo+bar">foo</span> -<span id="LC6" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC3" class="line" lang="plaintext">```</span></code></pre> <copy-code></copy-code> </div> -<h2 data-sourcepos="5638:1-5638:42" dir="auto"> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6271:1-6274:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code class="language-foo+bar">foo</span> +<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre> +<copy-code></copy-code> +</div> +<h2 data-sourcepos="6278:1-6278:42" dir="auto"> <a id="user-content-entity-and-numeric-character-references" class="anchor" href="#entity-and-numeric-character-references" aria-hidden="true"></a>Entity and numeric character references</h2> -<p data-sourcepos="5640:1-5642:30" dir="auto">Valid HTML entity references and numeric character references +<p data-sourcepos="6280:1-6282:30" dir="auto">Valid HTML entity references and numeric character references can be used in place of the corresponding Unicode character, with the following exceptions:</p> -<ul data-sourcepos="5644:1-5653:0" dir="auto"> -<li data-sourcepos="5644:1-5646:0"> -<p data-sourcepos="5644:3-5645:24">Entity and character references are not recognized in code +<ul data-sourcepos="6284:1-6293:0" dir="auto"> +<li data-sourcepos="6284:1-6286:0"> +<p data-sourcepos="6284:3-6285:24">Entity and character references are not recognized in code blocks and code spans.</p> </li> -<li data-sourcepos="5647:1-5653:0"> -<p data-sourcepos="5647:3-5652:9">Entity and character references cannot stand in place of +<li data-sourcepos="6287:1-6293:0"> +<p data-sourcepos="6287:3-6292:9">Entity and character references cannot stand in place of special characters that define structural elements in CommonMark. For example, although <code>&#42;</code> can be used in place of a literal <code>*</code> character, <code>&#42;</code> cannot replace @@ -5045,25 +5687,27 @@ in place of a literal <code>*</code> character, <code>&#42;</code> cannot re breaks.</p> </li> </ul> -<p data-sourcepos="5654:1-5656:49" dir="auto">Conforming CommonMark parsers need not store information about +<p data-sourcepos="6294:1-6296:49" dir="auto">Conforming CommonMark parsers need not store information about whether a particular character was represented in the source using a Unicode character or an entity reference.</p> -<p data-sourcepos="5658:1-5662:47" dir="auto"><a href="@">Entity references</a> consist of <code>&</code> + any of the valid +<p data-sourcepos="6298:1-6302:47" dir="auto"><a href="@">Entity references</a> consist of <code>&</code> + any of the valid HTML5 entity names + <code>;</code>. The document <a href="https://html.spec.whatwg.org/multipage/entities.json" rel="nofollow noreferrer noopener" target="_blank">https://html.spec.whatwg.org/multipage/entities.json</a> is used as an authoritative source for the valid entity references and their corresponding code points.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5664:1-5672:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&nbsp; &amp; &copy; &AElig; &Dcaron;</span> +<pre data-sourcepos="6304:1-6308:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&nbsp; &amp; &copy; &AElig; &Dcaron;</span> <span id="LC2" class="line" lang="plaintext">&frac34; &HilbertSpace; &DifferentialD;</span> -<span id="LC3" class="line" lang="plaintext">&ClockwiseContourIntegral; &ngE;</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p> &amp; © Æ Ď</span> -<span id="LC6" class="line" lang="plaintext">¾ ℋ ⅆ</span> -<span id="LC7" class="line" lang="plaintext">∲ ≧̸</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">&ClockwiseContourIntegral; &ngE;</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6310:1-6314:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p> &amp; © Æ Ď</span> +<span id="LC2" class="line" lang="plaintext">¾ ℋ ⅆ</span> +<span id="LC3" class="line" lang="plaintext">∲ ≧̸</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5675:1-5681:58" dir="auto"><a href="@">Decimal numeric character +<p data-sourcepos="6317:1-6323:58" dir="auto"><a href="@">Decimal numeric character references</a> consist of <code>&#</code> + a string of 1--7 arabic digits + <code>;</code>. A numeric character reference is parsed as the corresponding @@ -5071,495 +5715,571 @@ Unicode character. Invalid Unicode code points will be replaced by the REPLACEMENT CHARACTER (<code>U+FFFD</code>). For security reasons, the code point <code>U+0000</code> will also be replaced by <code>U+FFFD</code>.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5683:1-5687:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&#35; &#1234; &#992; &#0;</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p># Ӓ Ϡ �</p></span></code></pre> +<pre data-sourcepos="6325:1-6327:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&#35; &#1234; &#992; &#0;</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5690:1-5694:62" dir="auto"><a href="@">Hexadecimal numeric character +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6329:1-6331:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p># Ӓ Ϡ �</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="6334:1-6338:62" dir="auto"><a href="@">Hexadecimal numeric character references</a> consist of <code>&#</code> + either <code>X</code> or <code>x</code> + a string of 1-6 hexadecimal digits + <code>;</code>. They too are parsed as the corresponding Unicode character (this time specified with a hexadecimal numeral instead of decimal).</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5696:1-5700:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&#X22; &#XD06; &#xcab;</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>&quot; ആ ಫ</p></span></code></pre> +<pre data-sourcepos="6340:1-6342:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&#X22; &#XD06; &#xcab;</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5703:1-5703:26" dir="auto">Here are some nonentities:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5705:1-5715:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&nbsp &x; &#; &#x;</span> +<pre data-sourcepos="6344:1-6346:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&quot; ആ ಫ</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="6349:1-6349:26" dir="auto">Here are some nonentities:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6351:1-6356:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&nbsp &x; &#; &#x;</span> <span id="LC2" class="line" lang="plaintext">&#987654321;</span> <span id="LC3" class="line" lang="plaintext">&#abcdef0;</span> -<span id="LC4" class="line" lang="plaintext">&ThisIsNotDefined; &hi?;</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><p>&amp;nbsp &amp;x; &amp;#; &amp;#x;</span> -<span id="LC7" class="line" lang="plaintext">&amp;#987654321;</span> -<span id="LC8" class="line" lang="plaintext">&amp;#abcdef0;</span> -<span id="LC9" class="line" lang="plaintext">&amp;ThisIsNotDefined; &amp;hi?;</p></span></code></pre> +<span id="LC4" class="line" lang="plaintext">&ThisIsNotDefined; &hi?;</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6358:1-6363:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&amp;nbsp &amp;x; &amp;#; &amp;#x;</span> +<span id="LC2" class="line" lang="plaintext">&amp;#987654321;</span> +<span id="LC3" class="line" lang="plaintext">&amp;#abcdef0;</span> +<span id="LC4" class="line" lang="plaintext">&amp;ThisIsNotDefined; &amp;hi?;</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5718:1-5720:60" dir="auto">Although HTML5 does accept some entity references +<p data-sourcepos="6366:1-6368:60" dir="auto">Although HTML5 does accept some entity references without a trailing semicolon (such as <code>&copy</code>), these are not recognized here, because it makes the grammar too ambiguous:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5722:1-5726:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&copy</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>&amp;copy</p></span></code></pre> +<pre data-sourcepos="6370:1-6372:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&copy</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6374:1-6376:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&amp;copy</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5729:1-5730:39" dir="auto">Strings that are not on the list of HTML5 named entities are not +<p data-sourcepos="6379:1-6380:39" dir="auto">Strings that are not on the list of HTML5 named entities are not recognized as entity references either:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5732:1-5736:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&MadeUpEntity;</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>&amp;MadeUpEntity;</p></span></code></pre> +<pre data-sourcepos="6382:1-6384:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&MadeUpEntity;</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6386:1-6388:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&amp;MadeUpEntity;</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5739:1-5741:62" dir="auto">Entity and numeric character references are recognized in any +<p data-sourcepos="6391:1-6393:62" dir="auto">Entity and numeric character references are recognized in any context besides code spans or code blocks, including URLs, [link titles], and [fenced code block][] [info strings]:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5743:1-5747:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="&ouml;&ouml;.html"></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><a href="&ouml;&ouml;.html"></span></code></pre> +<pre data-sourcepos="6395:1-6397:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="&ouml;&ouml;.html"></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6399:1-6401:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="&ouml;&ouml;.html"></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6404:1-6406:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo](/f&ouml;&ouml; "f&ouml;&ouml;")</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5750:1-5754:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo](/f&ouml;&ouml; "f&ouml;&ouml;")</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p></span></code></pre> +<pre data-sourcepos="6408:1-6410:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5757:1-5763:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]</span> +<pre data-sourcepos="6413:1-6417:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]: /f&ouml;&ouml; "f&ouml;&ouml;"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]: /f&ouml;&ouml; "f&ouml;&ouml;"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6419:1-6421:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5766:1-5773:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``` f&ouml;&ouml;</span> +<pre data-sourcepos="6424:1-6428:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``` f&ouml;&ouml;</span> <span id="LC2" class="line" lang="plaintext">foo</span> -<span id="LC3" class="line" lang="plaintext">```</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><pre><code class="language-föö">foo</span> -<span id="LC6" class="line" lang="plaintext"></code></pre></span></code></pre> +<span id="LC3" class="line" lang="plaintext">```</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6430:1-6433:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code class="language-föö">foo</span> +<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5776:1-5777:35" dir="auto">Entity and numeric character references are treated as literal +<p data-sourcepos="6436:1-6437:35" dir="auto">Entity and numeric character references are treated as literal text in code spans and code blocks:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5779:1-5783:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`f&ouml;&ouml;`</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><code>f&amp;ouml;&amp;ouml;</code></p></span></code></pre> +<pre data-sourcepos="6439:1-6441:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`f&ouml;&ouml;`</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5786:1-5791:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> f&ouml;f&ouml;</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><pre><code>f&amp;ouml;f&amp;ouml;</span> -<span id="LC4" class="line" lang="plaintext"></code></pre></span></code></pre> +<pre data-sourcepos="6443:1-6445:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>f&amp;ouml;&amp;ouml;</code></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5794:1-5796:10" dir="auto">Entity and numeric character references cannot be used +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6448:1-6450:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> f&ouml;f&ouml;</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6452:1-6455:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code>f&amp;ouml;f&amp;ouml;</span> +<span id="LC2" class="line" lang="plaintext"></code></pre></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="6458:1-6460:10" dir="auto">Entity and numeric character references cannot be used in place of symbols indicating structure in CommonMark documents.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5798:1-5804:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&#42;foo&#42;</span> -<span id="LC2" class="line" lang="plaintext">*foo*</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>*foo*</span> -<span id="LC5" class="line" lang="plaintext"><em>foo</em></p></span></code></pre> +<pre data-sourcepos="6462:1-6465:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&#42;foo&#42;</span> +<span id="LC2" class="line" lang="plaintext">*foo*</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5806:1-5815:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&#42; foo</span> +<pre data-sourcepos="6467:1-6470:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*foo*</span> +<span id="LC2" class="line" lang="plaintext"><em>foo</em></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6472:1-6476:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&#42; foo</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">* foo</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>* foo</p></span> -<span id="LC6" class="line" lang="plaintext"><ul></span> -<span id="LC7" class="line" lang="plaintext"><li>foo</li></span> -<span id="LC8" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC3" class="line" lang="plaintext">* foo</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5817:1-5823:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo&#10;&#10;bar</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo</span> -<span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext">bar</p></span></code></pre> +<pre data-sourcepos="6478:1-6483:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>* foo</p></span> +<span id="LC2" class="line" lang="plaintext"><ul></span> +<span id="LC3" class="line" lang="plaintext"><li>foo</li></span> +<span id="LC4" class="line" lang="plaintext"></ul></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6485:1-6487:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo&#10;&#10;bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6489:1-6493:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo</span> +<span id="LC2" class="line" lang="plaintext"></span> +<span id="LC3" class="line" lang="plaintext">bar</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6495:1-6497:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&#9;foo</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5825:1-5829:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&#9;foo</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>→foo</p></span></code></pre> +<pre data-sourcepos="6499:1-6501:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>→foo</p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5832:1-5836:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[a](url &quot;tit&quot;)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>[a](url &quot;tit&quot;)</p></span></code></pre> +<pre data-sourcepos="6504:1-6506:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[a](url &quot;tit&quot;)</span></code></pre> <copy-code></copy-code> </div> -<h2 data-sourcepos="5839:1-5839:13" dir="auto"> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6508:1-6510:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[a](url &quot;tit&quot;)</p></span></code></pre> +<copy-code></copy-code> +</div> +<h2 data-sourcepos="6513:1-6513:13" dir="auto"> <a id="user-content-code-spans" class="anchor" href="#code-spans" aria-hidden="true"></a>Code spans</h2> -<p data-sourcepos="5841:1-5843:36" dir="auto">A <a href="@">backtick string</a> +<p data-sourcepos="6515:1-6517:36" dir="auto">A <a href="@">backtick string</a> is a string of one or more backtick characters (<code>`</code>) that is neither preceded nor followed by a backtick.</p> -<p data-sourcepos="5845:1-5848:15" dir="auto">A <a href="@">code span</a> begins with a backtick string and ends with +<p data-sourcepos="6519:1-6522:15" dir="auto">A <a href="@">code span</a> begins with a backtick string and ends with a backtick string of equal length. The contents of the code span are the characters between the two backtick strings, normalized in the following ways:</p> -<ul data-sourcepos="5850:1-5857:0" dir="auto"> -<li data-sourcepos="5850:1-5850:50">First, [line endings] are converted to [spaces].</li> -<li data-sourcepos="5851:1-5857:0">If the resulting string both begins <em>and</em> ends with a [space] +<ul data-sourcepos="6524:1-6531:0" dir="auto"> +<li data-sourcepos="6524:1-6524:50">First, [line endings] are converted to [spaces].</li> +<li data-sourcepos="6525:1-6531:0">If the resulting string both begins <em>and</em> ends with a [space] character, but does not consist entirely of [space] characters, a single [space] character is removed from the front and back. This allows you to include code that begins or ends with backtick characters, which must be separated by whitespace from the opening or closing backtick strings.</li> </ul> -<p data-sourcepos="5858:1-5858:27" dir="auto">This is a simple code span:</p> +<p data-sourcepos="6532:1-6532:27" dir="auto">This is a simple code span:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6534:1-6536:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`foo`</span></code></pre> +<copy-code></copy-code> +</div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5860:1-5864:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`foo`</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><code>foo</code></p></span></code></pre> +<pre data-sourcepos="6538:1-6540:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>foo</code></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5867:1-5869:15" dir="auto">Here two backticks are used, because the code contains a backtick. +<p data-sourcepos="6543:1-6545:15" dir="auto">Here two backticks are used, because the code contains a backtick. This example also illustrates stripping of a single leading and trailing space:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5871:1-5875:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`` foo ` bar ``</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><code>foo ` bar</code></p></span></code></pre> +<pre data-sourcepos="6547:1-6549:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`` foo ` bar ``</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5878:1-5879:7" dir="auto">This example shows the motivation for stripping leading and trailing +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6551:1-6553:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>foo ` bar</code></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="6556:1-6557:7" dir="auto">This example shows the motivation for stripping leading and trailing spaces:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5881:1-5885:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">` `` `</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><code>``</code></p></span></code></pre> +<pre data-sourcepos="6559:1-6561:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">` `` `</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6563:1-6565:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>``</code></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5887:1-5887:39" dir="auto">Note that only <em>one</em> space is stripped:</p> +<p data-sourcepos="6567:1-6567:39" dir="auto">Note that only <em>one</em> space is stripped:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5889:1-5893:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">` `` `</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><code> `` </code></p></span></code></pre> +<pre data-sourcepos="6569:1-6571:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">` `` `</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5895:1-5896:20" dir="auto">The stripping only happens if the space is on both +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6573:1-6575:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code> `` </code></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="6577:1-6578:20" dir="auto">The stripping only happens if the space is on both sides of the string:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5898:1-5902:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">` a`</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><code> a</code></p></span></code></pre> +<pre data-sourcepos="6580:1-6582:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">` a`</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6584:1-6586:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code> a</code></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5904:1-5905:21" dir="auto">Only [spaces], and not [unicode whitespace] in general, are +<p data-sourcepos="6588:1-6589:21" dir="auto">Only [spaces], and not [unicode whitespace] in general, are stripped in this way:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5907:1-5911:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">` b `</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><code> b </code></p></span></code></pre> +<pre data-sourcepos="6591:1-6593:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">` b `</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6595:1-6597:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code> b </code></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="6599:1-6599:58" dir="auto">No stripping occurs if the code span contains only spaces:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6601:1-6604:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">` `</span> +<span id="LC2" class="line" lang="plaintext">` `</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5913:1-5913:58" dir="auto">No stripping occurs if the code span contains only spaces:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5915:1-5921:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">` `</span> -<span id="LC2" class="line" lang="plaintext">` `</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p><code> </code></span> -<span id="LC5" class="line" lang="plaintext"><code> </code></p></span></code></pre> +<pre data-sourcepos="6606:1-6609:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code> </code></span> +<span id="LC2" class="line" lang="plaintext"><code> </code></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5924:1-5924:39" dir="auto">[Line endings] are treated like spaces:</p> +<p data-sourcepos="6612:1-6612:39" dir="auto">[Line endings] are treated like spaces:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5926:1-5934:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``</span> +<pre data-sourcepos="6614:1-6620:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``</span> <span id="LC2" class="line" lang="plaintext">foo</span> <span id="LC3" class="line" lang="plaintext">bar </span> <span id="LC4" class="line" lang="plaintext">baz</span> -<span id="LC5" class="line" lang="plaintext">``</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><p><code>foo bar baz</code></p></span></code></pre> +<span id="LC5" class="line" lang="plaintext">``</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5936:1-5942:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``</span> +<pre data-sourcepos="6622:1-6624:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>foo bar baz</code></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6626:1-6630:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``</span> <span id="LC2" class="line" lang="plaintext">foo </span> -<span id="LC3" class="line" lang="plaintext">``</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><code>foo </code></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">``</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6632:1-6634:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>foo </code></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5945:1-5945:34" dir="auto">Interior spaces are not collapsed:</p> +<p data-sourcepos="6637:1-6637:34" dir="auto">Interior spaces are not collapsed:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5947:1-5952:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`foo bar </span> -<span id="LC2" class="line" lang="plaintext">baz`</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p><code>foo bar baz</code></p></span></code></pre> +<pre data-sourcepos="6639:1-6642:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`foo bar </span> +<span id="LC2" class="line" lang="plaintext">baz`</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5954:1-5956:26" dir="auto">Note that browsers will typically collapse consecutive spaces +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6644:1-6646:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>foo bar baz</code></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="6648:1-6650:26" dir="auto">Note that browsers will typically collapse consecutive spaces when rendering <code><code></code> elements, so it is recommended that the following CSS be used:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5958:5-5960:0" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">code{white-space: pre-wrap;}</span></code></pre> +<pre data-sourcepos="6652:5-6654:0" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">code{white-space: pre-wrap;}</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5961:1-5962:22" dir="auto">Note that backslash escapes do not work in code spans. All backslashes +<p data-sourcepos="6655:1-6656:22" dir="auto">Note that backslash escapes do not work in code spans. All backslashes are treated literally:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5964:1-5968:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`foo\`bar`</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><code>foo\</code>bar`</p></span></code></pre> +<pre data-sourcepos="6658:1-6660:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`foo\`bar`</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6662:1-6664:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>foo\</code>bar`</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5971:1-5973:59" dir="auto">Backslash escapes are never needed, because one can always choose a +<p data-sourcepos="6667:1-6669:59" dir="auto">Backslash escapes are never needed, because one can always choose a string of <em>n</em> backtick characters as delimiters, where the code does not contain any strings of exactly <em>n</em> backtick characters.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5975:1-5979:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``foo`bar``</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><code>foo`bar</code></p></span></code></pre> +<pre data-sourcepos="6671:1-6673:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``foo`bar``</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5981:1-5985:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">` foo `` bar `</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><code>foo `` bar</code></p></span></code></pre> +<pre data-sourcepos="6675:1-6677:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>foo`bar</code></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="5988:1-5991:5" dir="auto">Code span backticks have higher precedence than any other inline +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6679:1-6681:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">` foo `` bar `</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6683:1-6685:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>foo `` bar</code></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="6688:1-6691:5" dir="auto">Code span backticks have higher precedence than any other inline constructs except HTML tags and autolinks. Thus, for example, this is not parsed as emphasized text, since the second <code>*</code> is part of a code span:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5993:1-5997:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo`*`</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>*foo<code>*</code></p></span></code></pre> +<pre data-sourcepos="6693:1-6695:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo`*`</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6697:1-6699:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*foo<code>*</code></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="6702:1-6702:33" dir="auto">And this is not parsed as a link:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6704:1-6706:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[not a `link](/foo`)</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6000:1-6000:33" dir="auto">And this is not parsed as a link:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6002:1-6006:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[not a `link](/foo`)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>[not a <code>link](/foo</code>)</p></span></code></pre> +<pre data-sourcepos="6708:1-6710:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[not a <code>link](/foo</code>)</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6009:1-6010:19" dir="auto">Code spans, HTML tags, and autolinks have the same precedence. +<p data-sourcepos="6713:1-6714:19" dir="auto">Code spans, HTML tags, and autolinks have the same precedence. Thus, this is code:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6012:1-6016:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`<a href="`">`</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><code>&lt;a href=&quot;</code>&quot;&gt;`</p></span></code></pre> +<pre data-sourcepos="6716:1-6718:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`<a href="`">`</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6019:1-6019:24" dir="auto">But this is an HTML tag:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6021:1-6025:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="`">`</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="`">`</p></span></code></pre> +<pre data-sourcepos="6720:1-6722:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>&lt;a href=&quot;</code>&quot;&gt;`</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6028:1-6028:17" dir="auto">And this is code:</p> +<p data-sourcepos="6725:1-6725:24" dir="auto">But this is an HTML tag:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6030:1-6034:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`<http://foo.bar.`baz>`</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><code>&lt;http://foo.bar.</code>baz&gt;`</p></span></code></pre> +<pre data-sourcepos="6727:1-6729:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="`">`</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6037:1-6037:24" dir="auto">But this is an autolink:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6039:1-6043:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><http://foo.bar.`baz>`</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="http://foo.bar.%60baz">http://foo.bar.`baz</a>`</p></span></code></pre> +<pre data-sourcepos="6731:1-6733:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="`">`</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6046:1-6047:31" dir="auto">When a backtick string is not closed by a matching backtick string, +<p data-sourcepos="6736:1-6736:17" dir="auto">And this is code:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6738:1-6740:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`<http://foo.bar.`baz>`</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6742:1-6744:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>&lt;http://foo.bar.</code>baz&gt;`</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="6747:1-6747:24" dir="auto">But this is an autolink:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6749:1-6751:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><http://foo.bar.`baz>`</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6753:1-6755:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://foo.bar.%60baz">http://foo.bar.`baz</a>`</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="6758:1-6759:31" dir="auto">When a backtick string is not closed by a matching backtick string, we just have literal backticks:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6049:1-6053:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```foo``</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>```foo``</p></span></code></pre> +<pre data-sourcepos="6761:1-6763:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```foo``</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6056:1-6060:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`foo</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>`foo</p></span></code></pre> +<pre data-sourcepos="6765:1-6767:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>```foo``</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6062:1-6063:47" dir="auto">The following case also illustrates the need for opening and +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6770:1-6772:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`foo</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6774:1-6776:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>`foo</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="6778:1-6779:47" dir="auto">The following case also illustrates the need for opening and closing backtick strings to be equal in length:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6065:1-6069:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`foo``bar``</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>`foo<code>bar</code></p></span></code></pre> +<pre data-sourcepos="6781:1-6783:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`foo``bar``</span></code></pre> <copy-code></copy-code> </div> -<h2 data-sourcepos="6072:1-6072:31" dir="auto"> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="6785:1-6787:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>`foo<code>bar</code></p></span></code></pre> +<copy-code></copy-code> +</div> +<h2 data-sourcepos="6790:1-6790:31" dir="auto"> <a id="user-content-emphasis-and-strong-emphasis" class="anchor" href="#emphasis-and-strong-emphasis" aria-hidden="true"></a>Emphasis and strong emphasis</h2> -<p data-sourcepos="6074:1-6075:73" dir="auto">John Gruber's original <a href="http://daringfireball.net/projects/markdown/syntax#em" rel="nofollow noreferrer noopener" target="_blank">Markdown syntax +<p data-sourcepos="6792:1-6793:73" dir="auto">John Gruber's original <a href="http://daringfireball.net/projects/markdown/syntax#em" rel="nofollow noreferrer noopener" target="_blank">Markdown syntax description</a> says:</p> -<blockquote data-sourcepos="6077:1-6080:6" dir="auto"> -<p data-sourcepos="6077:3-6080:6">Markdown treats asterisks (<code>*</code>) and underscores (<code>_</code>) as indicators of +<blockquote data-sourcepos="6795:1-6798:6" dir="auto"> +<p data-sourcepos="6795:3-6798:6">Markdown treats asterisks (<code>*</code>) and underscores (<code>_</code>) as indicators of emphasis. Text wrapped with one <code>*</code> or <code>_</code> will be wrapped with an HTML <code><em></code> tag; double <code>*</code>'s or <code>_</code>'s will be wrapped with an HTML <code><strong></code> tag.</p> </blockquote> -<p data-sourcepos="6082:1-6086:57" dir="auto">This is enough for most users, but these rules leave much undecided, +<p data-sourcepos="6800:1-6804:57" dir="auto">This is enough for most users, but these rules leave much undecided, especially when it comes to nested emphasis. The original <code>Markdown.pl</code> test suite makes it clear that triple <code>***</code> and <code>___</code> delimiters can be used for strong emphasis, and most implementations have also allowed the following patterns:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6088:1-6094:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="gs">***strong emph**</span><span class="err">*</span></span> +<pre data-sourcepos="6806:1-6812:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="gs">***strong emph**</span><span class="err">*</span></span> <span id="LC2" class="line" lang="markdown"><span class="gs">***strong**</span> in emph<span class="err">*</span></span> <span id="LC3" class="line" lang="markdown"><span class="gs">***emph* in strong**</span></span> <span id="LC4" class="line" lang="markdown"><span class="gs">**in strong *emph**</span><span class="err">*</span></span> <span id="LC5" class="line" lang="markdown"><span class="ge">*in emph **strong***</span></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6096:1-6098:9" dir="auto">The following patterns are less widely supported, but the intent +<p data-sourcepos="6814:1-6816:9" dir="auto">The following patterns are less widely supported, but the intent is clear and they are useful (especially in contexts like bibliography entries):</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6100:1-6103:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="ge">*emph *</span>with emph<span class="ge">* in it*</span></span> +<pre data-sourcepos="6818:1-6821:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="ge">*emph *</span>with emph<span class="ge">* in it*</span></span> <span id="LC2" class="line" lang="markdown"><span class="gs">**strong **</span>with strong<span class="gs">** in it**</span></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6105:1-6108:31" dir="auto">Many implementations have also restricted intraword emphasis to +<p data-sourcepos="6823:1-6826:31" dir="auto">Many implementations have also restricted intraword emphasis to the <code>*</code> forms, to avoid unwanted emphasis in words containing internal underscores. (It is best practice to put these in code spans, but users often do not.)</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6110:1-6113:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown">internal emphasis: foo<span class="ge">*bar*</span>baz</span> +<pre data-sourcepos="6828:1-6831:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown">internal emphasis: foo<span class="ge">*bar*</span>baz</span> <span id="LC2" class="line" lang="markdown">no emphasis: foo_bar_baz</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6115:1-6116:55" dir="auto">The rules given below capture all of these patterns, while allowing +<p data-sourcepos="6833:1-6834:55" dir="auto">The rules given below capture all of these patterns, while allowing for efficient parsing strategies that do not backtrack.</p> -<p data-sourcepos="6118:1-6122:38" dir="auto">First, some definitions. A <a href="@">delimiter run</a> is either +<p data-sourcepos="6836:1-6840:38" dir="auto">First, some definitions. A <a href="@">delimiter run</a> is either a sequence of one or more <code>*</code> characters that is not preceded or followed by a non-backslash-escaped <code>*</code> character, or a sequence of one or more <code>_</code> characters that is not preceded or followed by a non-backslash-escaped <code>_</code> character.</p> -<p data-sourcepos="6124:1-6130:37" dir="auto">A <a href="@">left-flanking delimiter run</a> is +<p data-sourcepos="6842:1-6848:37" dir="auto">A <a href="@">left-flanking delimiter run</a> is a [delimiter run] that is (1) not followed by [Unicode whitespace], and either (2a) not followed by a [punctuation character], or (2b) followed by a [punctuation character] and preceded by [Unicode whitespace] or a [punctuation character]. For purposes of this definition, the beginning and the end of the line count as Unicode whitespace.</p> -<p data-sourcepos="6132:1-6138:37" dir="auto">A <a href="@">right-flanking delimiter run</a> is +<p data-sourcepos="6850:1-6856:37" dir="auto">A <a href="@">right-flanking delimiter run</a> is a [delimiter run] that is (1) not preceded by [Unicode whitespace], and either (2a) not preceded by a [punctuation character], or (2b) preceded by a [punctuation character] and followed by [Unicode whitespace] or a [punctuation character]. For purposes of this definition, the beginning and the end of the line count as Unicode whitespace.</p> -<p data-sourcepos="6140:1-6140:41" dir="auto">Here are some examples of delimiter runs.</p> -<ul data-sourcepos="6142:3-6173:0" dir="auto"> -<li data-sourcepos="6142:3-6150:0"> -<p data-sourcepos="6142:5-6142:41">left-flanking but not right-flanking:</p> +<p data-sourcepos="6858:1-6858:41" dir="auto">Here are some examples of delimiter runs.</p> +<ul data-sourcepos="6860:3-6891:0" dir="auto"> +<li data-sourcepos="6860:3-6868:0"> +<p data-sourcepos="6860:5-6860:41">left-flanking but not right-flanking:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6144:5-6149:7" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">***abc</span> +<pre data-sourcepos="6862:5-6867:7" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">***abc</span> <span id="LC2" class="line" lang="plaintext"> _abc</span> <span id="LC3" class="line" lang="plaintext">**"abc"</span> <span id="LC4" class="line" lang="plaintext"> _"abc"</span></code></pre> <copy-code></copy-code> </div> </li> -<li data-sourcepos="6151:3-6159:0"> -<p data-sourcepos="6151:5-6151:41">right-flanking but not left-flanking:</p> +<li data-sourcepos="6869:3-6877:0"> +<p data-sourcepos="6869:5-6869:41">right-flanking but not left-flanking:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6153:5-6158:7" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> abc***</span> +<pre data-sourcepos="6871:5-6876:7" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> abc***</span> <span id="LC2" class="line" lang="plaintext"> abc_</span> <span id="LC3" class="line" lang="plaintext">"abc"**</span> <span id="LC4" class="line" lang="plaintext">"abc"_</span></code></pre> <copy-code></copy-code> </div> </li> -<li data-sourcepos="6160:3-6166:0"> -<p data-sourcepos="6160:5-6160:33">Both left and right-flanking:</p> +<li data-sourcepos="6878:3-6884:0"> +<p data-sourcepos="6878:5-6878:33">Both left and right-flanking:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6162:5-6165:7" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> abc***def</span> +<pre data-sourcepos="6880:5-6883:7" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> abc***def</span> <span id="LC2" class="line" lang="plaintext">"abc"_"def"</span></code></pre> <copy-code></copy-code> </div> </li> -<li data-sourcepos="6167:3-6173:0"> -<p data-sourcepos="6167:5-6167:36">Neither left nor right-flanking:</p> +<li data-sourcepos="6885:3-6891:0"> +<p data-sourcepos="6885:5-6885:36">Neither left nor right-flanking:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6169:5-6172:7" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">abc *** def</span> +<pre data-sourcepos="6887:5-6890:7" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">abc *** def</span> <span id="LC2" class="line" lang="plaintext">a _ b</span></code></pre> <copy-code></copy-code> </div> </li> </ul> -<p data-sourcepos="6174:1-6180:49" dir="auto">(The idea of distinguishing left-flanking and right-flanking +<p data-sourcepos="6892:1-6898:49" dir="auto">(The idea of distinguishing left-flanking and right-flanking delimiter runs based on the character before and the character after comes from Roopesh Chander's <a href="http://www.vfmd.org/vfmd-spec/specification/#procedure-for-identifying-emphasis-tags" rel="nofollow noreferrer noopener" target="_blank">vfmd</a>. vfmd uses the terminology "emphasis indicator string" instead of "delimiter run," and its rules for distinguishing left- and right-flanking runs are a bit more complex than the ones given here.)</p> -<p data-sourcepos="6182:1-6182:56" dir="auto">The following rules define emphasis and strong emphasis:</p> -<ol data-sourcepos="6184:1-6248:0" dir="auto"> -<li data-sourcepos="6184:1-6186:0"> -<p data-sourcepos="6184:5-6185:71">A single <code>*</code> character <a href="@">can open emphasis</a> +<p data-sourcepos="6900:1-6900:56" dir="auto">The following rules define emphasis and strong emphasis:</p> +<ol data-sourcepos="6902:1-6966:0" dir="auto"> +<li data-sourcepos="6902:1-6904:0"> +<p data-sourcepos="6902:5-6903:71">A single <code>*</code> character <a href="@">can open emphasis</a> iff (if and only if) it is part of a [left-flanking delimiter run].</p> </li> -<li data-sourcepos="6187:1-6192:0"> -<p data-sourcepos="6187:5-6191:28">A single <code>_</code> character [can open emphasis] iff +<li data-sourcepos="6905:1-6910:0"> +<p data-sourcepos="6905:5-6909:28">A single <code>_</code> character [can open emphasis] iff it is part of a [left-flanking delimiter run] and either (a) not part of a [right-flanking delimiter run] or (b) part of a [right-flanking delimiter run] preceded by punctuation.</p> </li> -<li data-sourcepos="6193:1-6195:0"> -<p data-sourcepos="6193:5-6194:55">A single <code>*</code> character <a href="@">can close emphasis</a> +<li data-sourcepos="6911:1-6913:0"> +<p data-sourcepos="6911:5-6912:55">A single <code>*</code> character <a href="@">can close emphasis</a> iff it is part of a [right-flanking delimiter run].</p> </li> -<li data-sourcepos="6196:1-6201:0"> -<p data-sourcepos="6196:5-6200:28">A single <code>_</code> character [can close emphasis] iff +<li data-sourcepos="6914:1-6919:0"> +<p data-sourcepos="6914:5-6918:28">A single <code>_</code> character [can close emphasis] iff it is part of a [right-flanking delimiter run] and either (a) not part of a [left-flanking delimiter run] or (b) part of a [left-flanking delimiter run] followed by punctuation.</p> </li> -<li data-sourcepos="6202:1-6204:0"> -<p data-sourcepos="6202:5-6203:54">A double <code>**</code> <a href="@">can open strong emphasis</a> +<li data-sourcepos="6920:1-6922:0"> +<p data-sourcepos="6920:5-6921:54">A double <code>**</code> <a href="@">can open strong emphasis</a> iff it is part of a [left-flanking delimiter run].</p> </li> -<li data-sourcepos="6205:1-6210:0"> -<p data-sourcepos="6205:5-6209:28">A double <code>__</code> [can open strong emphasis] iff +<li data-sourcepos="6923:1-6928:0"> +<p data-sourcepos="6923:5-6927:28">A double <code>__</code> [can open strong emphasis] iff it is part of a [left-flanking delimiter run] and either (a) not part of a [right-flanking delimiter run] or (b) part of a [right-flanking delimiter run] preceded by punctuation.</p> </li> -<li data-sourcepos="6211:1-6213:0"> -<p data-sourcepos="6211:5-6212:55">A double <code>**</code> <a href="@">can close strong emphasis</a> +<li data-sourcepos="6929:1-6931:0"> +<p data-sourcepos="6929:5-6930:55">A double <code>**</code> <a href="@">can close strong emphasis</a> iff it is part of a [right-flanking delimiter run].</p> </li> -<li data-sourcepos="6214:1-6219:0"> -<p data-sourcepos="6214:5-6218:28">A double <code>__</code> [can close strong emphasis] iff +<li data-sourcepos="6932:1-6937:0"> +<p data-sourcepos="6932:5-6936:28">A double <code>__</code> [can close strong emphasis] iff it is part of a [right-flanking delimiter run] and either (a) not part of a [left-flanking delimiter run] or (b) part of a [left-flanking delimiter run] followed by punctuation.</p> </li> -<li data-sourcepos="6220:1-6229:0"> -<p data-sourcepos="6220:5-6228:19">Emphasis begins with a delimiter that [can open emphasis] and ends +<li data-sourcepos="6938:1-6947:0"> +<p data-sourcepos="6938:5-6946:19">Emphasis begins with a delimiter that [can open emphasis] and ends with a delimiter that [can close emphasis], and that uses the same character (<code>_</code> or <code>*</code>) as the opening delimiter. The opening and closing delimiters must belong to separate @@ -5569,8 +6289,8 @@ delimiter runs containing the opening and closing delimiters must not be a multiple of 3 unless both lengths are multiples of 3.</p> </li> -<li data-sourcepos="6230:1-6240:0"> -<p data-sourcepos="6230:5-6239:23">Strong emphasis begins with a delimiter that +<li data-sourcepos="6948:1-6958:0"> +<p data-sourcepos="6948:5-6957:23">Strong emphasis begins with a delimiter that [can open strong emphasis] and ends with a delimiter that [can close strong emphasis], and that uses the same character (<code>_</code> or <code>*</code>) as the opening delimiter. The @@ -5581,45 +6301,45 @@ the delimiter runs containing the opening and closing delimiters must not be a multiple of 3 unless both lengths are multiples of 3.</p> </li> -<li data-sourcepos="6241:1-6244:0"> -<p data-sourcepos="6241:5-6243:25">A literal <code>*</code> character cannot occur at the beginning or end of +<li data-sourcepos="6959:1-6962:0"> +<p data-sourcepos="6959:5-6961:25">A literal <code>*</code> character cannot occur at the beginning or end of <code>*</code>-delimited emphasis or <code>**</code>-delimited strong emphasis, unless it is backslash-escaped.</p> </li> -<li data-sourcepos="6245:1-6248:0"> -<p data-sourcepos="6245:5-6247:25">A literal <code>_</code> character cannot occur at the beginning or end of +<li data-sourcepos="6963:1-6966:0"> +<p data-sourcepos="6963:5-6965:25">A literal <code>_</code> character cannot occur at the beginning or end of <code>_</code>-delimited emphasis or <code>__</code>-delimited strong emphasis, unless it is backslash-escaped.</p> </li> </ol> -<p data-sourcepos="6249:1-6250:43" dir="auto">Where rules 1--12 above are compatible with multiple parsings, +<p data-sourcepos="6967:1-6968:43" dir="auto">Where rules 1--12 above are compatible with multiple parsings, the following principles resolve ambiguity:</p> -<ol start="13" data-sourcepos="6252:1-6277:0" dir="auto"> -<li data-sourcepos="6252:1-6255:0"> -<p data-sourcepos="6252:5-6254:28">The number of nestings should be minimized. Thus, for example, +<ol start="13" data-sourcepos="6970:1-6995:0" dir="auto"> +<li data-sourcepos="6970:1-6973:0"> +<p data-sourcepos="6970:5-6972:28">The number of nestings should be minimized. Thus, for example, an interpretation <code><strong>...</strong></code> is always preferred to <code><em><em>...</em></em></code>.</p> </li> -<li data-sourcepos="6256:1-6258:0"> -<p data-sourcepos="6256:5-6257:49">An interpretation <code><em><strong>...</strong></em></code> is always +<li data-sourcepos="6974:1-6976:0"> +<p data-sourcepos="6974:5-6975:49">An interpretation <code><em><strong>...</strong></em></code> is always preferred to <code><strong><em>...</em></strong></code>.</p> </li> -<li data-sourcepos="6259:1-6264:0"> -<p data-sourcepos="6259:5-6263:34">When two potential emphasis or strong emphasis spans overlap, +<li data-sourcepos="6977:1-6982:0"> +<p data-sourcepos="6977:5-6981:34">When two potential emphasis or strong emphasis spans overlap, so that the second begins before the first ends and ends after the first ends, the first takes precedence. Thus, for example, <code>*foo _bar* baz_</code> is parsed as <code><em>foo _bar</em> baz_</code> rather than <code>*foo <em>bar* baz</em></code>.</p> </li> -<li data-sourcepos="6265:1-6270:0"> -<p data-sourcepos="6265:5-6269:49">When there are two potential emphasis or strong emphasis spans +<li data-sourcepos="6983:1-6988:0"> +<p data-sourcepos="6983:5-6987:49">When there are two potential emphasis or strong emphasis spans with the same closing delimiter, the shorter one (the one that opens later) takes precedence. Thus, for example, <code>**foo **bar baz**</code> is parsed as <code>**foo <strong>bar baz</strong></code> rather than <code><strong>foo **bar baz</strong></code>.</p> </li> -<li data-sourcepos="6271:1-6277:0"> -<p data-sourcepos="6271:5-6276:26">Inline code spans, links, images, and HTML tags group more tightly +<li data-sourcepos="6989:1-6995:0"> +<p data-sourcepos="6989:5-6994:26">Inline code spans, links, images, and HTML tags group more tightly than emphasis. So, when there is a choice between an interpretation that contains one of these elements and one that does not, the former always wins. Thus, for example, <code>*[foo*](bar)</code> is @@ -5627,1003 +6347,1269 @@ parsed as <code>*<a href="bar">foo*</a></code> rather than as <code><em>[foo</em>](bar)</code>.</p> </li> </ol> -<p data-sourcepos="6278:1-6278:60" dir="auto">These rules can be illustrated through a series of examples.</p> -<p data-sourcepos="6280:1-6280:7" dir="auto">Rule 1:</p> +<p data-sourcepos="6996:1-6996:60" dir="auto">These rules can be illustrated through a series of examples.</p> +<p data-sourcepos="6998:1-6998:7" dir="auto">Rule 1:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7000:1-7002:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo bar*</span></code></pre> +<copy-code></copy-code> +</div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6282:1-6286:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo bar*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>foo bar</em></p></span></code></pre> +<pre data-sourcepos="7004:1-7006:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo bar</em></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6289:1-6290:66" dir="auto">This is not emphasis, because the opening <code>*</code> is followed by +<p data-sourcepos="7009:1-7010:66" dir="auto">This is not emphasis, because the opening <code>*</code> is followed by whitespace, and hence not part of a [left-flanking delimiter run]:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6292:1-6296:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">a * foo bar*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>a * foo bar*</p></span></code></pre> +<pre data-sourcepos="7012:1-7014:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">a * foo bar*</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6299:1-6301:44" dir="auto">This is not emphasis, because the opening <code>*</code> is preceded +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7016:1-7018:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>a * foo bar*</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="7021:1-7023:44" dir="auto">This is not emphasis, because the opening <code>*</code> is preceded by an alphanumeric and followed by punctuation, and hence not part of a [left-flanking delimiter run]:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6303:1-6307:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">a*"foo"*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>a*&quot;foo&quot;*</p></span></code></pre> +<pre data-sourcepos="7025:1-7027:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">a*"foo"*</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7029:1-7031:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>a*&quot;foo&quot;*</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="7034:1-7034:52" dir="auto">Unicode nonbreaking spaces count as whitespace, too:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7036:1-7038:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">* a *</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7040:1-7042:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>* a *</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6310:1-6310:52" dir="auto">Unicode nonbreaking spaces count as whitespace, too:</p> +<p data-sourcepos="7045:1-7045:41" dir="auto">Intraword emphasis with <code>*</code> is permitted:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6312:1-6316:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">* a *</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>* a *</p></span></code></pre> +<pre data-sourcepos="7047:1-7049:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo*bar*</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6319:1-6319:41" dir="auto">Intraword emphasis with <code>*</code> is permitted:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6321:1-6325:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo*bar*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo<em>bar</em></p></span></code></pre> +<pre data-sourcepos="7051:1-7053:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo<em>bar</em></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6328:1-6332:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">5*6*78</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>5<em>6</em>78</p></span></code></pre> +<pre data-sourcepos="7056:1-7058:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">5*6*78</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6335:1-6335:7" dir="auto">Rule 2:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6337:1-6341:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo bar_</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>foo bar</em></p></span></code></pre> +<pre data-sourcepos="7060:1-7062:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>5<em>6</em>78</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6344:1-6345:11" dir="auto">This is not emphasis, because the opening <code>_</code> is followed by +<p data-sourcepos="7065:1-7065:7" dir="auto">Rule 2:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7067:1-7069:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo bar_</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7071:1-7073:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo bar</em></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="7076:1-7077:11" dir="auto">This is not emphasis, because the opening <code>_</code> is followed by whitespace:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6347:1-6351:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_ foo bar_</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>_ foo bar_</p></span></code></pre> +<pre data-sourcepos="7079:1-7081:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_ foo bar_</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6354:1-6355:47" dir="auto">This is not emphasis, because the opening <code>_</code> is preceded +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7083:1-7085:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_ foo bar_</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="7088:1-7089:47" dir="auto">This is not emphasis, because the opening <code>_</code> is preceded by an alphanumeric and followed by punctuation:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6357:1-6361:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">a_"foo"_</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>a_&quot;foo&quot;_</p></span></code></pre> +<pre data-sourcepos="7091:1-7093:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">a_"foo"_</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6364:1-6364:46" dir="auto">Emphasis with <code>_</code> is not allowed inside words:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6366:1-6370:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo_bar_</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo_bar_</p></span></code></pre> +<pre data-sourcepos="7095:1-7097:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>a_&quot;foo&quot;_</p></span></code></pre> <copy-code></copy-code> </div> +<p data-sourcepos="7100:1-7100:46" dir="auto">Emphasis with <code>_</code> is not allowed inside words:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6373:1-6377:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">5_6_78</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>5_6_78</p></span></code></pre> +<pre data-sourcepos="7102:1-7104:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo_bar_</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6380:1-6384:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">пристаням_стремятся_</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>пристаням_стремятся_</p></span></code></pre> +<pre data-sourcepos="7106:1-7108:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo_bar_</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6387:1-6388:47" dir="auto">Here <code>_</code> does not generate emphasis, because the first delimiter run +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7111:1-7113:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">5_6_78</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7115:1-7117:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>5_6_78</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7120:1-7122:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">пристаням_стремятся_</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7124:1-7126:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>пристаням_стремятся_</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="7129:1-7130:47" dir="auto">Here <code>_</code> does not generate emphasis, because the first delimiter run is right-flanking and the second left-flanking:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6390:1-6394:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aa_"bb"_cc</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>aa_&quot;bb&quot;_cc</p></span></code></pre> +<pre data-sourcepos="7132:1-7134:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aa_"bb"_cc</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7136:1-7138:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>aa_&quot;bb&quot;_cc</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6397:1-6399:12" dir="auto">This is emphasis, even though the opening delimiter is +<p data-sourcepos="7141:1-7143:12" dir="auto">This is emphasis, even though the opening delimiter is both left- and right-flanking, because it is preceded by punctuation:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6401:1-6405:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo-_(bar)_</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo-<em>(bar)</em></p></span></code></pre> +<pre data-sourcepos="7145:1-7147:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo-_(bar)_</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7149:1-7151:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo-<em>(bar)</em></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6408:1-6408:7" dir="auto">Rule 3:</p> -<p data-sourcepos="6410:1-6411:32" dir="auto">This is not emphasis, because the closing delimiter does +<p data-sourcepos="7154:1-7154:7" dir="auto">Rule 3:</p> +<p data-sourcepos="7156:1-7157:32" dir="auto">This is not emphasis, because the closing delimiter does not match the opening delimiter:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6413:1-6417:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>_foo*</p></span></code></pre> +<pre data-sourcepos="7159:1-7161:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo*</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7163:1-7165:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_foo*</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6420:1-6421:11" dir="auto">This is not emphasis, because the closing <code>*</code> is preceded by +<p data-sourcepos="7168:1-7169:11" dir="auto">This is not emphasis, because the closing <code>*</code> is preceded by whitespace:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6423:1-6427:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo bar *</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>*foo bar *</p></span></code></pre> +<pre data-sourcepos="7171:1-7173:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo bar *</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6430:1-6430:36" dir="auto">A newline also counts as whitespace:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6432:1-6438:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo bar</span> -<span id="LC2" class="line" lang="plaintext">*</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>*foo bar</span> -<span id="LC5" class="line" lang="plaintext">*</p></span></code></pre> +<pre data-sourcepos="7175:1-7177:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*foo bar *</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="7180:1-7180:36" dir="auto">A newline also counts as whitespace:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7182:1-7185:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo bar</span> +<span id="LC2" class="line" lang="plaintext">*</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6441:1-6443:58" dir="auto">This is not emphasis, because the second <code>*</code> is +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7187:1-7190:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*foo bar</span> +<span id="LC2" class="line" lang="plaintext">*</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="7193:1-7195:58" dir="auto">This is not emphasis, because the second <code>*</code> is preceded by punctuation and followed by an alphanumeric (hence it is not part of a [right-flanking delimiter run]:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6445:1-6449:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*(*foo)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>*(*foo)</p></span></code></pre> +<pre data-sourcepos="7197:1-7199:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*(*foo)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7201:1-7203:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*(*foo)</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6452:1-6453:18" dir="auto">The point of this restriction is more easily appreciated +<p data-sourcepos="7206:1-7207:18" dir="auto">The point of this restriction is more easily appreciated with this example:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6455:1-6459:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*(*foo*)*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>(<em>foo</em>)</em></p></span></code></pre> +<pre data-sourcepos="7209:1-7211:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*(*foo*)*</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7213:1-7215:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>(<em>foo</em>)</em></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="7218:1-7218:39" dir="auto">Intraword emphasis with <code>*</code> is allowed:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7220:1-7222:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo*bar</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6462:1-6462:39" dir="auto">Intraword emphasis with <code>*</code> is allowed:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6464:1-6468:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo*bar</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>foo</em>bar</p></span></code></pre> +<pre data-sourcepos="7224:1-7226:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo</em>bar</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6472:1-6472:7" dir="auto">Rule 4:</p> -<p data-sourcepos="6474:1-6475:11" dir="auto">This is not emphasis, because the closing <code>_</code> is preceded by +<p data-sourcepos="7230:1-7230:7" dir="auto">Rule 4:</p> +<p data-sourcepos="7232:1-7233:11" dir="auto">This is not emphasis, because the closing <code>_</code> is preceded by whitespace:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6477:1-6481:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo bar _</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>_foo bar _</p></span></code></pre> +<pre data-sourcepos="7235:1-7237:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo bar _</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6484:1-6485:56" dir="auto">This is not emphasis, because the second <code>_</code> is +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7239:1-7241:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_foo bar _</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="7244:1-7245:56" dir="auto">This is not emphasis, because the second <code>_</code> is preceded by punctuation and followed by an alphanumeric:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6487:1-6491:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_(_foo)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>_(_foo)</p></span></code></pre> +<pre data-sourcepos="7247:1-7249:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_(_foo)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7251:1-7253:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_(_foo)</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="7256:1-7256:33" dir="auto">This is emphasis within emphasis:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7258:1-7260:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_(_foo_)_</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7262:1-7264:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>(<em>foo</em>)</em></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6494:1-6494:33" dir="auto">This is emphasis within emphasis:</p> +<p data-sourcepos="7267:1-7267:41" dir="auto">Intraword emphasis is disallowed for <code>_</code>:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6496:1-6500:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_(_foo_)_</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>(<em>foo</em>)</em></p></span></code></pre> +<pre data-sourcepos="7269:1-7271:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo_bar</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6503:1-6503:41" dir="auto">Intraword emphasis is disallowed for <code>_</code>:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6505:1-6509:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo_bar</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>_foo_bar</p></span></code></pre> +<pre data-sourcepos="7273:1-7275:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_foo_bar</p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6512:1-6516:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_пристаням_стремятся</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>_пристаням_стремятся</p></span></code></pre> +<pre data-sourcepos="7278:1-7280:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_пристаням_стремятся</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6519:1-6523:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo_bar_baz_</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>foo_bar_baz</em></p></span></code></pre> +<pre data-sourcepos="7282:1-7284:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_пристаням_стремятся</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6526:1-6528:12" dir="auto">This is emphasis, even though the closing delimiter is +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7287:1-7289:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo_bar_baz_</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7291:1-7293:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo_bar_baz</em></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="7296:1-7298:12" dir="auto">This is emphasis, even though the closing delimiter is both left- and right-flanking, because it is followed by punctuation:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6530:1-6534:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_(bar)_.</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>(bar)</em>.</p></span></code></pre> +<pre data-sourcepos="7300:1-7302:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_(bar)_.</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7304:1-7306:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>(bar)</em>.</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="7309:1-7309:7" dir="auto">Rule 5:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7311:1-7313:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo bar**</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6537:1-6537:7" dir="auto">Rule 5:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6539:1-6543:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo bar**</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong>foo bar</strong></p></span></code></pre> +<pre data-sourcepos="7315:1-7317:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo bar</strong></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6546:1-6547:23" dir="auto">This is not strong emphasis, because the opening delimiter is +<p data-sourcepos="7320:1-7321:23" dir="auto">This is not strong emphasis, because the opening delimiter is followed by whitespace:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6549:1-6553:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">** foo bar**</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>** foo bar**</p></span></code></pre> +<pre data-sourcepos="7323:1-7325:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">** foo bar**</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6556:1-6558:44" dir="auto">This is not strong emphasis, because the opening <code>**</code> is preceded +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7327:1-7329:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>** foo bar**</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="7332:1-7334:44" dir="auto">This is not strong emphasis, because the opening <code>**</code> is preceded by an alphanumeric and followed by punctuation, and hence not part of a [left-flanking delimiter run]:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6560:1-6564:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">a**"foo"**</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>a**&quot;foo&quot;**</p></span></code></pre> +<pre data-sourcepos="7336:1-7338:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">a**"foo"**</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7340:1-7342:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>a**&quot;foo&quot;**</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="7345:1-7345:49" dir="auto">Intraword strong emphasis with <code>**</code> is permitted:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7347:1-7349:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo**bar**</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7351:1-7353:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo<strong>bar</strong></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6567:1-6567:49" dir="auto">Intraword strong emphasis with <code>**</code> is permitted:</p> +<p data-sourcepos="7356:1-7356:7" dir="auto">Rule 6:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6569:1-6573:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo**bar**</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo<strong>bar</strong></p></span></code></pre> +<pre data-sourcepos="7358:1-7360:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo bar__</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6576:1-6576:7" dir="auto">Rule 6:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6578:1-6582:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo bar__</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong>foo bar</strong></p></span></code></pre> +<pre data-sourcepos="7362:1-7364:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo bar</strong></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6585:1-6586:23" dir="auto">This is not strong emphasis, because the opening delimiter is +<p data-sourcepos="7367:1-7368:23" dir="auto">This is not strong emphasis, because the opening delimiter is followed by whitespace:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6588:1-6592:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__ foo bar__</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>__ foo bar__</p></span></code></pre> +<pre data-sourcepos="7370:1-7372:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__ foo bar__</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6595:1-6595:31" dir="auto">A newline counts as whitespace:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6596:1-6602:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__</span> -<span id="LC2" class="line" lang="plaintext">foo bar__</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>__</span> -<span id="LC5" class="line" lang="plaintext">foo bar__</p></span></code></pre> +<pre data-sourcepos="7374:1-7376:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__ foo bar__</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6605:1-6606:47" dir="auto">This is not strong emphasis, because the opening <code>__</code> is preceded +<p data-sourcepos="7379:1-7379:31" dir="auto">A newline counts as whitespace:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7380:1-7383:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__</span> +<span id="LC2" class="line" lang="plaintext">foo bar__</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7385:1-7388:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__</span> +<span id="LC2" class="line" lang="plaintext">foo bar__</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="7391:1-7392:47" dir="auto">This is not strong emphasis, because the opening <code>__</code> is preceded by an alphanumeric and followed by punctuation:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6608:1-6612:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">a__"foo"__</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>a__&quot;foo&quot;__</p></span></code></pre> +<pre data-sourcepos="7394:1-7396:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">a__"foo"__</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7398:1-7400:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>a__&quot;foo&quot;__</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="7403:1-7403:49" dir="auto">Intraword strong emphasis is forbidden with <code>__</code>:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7405:1-7407:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo__bar__</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6615:1-6615:49" dir="auto">Intraword strong emphasis is forbidden with <code>__</code>:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6617:1-6621:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo__bar__</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo__bar__</p></span></code></pre> +<pre data-sourcepos="7409:1-7411:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo__bar__</p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6624:1-6628:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">5__6__78</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>5__6__78</p></span></code></pre> +<pre data-sourcepos="7414:1-7416:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">5__6__78</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6631:1-6635:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">пристаням__стремятся__</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>пристаням__стремятся__</p></span></code></pre> +<pre data-sourcepos="7418:1-7420:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>5__6__78</p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6638:1-6642:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo, __bar__, baz__</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong>foo, <strong>bar</strong>, baz</strong></p></span></code></pre> +<pre data-sourcepos="7423:1-7425:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">пристаням__стремятся__</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6645:1-6647:12" dir="auto">This is strong emphasis, even though the opening delimiter is +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7427:1-7429:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>пристаням__стремятся__</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7432:1-7434:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo, __bar__, baz__</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7436:1-7438:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo, <strong>bar</strong>, baz</strong></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="7441:1-7443:12" dir="auto">This is strong emphasis, even though the opening delimiter is both left- and right-flanking, because it is preceded by punctuation:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6649:1-6653:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo-__(bar)__</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo-<strong>(bar)</strong></p></span></code></pre> +<pre data-sourcepos="7445:1-7447:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo-__(bar)__</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7449:1-7451:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo-<strong>(bar)</strong></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6657:1-6657:7" dir="auto">Rule 7:</p> -<p data-sourcepos="6659:1-6660:14" dir="auto">This is not strong emphasis, because the closing delimiter is preceded +<p data-sourcepos="7455:1-7455:7" dir="auto">Rule 7:</p> +<p data-sourcepos="7457:1-7458:14" dir="auto">This is not strong emphasis, because the closing delimiter is preceded by whitespace:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6662:1-6666:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo bar **</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>**foo bar **</p></span></code></pre> +<pre data-sourcepos="7460:1-7462:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo bar **</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7464:1-7466:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>**foo bar **</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6669:1-6670:9" dir="auto">(Nor can it be interpreted as an emphasized <code>*foo bar *</code>, because of +<p data-sourcepos="7469:1-7470:9" dir="auto">(Nor can it be interpreted as an emphasized <code>*foo bar *</code>, because of Rule 11.)</p> -<p data-sourcepos="6672:1-6673:56" dir="auto">This is not strong emphasis, because the second <code>**</code> is +<p data-sourcepos="7472:1-7473:56" dir="auto">This is not strong emphasis, because the second <code>**</code> is preceded by punctuation and followed by an alphanumeric:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6675:1-6679:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**(**foo)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>**(**foo)</p></span></code></pre> +<pre data-sourcepos="7475:1-7477:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**(**foo)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7479:1-7481:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>**(**foo)</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6682:1-6683:20" dir="auto">The point of this restriction is more easily appreciated +<p data-sourcepos="7484:1-7485:20" dir="auto">The point of this restriction is more easily appreciated with these examples:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6685:1-6689:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*(**foo**)*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>(<strong>foo</strong>)</em></p></span></code></pre> +<pre data-sourcepos="7487:1-7489:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*(**foo**)*</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7491:1-7493:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>(<strong>foo</strong>)</em></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7496:1-7499:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**Gomphocarpus (*Gomphocarpus physocarpus*, syn.</span> +<span id="LC2" class="line" lang="plaintext">*Asclepias physocarpa*)**</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7501:1-7504:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>Gomphocarpus (<em>Gomphocarpus physocarpus</em>, syn.</span> +<span id="LC2" class="line" lang="plaintext"><em>Asclepias physocarpa</em>)</strong></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7507:1-7509:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo "*bar*" foo**</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6692:1-6698:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**Gomphocarpus (*Gomphocarpus physocarpus*, syn.</span> -<span id="LC2" class="line" lang="plaintext">*Asclepias physocarpa*)**</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p><strong>Gomphocarpus (<em>Gomphocarpus physocarpus</em>, syn.</span> -<span id="LC5" class="line" lang="plaintext"><em>Asclepias physocarpa</em>)</strong></p></span></code></pre> +<pre data-sourcepos="7511:1-7513:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo &quot;<em>bar</em>&quot; foo</strong></p></span></code></pre> <copy-code></copy-code> </div> +<p data-sourcepos="7516:1-7516:19" dir="auto">Intraword emphasis:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6701:1-6705:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo "*bar*" foo**</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong>foo &quot;<em>bar</em>&quot; foo</strong></p></span></code></pre> +<pre data-sourcepos="7518:1-7520:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo**bar</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6708:1-6708:19" dir="auto">Intraword emphasis:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6710:1-6714:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo**bar</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong>foo</strong>bar</p></span></code></pre> +<pre data-sourcepos="7522:1-7524:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo</strong>bar</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6717:1-6717:7" dir="auto">Rule 8:</p> -<p data-sourcepos="6719:1-6720:23" dir="auto">This is not strong emphasis, because the closing delimiter is +<p data-sourcepos="7527:1-7527:7" dir="auto">Rule 8:</p> +<p data-sourcepos="7529:1-7530:23" dir="auto">This is not strong emphasis, because the closing delimiter is preceded by whitespace:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6722:1-6726:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo bar __</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>__foo bar __</p></span></code></pre> +<pre data-sourcepos="7532:1-7534:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo bar __</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7536:1-7538:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__foo bar __</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6729:1-6730:56" dir="auto">This is not strong emphasis, because the second <code>__</code> is +<p data-sourcepos="7541:1-7542:56" dir="auto">This is not strong emphasis, because the second <code>__</code> is preceded by punctuation and followed by an alphanumeric:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6732:1-6736:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__(__foo)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>__(__foo)</p></span></code></pre> +<pre data-sourcepos="7544:1-7546:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__(__foo)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7548:1-7550:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__(__foo)</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6739:1-6740:18" dir="auto">The point of this restriction is more easily appreciated +<p data-sourcepos="7553:1-7554:18" dir="auto">The point of this restriction is more easily appreciated with this example:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6742:1-6746:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_(__foo__)_</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>(<strong>foo</strong>)</em></p></span></code></pre> +<pre data-sourcepos="7556:1-7558:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_(__foo__)_</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7560:1-7562:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>(<strong>foo</strong>)</em></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="7565:1-7565:49" dir="auto">Intraword strong emphasis is forbidden with <code>__</code>:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7567:1-7569:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo__bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7571:1-7573:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__foo__bar</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7576:1-7578:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__пристаням__стремятся</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6749:1-6749:49" dir="auto">Intraword strong emphasis is forbidden with <code>__</code>:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6751:1-6755:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo__bar</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>__foo__bar</p></span></code></pre> +<pre data-sourcepos="7580:1-7582:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__пристаням__стремятся</p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6758:1-6762:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__пристаням__стремятся</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>__пристаням__стремятся</p></span></code></pre> +<pre data-sourcepos="7585:1-7587:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo__bar__baz__</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6765:1-6769:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo__bar__baz__</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong>foo__bar__baz</strong></p></span></code></pre> +<pre data-sourcepos="7589:1-7591:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo__bar__baz</strong></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6772:1-6774:12" dir="auto">This is strong emphasis, even though the closing delimiter is +<p data-sourcepos="7594:1-7596:12" dir="auto">This is strong emphasis, even though the closing delimiter is both left- and right-flanking, because it is followed by punctuation:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6776:1-6780:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__(bar)__.</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong>(bar)</strong>.</p></span></code></pre> +<pre data-sourcepos="7598:1-7600:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__(bar)__.</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7602:1-7604:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>(bar)</strong>.</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6783:1-6783:7" dir="auto">Rule 9:</p> -<p data-sourcepos="6785:1-6786:16" dir="auto">Any nonempty sequence of inline elements can be the contents of an +<p data-sourcepos="7607:1-7607:7" dir="auto">Rule 9:</p> +<p data-sourcepos="7609:1-7610:16" dir="auto">Any nonempty sequence of inline elements can be the contents of an emphasized span.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6788:1-6792:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo [bar](/url)*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>foo <a href="/url">bar</a></em></p></span></code></pre> +<pre data-sourcepos="7612:1-7614:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo [bar](/url)*</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7616:1-7618:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo <a href="/url">bar</a></em></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7621:1-7624:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo</span> +<span id="LC2" class="line" lang="plaintext">bar*</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6795:1-6801:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo</span> -<span id="LC2" class="line" lang="plaintext">bar*</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p><em>foo</span> -<span id="LC5" class="line" lang="plaintext">bar</em></p></span></code></pre> +<pre data-sourcepos="7626:1-7629:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo</span> +<span id="LC2" class="line" lang="plaintext">bar</em></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6804:1-6805:16" dir="auto">In particular, emphasis and strong emphasis can be nested +<p data-sourcepos="7632:1-7633:16" dir="auto">In particular, emphasis and strong emphasis can be nested inside emphasis:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6807:1-6811:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo __bar__ baz_</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>foo <strong>bar</strong> baz</em></p></span></code></pre> +<pre data-sourcepos="7635:1-7637:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo __bar__ baz_</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6814:1-6818:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo _bar_ baz_</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>foo <em>bar</em> baz</em></p></span></code></pre> +<pre data-sourcepos="7639:1-7641:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo <strong>bar</strong> baz</em></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6821:1-6825:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo_ bar_</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em><em>foo</em> bar</em></p></span></code></pre> +<pre data-sourcepos="7644:1-7646:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo _bar_ baz_</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6828:1-6832:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo *bar**</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>foo <em>bar</em></em></p></span></code></pre> +<pre data-sourcepos="7648:1-7650:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo <em>bar</em> baz</em></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6835:1-6839:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo **bar** baz*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>foo <strong>bar</strong> baz</em></p></span></code></pre> +<pre data-sourcepos="7653:1-7655:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo_ bar_</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6841:1-6845:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo**bar**baz*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>foo<strong>bar</strong>baz</em></p></span></code></pre> +<pre data-sourcepos="7657:1-7659:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em><em>foo</em> bar</em></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6847:1-6847:51" dir="auto">Note that in the preceding case, the interpretation</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6849:1-6851:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="nt"><p><em></span>foo<span class="nt"></em><em></span>bar<span class="nt"><em></em></span>baz<span class="nt"></em></p></span></span></code></pre> +<pre data-sourcepos="7662:1-7664:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo *bar**</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6854:1-6859:32" dir="auto">is precluded by the condition that a delimiter that +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7666:1-7668:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo <em>bar</em></em></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7671:1-7673:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo **bar** baz*</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7675:1-7677:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo <strong>bar</strong> baz</em></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7679:1-7681:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo**bar**baz*</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7683:1-7685:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo<strong>bar</strong>baz</em></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="7687:1-7687:51" dir="auto">Note that in the preceding case, the interpretation</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7689:1-7691:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="nt"><p><em></span>foo<span class="nt"></em><em></span>bar<span class="nt"><em></em></span>baz<span class="nt"></em></p></span></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="7694:1-7699:32" dir="auto">is precluded by the condition that a delimiter that can both open and close (like the <code>*</code> after <code>foo</code>) cannot form emphasis if the sum of the lengths of the delimiter runs containing the opening and closing delimiters is a multiple of 3 unless both lengths are multiples of 3.</p> -<p data-sourcepos="6862:1-6863:34" dir="auto">For the same reason, we don't get two consecutive +<p data-sourcepos="7702:1-7703:34" dir="auto">For the same reason, we don't get two consecutive emphasis sections in this example:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6865:1-6869:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo**bar*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>foo**bar</em></p></span></code></pre> +<pre data-sourcepos="7705:1-7707:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo**bar*</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7709:1-7711:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo**bar</em></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6872:1-6875:8" dir="auto">The same condition ensures that the following +<p data-sourcepos="7714:1-7717:8" dir="auto">The same condition ensures that the following cases are all strong emphasis nested inside emphasis, even when the interior spaces are omitted:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6878:1-6882:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">***foo** bar*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em><strong>foo</strong> bar</em></p></span></code></pre> +<pre data-sourcepos="7720:1-7722:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">***foo** bar*</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7724:1-7726:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em><strong>foo</strong> bar</em></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6885:1-6889:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo **bar***</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>foo <strong>bar</strong></em></p></span></code></pre> +<pre data-sourcepos="7729:1-7731:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo **bar***</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6892:1-6896:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo**bar***</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>foo<strong>bar</strong></em></p></span></code></pre> +<pre data-sourcepos="7733:1-7735:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo <strong>bar</strong></em></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6899:1-6901:34" dir="auto">When the lengths of the interior closing and opening +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7738:1-7740:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo**bar***</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7742:1-7744:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo<strong>bar</strong></em></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="7747:1-7749:34" dir="auto">When the lengths of the interior closing and opening delimiter runs are <em>both</em> multiples of 3, though, they can match to create emphasis:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6903:1-6907:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo***bar***baz</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo<em><strong>bar</strong></em>baz</p></span></code></pre> +<pre data-sourcepos="7751:1-7753:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo***bar***baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7755:1-7757:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo<em><strong>bar</strong></em>baz</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7759:1-7761:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo******bar*********baz</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6909:1-6913:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo******bar*********baz</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo<strong><strong><strong>bar</strong></strong></strong>***baz</p></span></code></pre> +<pre data-sourcepos="7763:1-7765:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo<strong><strong><strong>bar</strong></strong></strong>***baz</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6916:1-6916:42" dir="auto">Indefinite levels of nesting are possible:</p> +<p data-sourcepos="7768:1-7768:42" dir="auto">Indefinite levels of nesting are possible:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6918:1-6922:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo **bar *baz* bim** bop*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>foo <strong>bar <em>baz</em> bim</strong> bop</em></p></span></code></pre> +<pre data-sourcepos="7770:1-7772:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo **bar *baz* bim** bop*</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6925:1-6929:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo [*bar*](/url)*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>foo <a href="/url"><em>bar</em></a></em></p></span></code></pre> +<pre data-sourcepos="7774:1-7776:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo <strong>bar <em>baz</em> bim</strong> bop</em></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6932:1-6932:50" dir="auto">There can be no empty emphasis or strong emphasis:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6934:1-6938:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">** is not an empty emphasis</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>** is not an empty emphasis</p></span></code></pre> +<pre data-sourcepos="7779:1-7781:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo [*bar*](/url)*</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6941:1-6945:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**** is not an empty strong emphasis</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>**** is not an empty strong emphasis</p></span></code></pre> +<pre data-sourcepos="7783:1-7785:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo <a href="/url"><em>bar</em></a></em></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6949:1-6949:8" dir="auto">Rule 10:</p> -<p data-sourcepos="6951:1-6952:25" dir="auto">Any nonempty sequence of inline elements can be the contents of an +<p data-sourcepos="7788:1-7788:50" dir="auto">There can be no empty emphasis or strong emphasis:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7790:1-7792:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">** is not an empty emphasis</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7794:1-7796:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>** is not an empty emphasis</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7799:1-7801:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**** is not an empty strong emphasis</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7803:1-7805:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>**** is not an empty strong emphasis</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="7809:1-7809:8" dir="auto">Rule 10:</p> +<p data-sourcepos="7811:1-7812:25" dir="auto">Any nonempty sequence of inline elements can be the contents of an strongly emphasized span.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6954:1-6958:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo [bar](/url)**</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong>foo <a href="/url">bar</a></strong></p></span></code></pre> +<pre data-sourcepos="7814:1-7816:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo [bar](/url)**</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6961:1-6967:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo</span> -<span id="LC2" class="line" lang="plaintext">bar**</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p><strong>foo</span> -<span id="LC5" class="line" lang="plaintext">bar</strong></p></span></code></pre> +<pre data-sourcepos="7818:1-7820:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo <a href="/url">bar</a></strong></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="6970:1-6971:23" dir="auto">In particular, emphasis and strong emphasis can be nested +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7823:1-7826:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo</span> +<span id="LC2" class="line" lang="plaintext">bar**</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7828:1-7831:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo</span> +<span id="LC2" class="line" lang="plaintext">bar</strong></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="7834:1-7835:23" dir="auto">In particular, emphasis and strong emphasis can be nested inside strong emphasis:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6973:1-6977:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo _bar_ baz__</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong>foo <em>bar</em> baz</strong></p></span></code></pre> +<pre data-sourcepos="7837:1-7839:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo _bar_ baz__</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7841:1-7843:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo <em>bar</em> baz</strong></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7846:1-7848:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo __bar__ baz__</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7850:1-7852:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo <strong>bar</strong> baz</strong></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7855:1-7857:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">____foo__ bar__</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7859:1-7861:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong><strong>foo</strong> bar</strong></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7864:1-7866:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo **bar****</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7868:1-7870:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo <strong>bar</strong></strong></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7873:1-7875:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo *bar* baz**</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7877:1-7879:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo <em>bar</em> baz</strong></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7882:1-7884:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo*bar*baz**</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7886:1-7888:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo<em>bar</em>baz</strong></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7891:1-7893:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">***foo* bar**</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7895:1-7897:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong><em>foo</em> bar</strong></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7900:1-7902:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo *bar***</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6980:1-6984:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo __bar__ baz__</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong>foo <strong>bar</strong> baz</strong></p></span></code></pre> +<pre data-sourcepos="7904:1-7906:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo <em>bar</em></strong></p></span></code></pre> <copy-code></copy-code> </div> +<p data-sourcepos="7909:1-7909:42" dir="auto">Indefinite levels of nesting are possible:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6987:1-6991:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">____foo__ bar__</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong><strong>foo</strong> bar</strong></p></span></code></pre> +<pre data-sourcepos="7911:1-7914:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo *bar **baz**</span> +<span id="LC2" class="line" lang="plaintext">bim* bop**</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6994:1-6998:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo **bar****</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong>foo <strong>bar</strong></strong></p></span></code></pre> +<pre data-sourcepos="7916:1-7919:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo <em>bar <strong>baz</strong></span> +<span id="LC2" class="line" lang="plaintext">bim</em> bop</strong></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7001:1-7005:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo *bar* baz**</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong>foo <em>bar</em> baz</strong></p></span></code></pre> +<pre data-sourcepos="7922:1-7924:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo [*bar*](/url)**</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7008:1-7012:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo*bar*baz**</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong>foo<em>bar</em>baz</strong></p></span></code></pre> +<pre data-sourcepos="7926:1-7928:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo <a href="/url"><em>bar</em></a></strong></p></span></code></pre> <copy-code></copy-code> </div> +<p data-sourcepos="7931:1-7931:50" dir="auto">There can be no empty emphasis or strong emphasis:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7015:1-7019:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">***foo* bar**</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong><em>foo</em> bar</strong></p></span></code></pre> +<pre data-sourcepos="7933:1-7935:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__ is not an empty emphasis</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7022:1-7026:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo *bar***</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong>foo <em>bar</em></strong></p></span></code></pre> +<pre data-sourcepos="7937:1-7939:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__ is not an empty emphasis</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7029:1-7029:42" dir="auto">Indefinite levels of nesting are possible:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7031:1-7037:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo *bar **baz**</span> -<span id="LC2" class="line" lang="plaintext">bim* bop**</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p><strong>foo <em>bar <strong>baz</strong></span> -<span id="LC5" class="line" lang="plaintext">bim</em> bop</strong></p></span></code></pre> +<pre data-sourcepos="7942:1-7944:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">____ is not an empty strong emphasis</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7040:1-7044:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo [*bar*](/url)**</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong>foo <a href="/url"><em>bar</em></a></strong></p></span></code></pre> +<pre data-sourcepos="7946:1-7948:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>____ is not an empty strong emphasis</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7047:1-7047:50" dir="auto">There can be no empty emphasis or strong emphasis:</p> +<p data-sourcepos="7952:1-7952:8" dir="auto">Rule 11:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7049:1-7053:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__ is not an empty emphasis</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>__ is not an empty emphasis</p></span></code></pre> +<pre data-sourcepos="7954:1-7956:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo ***</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7056:1-7060:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">____ is not an empty strong emphasis</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>____ is not an empty strong emphasis</p></span></code></pre> +<pre data-sourcepos="7958:1-7960:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo ***</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7064:1-7064:8" dir="auto">Rule 11:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7066:1-7070:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo ***</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo ***</p></span></code></pre> +<pre data-sourcepos="7963:1-7965:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo *\**</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7073:1-7077:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo *\**</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo <em>*</em></p></span></code></pre> +<pre data-sourcepos="7967:1-7969:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <em>*</em></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7080:1-7084:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo *_*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo <em>_</em></p></span></code></pre> +<pre data-sourcepos="7972:1-7974:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo *_*</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7087:1-7091:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo *****</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo *****</p></span></code></pre> +<pre data-sourcepos="7976:1-7978:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <em>_</em></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7094:1-7098:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo **\***</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo <strong>*</strong></p></span></code></pre> +<pre data-sourcepos="7981:1-7983:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo *****</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7101:1-7105:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo **_**</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo <strong>_</strong></p></span></code></pre> +<pre data-sourcepos="7985:1-7987:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo *****</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7108:1-7110:32" dir="auto">Note that when delimiters do not match evenly, Rule 11 determines +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7990:1-7992:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo **\***</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7994:1-7996:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <strong>*</strong></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="7999:1-8001:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo **_**</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8003:1-8005:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <strong>_</strong></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="8008:1-8010:32" dir="auto">Note that when delimiters do not match evenly, Rule 11 determines that the excess literal <code>*</code> characters will appear outside of the emphasis, rather than inside it:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7112:1-7116:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>*<em>foo</em></p></span></code></pre> +<pre data-sourcepos="8012:1-8014:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo*</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8016:1-8018:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*<em>foo</em></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8021:1-8023:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo**</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8025:1-8027:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo</em>*</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8030:1-8032:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">***foo**</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7119:1-7123:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo**</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>foo</em>*</p></span></code></pre> +<pre data-sourcepos="8034:1-8036:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*<strong>foo</strong></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7126:1-7130:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">***foo**</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>*<strong>foo</strong></p></span></code></pre> +<pre data-sourcepos="8039:1-8041:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">****foo*</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7133:1-7137:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">****foo*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>***<em>foo</em></p></span></code></pre> +<pre data-sourcepos="8043:1-8045:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>***<em>foo</em></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7140:1-7144:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo***</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong>foo</strong>*</p></span></code></pre> +<pre data-sourcepos="8048:1-8050:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo***</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7147:1-7151:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo****</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>foo</em>***</p></span></code></pre> +<pre data-sourcepos="8052:1-8054:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo</strong>*</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7155:1-7155:8" dir="auto">Rule 12:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7157:1-7161:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo ___</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo ___</p></span></code></pre> +<pre data-sourcepos="8057:1-8059:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo****</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7164:1-7168:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo _\__</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo <em>_</em></p></span></code></pre> +<pre data-sourcepos="8061:1-8063:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo</em>***</p></span></code></pre> <copy-code></copy-code> </div> +<p data-sourcepos="8067:1-8067:8" dir="auto">Rule 12:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7171:1-7175:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo _*_</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo <em>*</em></p></span></code></pre> +<pre data-sourcepos="8069:1-8071:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo ___</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7178:1-7182:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo _____</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo _____</p></span></code></pre> +<pre data-sourcepos="8073:1-8075:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo ___</p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7185:1-7189:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo __\___</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo <strong>_</strong></p></span></code></pre> +<pre data-sourcepos="8078:1-8080:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo _\__</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7192:1-7196:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo __*__</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo <strong>*</strong></p></span></code></pre> +<pre data-sourcepos="8082:1-8084:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <em>_</em></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7199:1-7203:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo_</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>_<em>foo</em></p></span></code></pre> +<pre data-sourcepos="8087:1-8089:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo _*_</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7206:1-7208:32" dir="auto">Note that when delimiters do not match evenly, Rule 12 determines +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8091:1-8093:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <em>*</em></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8096:1-8098:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo _____</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8100:1-8102:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo _____</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8105:1-8107:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo __\___</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8109:1-8111:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <strong>_</strong></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8114:1-8116:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo __*__</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8118:1-8120:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <strong>*</strong></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8123:1-8125:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo_</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8127:1-8129:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_<em>foo</em></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="8132:1-8134:32" dir="auto">Note that when delimiters do not match evenly, Rule 12 determines that the excess literal <code>_</code> characters will appear outside of the emphasis, rather than inside it:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7210:1-7214:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo__</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>foo</em>_</p></span></code></pre> +<pre data-sourcepos="8136:1-8138:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo__</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8140:1-8142:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo</em>_</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8145:1-8147:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">___foo__</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8149:1-8151:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_<strong>foo</strong></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8154:1-8156:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">____foo_</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8158:1-8160:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>___<em>foo</em></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7217:1-7221:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">___foo__</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>_<strong>foo</strong></p></span></code></pre> +<pre data-sourcepos="8163:1-8165:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo___</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7224:1-7228:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">____foo_</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>___<em>foo</em></p></span></code></pre> +<pre data-sourcepos="8167:1-8169:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo</strong>_</p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7231:1-7235:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo___</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong>foo</strong>_</p></span></code></pre> +<pre data-sourcepos="8172:1-8174:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo____</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7238:1-7242:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo____</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>foo</em>___</p></span></code></pre> +<pre data-sourcepos="8176:1-8178:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo</em>___</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7245:1-7246:44" dir="auto">Rule 13 implies that if you want emphasis nested directly inside +<p data-sourcepos="8181:1-8182:44" dir="auto">Rule 13 implies that if you want emphasis nested directly inside emphasis, you must use different delimiters:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7248:1-7252:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo**</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong>foo</strong></p></span></code></pre> +<pre data-sourcepos="8184:1-8186:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo**</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8188:1-8190:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo</strong></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8193:1-8195:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*_foo_*</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8197:1-8199:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em><em>foo</em></em></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8202:1-8204:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo__</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7255:1-7259:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*_foo_*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em><em>foo</em></em></p></span></code></pre> +<pre data-sourcepos="8206:1-8208:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>foo</strong></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7262:1-7266:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__foo__</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong>foo</strong></p></span></code></pre> +<pre data-sourcepos="8211:1-8213:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_*foo*_</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7269:1-7273:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_*foo*_</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em><em>foo</em></em></p></span></code></pre> +<pre data-sourcepos="8215:1-8217:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em><em>foo</em></em></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7276:1-7277:21" dir="auto">However, strong emphasis within strong emphasis is possible without +<p data-sourcepos="8220:1-8221:21" dir="auto">However, strong emphasis within strong emphasis is possible without switching delimiters:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7279:1-7283:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">****foo****</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong><strong>foo</strong></strong></p></span></code></pre> +<pre data-sourcepos="8223:1-8225:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">****foo****</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8227:1-8229:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong><strong>foo</strong></strong></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8232:1-8234:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">____foo____</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7286:1-7290:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">____foo____</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong><strong>foo</strong></strong></p></span></code></pre> +<pre data-sourcepos="8236:1-8238:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong><strong>foo</strong></strong></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7294:1-7295:11" dir="auto">Rule 13 can be applied to arbitrarily long sequences of +<p data-sourcepos="8242:1-8243:11" dir="auto">Rule 13 can be applied to arbitrarily long sequences of delimiters:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7297:1-7301:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">******foo******</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><strong><strong><strong>foo</strong></strong></strong></p></span></code></pre> +<pre data-sourcepos="8245:1-8247:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">******foo******</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8249:1-8251:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong><strong><strong>foo</strong></strong></strong></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="8254:1-8254:8" dir="auto">Rule 14:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8256:1-8258:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">***foo***</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8260:1-8262:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em><strong>foo</strong></em></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7304:1-7304:8" dir="auto">Rule 14:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7306:1-7310:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">***foo***</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em><strong>foo</strong></em></p></span></code></pre> +<pre data-sourcepos="8265:1-8267:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_____foo_____</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7313:1-7317:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_____foo_____</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em><strong><strong>foo</strong></strong></em></p></span></code></pre> +<pre data-sourcepos="8269:1-8271:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em><strong><strong>foo</strong></strong></em></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7320:1-7320:8" dir="auto">Rule 15:</p> +<p data-sourcepos="8274:1-8274:8" dir="auto">Rule 15:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7322:1-7326:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo _bar* baz_</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>foo _bar</em> baz_</p></span></code></pre> +<pre data-sourcepos="8276:1-8278:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo _bar* baz_</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7329:1-7333:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo __bar *baz bim__ bam*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>foo <strong>bar *baz bim</strong> bam</em></p></span></code></pre> +<pre data-sourcepos="8280:1-8282:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo _bar</em> baz_</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7336:1-7336:8" dir="auto">Rule 16:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7338:1-7342:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo **bar baz**</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>**foo <strong>bar baz</strong></p></span></code></pre> +<pre data-sourcepos="8285:1-8287:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo __bar *baz bim__ bam*</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7345:1-7349:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo *bar baz*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>*foo <em>bar baz</em></p></span></code></pre> +<pre data-sourcepos="8289:1-8291:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo <strong>bar *baz bim</strong> bam</em></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7352:1-7352:8" dir="auto">Rule 17:</p> +<p data-sourcepos="8294:1-8294:8" dir="auto">Rule 16:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7354:1-7358:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*[bar*](/url)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>*<a href="/url">bar*</a></p></span></code></pre> +<pre data-sourcepos="8296:1-8298:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**foo **bar baz**</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7361:1-7365:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo [bar_](/url)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>_foo <a href="/url">bar_</a></p></span></code></pre> +<pre data-sourcepos="8300:1-8302:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>**foo <strong>bar baz</strong></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7368:1-7372:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*<img src="foo" title="*"/></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>*<img src="foo" title="*"/></p></span></code></pre> +<pre data-sourcepos="8305:1-8307:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo *bar baz*</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7375:1-7379:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**<a href="**"></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>**<a href="**"></p></span></code></pre> +<pre data-sourcepos="8309:1-8311:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*foo <em>bar baz</em></p></span></code></pre> <copy-code></copy-code> </div> +<p data-sourcepos="8314:1-8314:8" dir="auto">Rule 17:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7382:1-7386:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__<a href="__"></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>__<a href="__"></p></span></code></pre> +<pre data-sourcepos="8316:1-8318:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*[bar*](/url)</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7389:1-7393:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*a `*`*</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>a <code>*</code></em></p></span></code></pre> +<pre data-sourcepos="8320:1-8322:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*<a href="/url">bar*</a></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7396:1-7400:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_a `_`_</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>a <code>_</code></em></p></span></code></pre> +<pre data-sourcepos="8325:1-8327:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_foo [bar_](/url)</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7403:1-7407:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**a<http://foo.bar/?q=**></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>**a<a href="http://foo.bar/?q=**">http://foo.bar/?q=**</a></p></span></code></pre> +<pre data-sourcepos="8329:1-8331:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_foo <a href="/url">bar_</a></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7410:1-7414:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__a<http://foo.bar/?q=__></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>__a<a href="http://foo.bar/?q=__">http://foo.bar/?q=__</a></p></span></code></pre> +<pre data-sourcepos="8334:1-8336:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*<img src="foo" title="*"/></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8338:1-8340:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*<img src="foo" title="*"/></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8343:1-8345:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**<a href="**"></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8347:1-8349:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>**<a href="**"></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8352:1-8354:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__<a href="__"></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8356:1-8358:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__<a href="__"></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8361:1-8363:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*a `*`*</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8365:1-8367:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>a <code>*</code></em></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8370:1-8372:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_a `_`_</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8374:1-8376:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>a <code>_</code></em></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8379:1-8381:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**a<http://foo.bar/?q=**></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8383:1-8385:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>**a<a href="http://foo.bar/?q=**">http://foo.bar/?q=**</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8388:1-8390:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__a<http://foo.bar/?q=__></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8392:1-8394:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__a<a href="http://foo.bar/?q=__">http://foo.bar/?q=__</a></p></span></code></pre> <copy-code></copy-code> </div> <div> -<h2 data-sourcepos="7419:1-7419:28"> +<h2 data-sourcepos="8399:1-8399:28"> <a id="user-content-strikethrough-extension" class="anchor" href="#strikethrough-extension" aria-hidden="true"></a>Strikethrough (extension)</h2> -<p data-sourcepos="7421:1-7422:10">GFM enables the <code>strikethrough</code> extension, where an additional emphasis type is +<p data-sourcepos="8401:1-8402:10">GFM enables the <code>strikethrough</code> extension, where an additional emphasis type is available.</p> -<p data-sourcepos="7424:1-7424:59">Strikethrough text is any text wrapped in two tildes (<code>~</code>).</p> +<p data-sourcepos="8404:1-8404:59">Strikethrough text is any text wrapped in two tildes (<code>~</code>).</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8406:1-8408:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~Hi~~ Hello, world!</span></code></pre> +<copy-code></copy-code> +</div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7426:1-7430:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~Hi~~ Hello, world!</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><del>Hi</del> Hello, world!</p></span></code></pre> +<pre data-sourcepos="8410:1-8412:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><del>Hi</del> Hello, world!</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7432:1-7433:17">As with regular emphasis delimiters, a new paragraph will cause strikethrough +<p data-sourcepos="8414:1-8415:17">As with regular emphasis delimiters, a new paragraph will cause strikethrough parsing to cease:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7435:1-7442:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">This ~~has a</span> +<pre data-sourcepos="8417:1-8421:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">This ~~has a</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">new paragraph~~.</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>This ~~has a</p></span> -<span id="LC6" class="line" lang="plaintext"><p>new paragraph~~.</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">new paragraph~~.</span></code></pre> <copy-code></copy-code> </div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8423:1-8426:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>This ~~has a</p></span> +<span id="LC2" class="line" lang="plaintext"><p>new paragraph~~.</p></span></code></pre> +<copy-code></copy-code> </div> -<h2 data-sourcepos="7446:1-7446:8" dir="auto"> +</div> +<h2 data-sourcepos="8430:1-8430:8" dir="auto"> <a id="user-content-links" class="anchor" href="#links" aria-hidden="true"></a>Links</h2> -<p data-sourcepos="7448:1-7453:13" dir="auto">A link contains [link text] (the visible text), a [link destination] +<p data-sourcepos="8432:1-8437:13" dir="auto">A link contains [link text] (the visible text), a [link destination] (the URI that is the link destination), and optionally a [link title]. There are two basic kinds of links in Markdown. In [inline links] the destination and title are given immediately after the link text. In [reference links] the destination and title are defined elsewhere in the document.</p> -<p data-sourcepos="7455:1-7457:22" dir="auto">A <a href="@">link text</a> consists of a sequence of zero or more +<p data-sourcepos="8439:1-8441:22" dir="auto">A <a href="@">link text</a> consists of a sequence of zero or more inline elements enclosed by square brackets (<code>[</code> and <code>]</code>). The following rules apply:</p> -<ul data-sourcepos="7459:1-7475:0" dir="auto"> -<li data-sourcepos="7459:1-7462:0"> -<p data-sourcepos="7459:3-7461:43">Links may not contain other links, at any level of nesting. If +<ul data-sourcepos="8443:1-8459:0" dir="auto"> +<li data-sourcepos="8443:1-8446:0"> +<p data-sourcepos="8443:3-8445:43">Links may not contain other links, at any level of nesting. If multiple otherwise valid link definitions appear nested inside each other, the inner-most definition is used.</p> </li> -<li data-sourcepos="7463:1-7467:0"> -<p data-sourcepos="7463:3-7466:22">Brackets are allowed in the [link text] only if (a) they +<li data-sourcepos="8447:1-8451:0"> +<p data-sourcepos="8447:3-8450:22">Brackets are allowed in the [link text] only if (a) they are backslash-escaped or (b) they appear as a matched pair of brackets, with an open bracket <code>[</code>, a sequence of zero or more inlines, and a close bracket <code>]</code>.</p> </li> -<li data-sourcepos="7468:1-7472:0"> -<p data-sourcepos="7468:3-7471:25">Backtick [code spans], [autolinks], and raw [HTML tags] bind more tightly +<li data-sourcepos="8452:1-8456:0"> +<p data-sourcepos="8452:3-8455:25">Backtick [code spans], [autolinks], and raw [HTML tags] bind more tightly than the brackets in link text. Thus, for example, <code>[foo`]`</code> could not be a link text, since the second <code>]</code> is part of a code span.</p> </li> -<li data-sourcepos="7473:1-7475:0"> -<p data-sourcepos="7473:3-7474:78">The brackets in link text bind more tightly than markers for +<li data-sourcepos="8457:1-8459:0"> +<p data-sourcepos="8457:3-8458:78">The brackets in link text bind more tightly than markers for [emphasis and strong emphasis]. Thus, for example, <code>*[foo*](url)</code> is a link.</p> </li> </ul> -<p data-sourcepos="7476:1-7476:42" dir="auto">A <a href="@">link destination</a> consists of either</p> -<ul data-sourcepos="7478:1-7489:0" dir="auto"> -<li data-sourcepos="7478:1-7481:0"> -<p data-sourcepos="7478:3-7480:27">a sequence of zero or more characters between an opening <code><</code> and a +<p data-sourcepos="8460:1-8460:42" dir="auto">A <a href="@">link destination</a> consists of either</p> +<ul data-sourcepos="8462:1-8473:0" dir="auto"> +<li data-sourcepos="8462:1-8465:0"> +<p data-sourcepos="8462:3-8464:27">a sequence of zero or more characters between an opening <code><</code> and a closing <code>></code> that contains no line breaks or unescaped <code><</code> or <code>></code> characters, or</p> </li> -<li data-sourcepos="7482:1-7489:0"> -<p data-sourcepos="7482:3-7488:23">a nonempty sequence of characters that does not start with +<li data-sourcepos="8466:1-8473:0"> +<p data-sourcepos="8466:3-8472:23">a nonempty sequence of characters that does not start with <code><</code>, does not include ASCII space or control characters, and includes parentheses only if (a) they are backslash-escaped or (b) they are part of a balanced pair of unescaped parentheses. @@ -6632,27 +7618,27 @@ avoid performance issues, but at least three levels of nesting should be supported.)</p> </li> </ul> -<p data-sourcepos="7490:1-7490:37" dir="auto">A <a href="@">link title</a> consists of either</p> -<ul data-sourcepos="7492:1-7503:0" dir="auto"> -<li data-sourcepos="7492:1-7495:0"> -<p data-sourcepos="7492:3-7494:23">a sequence of zero or more characters between straight double-quote +<p data-sourcepos="8474:1-8474:37" dir="auto">A <a href="@">link title</a> consists of either</p> +<ul data-sourcepos="8476:1-8487:0" dir="auto"> +<li data-sourcepos="8476:1-8479:0"> +<p data-sourcepos="8476:3-8478:23">a sequence of zero or more characters between straight double-quote characters (<code>"</code>), including a <code>"</code> character only if it is backslash-escaped, or</p> </li> -<li data-sourcepos="7496:1-7499:0"> -<p data-sourcepos="7496:3-7498:23">a sequence of zero or more characters between straight single-quote +<li data-sourcepos="8480:1-8483:0"> +<p data-sourcepos="8480:3-8482:23">a sequence of zero or more characters between straight single-quote characters (<code>'</code>), including a <code>'</code> character only if it is backslash-escaped, or</p> </li> -<li data-sourcepos="7500:1-7503:0"> -<p data-sourcepos="7500:3-7502:20">a sequence of zero or more characters between matching parentheses +<li data-sourcepos="8484:1-8487:0"> +<p data-sourcepos="8484:3-8486:20">a sequence of zero or more characters between matching parentheses (<code>(...)</code>), including a <code>(</code> or <code>)</code> character only if it is backslash-escaped.</p> </li> </ul> -<p data-sourcepos="7504:1-7505:15" dir="auto">Although [link titles] may span multiple lines, they may not contain +<p data-sourcepos="8488:1-8489:15" dir="auto">Although [link titles] may span multiple lines, they may not contain a [blank line].</p> -<p data-sourcepos="7507:1-7517:6" dir="auto">An <a href="@">inline link</a> consists of a [link text] followed immediately +<p data-sourcepos="8491:1-8501:6" dir="auto">An <a href="@">inline link</a> consists of a [link text] followed immediately by a left parenthesis <code>(</code>, optional [whitespace], an optional [link destination], an optional [link title] separated from the link destination by [whitespace], optional [whitespace], and a right @@ -6663,151 +7649,187 @@ The link's URI consists of the link destination, excluding enclosing above. The link's title consists of the link title, excluding its enclosing delimiters, with backslash-escapes in effect as described above.</p> -<p data-sourcepos="7519:1-7519:29" dir="auto">Here is a simple inline link:</p> +<p data-sourcepos="8503:1-8503:29" dir="auto">Here is a simple inline link:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7521:1-7525:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/uri "title")</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="/uri" title="title">link</a></p></span></code></pre> +<pre data-sourcepos="8505:1-8507:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/uri "title")</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7528:1-7528:25" dir="auto">The title may be omitted:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7530:1-7534:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/uri)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="/uri">link</a></p></span></code></pre> +<pre data-sourcepos="8509:1-8511:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri" title="title">link</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7537:1-7537:50" dir="auto">Both the title and the destination may be omitted:</p> +<p data-sourcepos="8514:1-8514:25" dir="auto">The title may be omitted:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7539:1-7543:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link]()</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="">link</a></p></span></code></pre> +<pre data-sourcepos="8516:1-8518:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/uri)</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7546:1-7550:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](<>)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="">link</a></p></span></code></pre> +<pre data-sourcepos="8520:1-8522:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri">link</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7552:1-7553:28" dir="auto">The destination can only contain spaces if it is +<p data-sourcepos="8525:1-8525:50" dir="auto">Both the title and the destination may be omitted:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8527:1-8529:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link]()</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8531:1-8533:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="">link</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8536:1-8538:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](<>)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8540:1-8542:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="">link</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="8544:1-8545:28" dir="auto">The destination can only contain spaces if it is enclosed in pointy brackets:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7555:1-7559:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/my uri)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>[link](/my uri)</p></span></code></pre> +<pre data-sourcepos="8547:1-8549:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/my uri)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8551:1-8553:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[link](/my uri)</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8555:1-8557:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](</my uri>)</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7561:1-7565:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](</my uri>)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="/my%20uri">link</a></p></span></code></pre> +<pre data-sourcepos="8559:1-8561:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/my%20uri">link</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7567:1-7568:36" dir="auto">The destination cannot contain line breaks, +<p data-sourcepos="8563:1-8564:36" dir="auto">The destination cannot contain line breaks, even if enclosed in pointy brackets:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7570:1-7576:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](foo</span> -<span id="LC2" class="line" lang="plaintext">bar)</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>[link](foo</span> -<span id="LC5" class="line" lang="plaintext">bar)</p></span></code></pre> +<pre data-sourcepos="8566:1-8569:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](foo</span> +<span id="LC2" class="line" lang="plaintext">bar)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8571:1-8574:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[link](foo</span> +<span id="LC2" class="line" lang="plaintext">bar)</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8576:1-8579:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](<foo</span> +<span id="LC2" class="line" lang="plaintext">bar>)</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7578:1-7584:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](<foo</span> -<span id="LC2" class="line" lang="plaintext">bar>)</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>[link](<foo</span> -<span id="LC5" class="line" lang="plaintext">bar>)</p></span></code></pre> +<pre data-sourcepos="8581:1-8584:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[link](<foo</span> +<span id="LC2" class="line" lang="plaintext">bar>)</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7586:1-7587:19" dir="auto">The destination can contain <code>)</code> if it is enclosed +<p data-sourcepos="8586:1-8587:19" dir="auto">The destination can contain <code>)</code> if it is enclosed in pointy brackets:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7589:1-7593:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[a](<b)c>)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="b)c">a</a></p></span></code></pre> +<pre data-sourcepos="8589:1-8591:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[a](<b)c>)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8593:1-8595:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="b)c">a</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7595:1-7595:53" dir="auto">Pointy brackets that enclose links must be unescaped:</p> +<p data-sourcepos="8597:1-8597:53" dir="auto">Pointy brackets that enclose links must be unescaped:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7597:1-7601:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](<foo\>)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>[link](&lt;foo&gt;)</p></span></code></pre> +<pre data-sourcepos="8599:1-8601:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](<foo\>)</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7603:1-7604:24" dir="auto">These are not links, because the opening pointy bracket +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8603:1-8605:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[link](&lt;foo&gt;)</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="8607:1-8608:24" dir="auto">These are not links, because the opening pointy bracket is not matched properly:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7606:1-7614:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[a](<b)c</span> +<pre data-sourcepos="8610:1-8614:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[a](<b)c</span> <span id="LC2" class="line" lang="plaintext">[a](<b)c></span> -<span id="LC3" class="line" lang="plaintext">[a](<b>c)</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>[a](&lt;b)c</span> -<span id="LC6" class="line" lang="plaintext">[a](&lt;b)c&gt;</span> -<span id="LC7" class="line" lang="plaintext">[a](<b>c)</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[a](<b>c)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8616:1-8620:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[a](&lt;b)c</span> +<span id="LC2" class="line" lang="plaintext">[a](&lt;b)c&gt;</span> +<span id="LC3" class="line" lang="plaintext">[a](<b>c)</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="8622:1-8622:55" dir="auto">Parentheses inside the link destination may be escaped:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8624:1-8626:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](\(foo\))</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7616:1-7616:55" dir="auto">Parentheses inside the link destination may be escaped:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7618:1-7622:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](\(foo\))</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="(foo)">link</a></p></span></code></pre> +<pre data-sourcepos="8628:1-8630:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="(foo)">link</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7624:1-7625:9" dir="auto">Any number of parentheses are allowed without escaping, as long as they are +<p data-sourcepos="8632:1-8633:9" dir="auto">Any number of parentheses are allowed without escaping, as long as they are balanced:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7627:1-7631:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](foo(and(bar)))</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="foo(and(bar))">link</a></p></span></code></pre> +<pre data-sourcepos="8635:1-8637:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](foo(and(bar)))</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8639:1-8641:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="foo(and(bar))">link</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7633:1-7634:13" dir="auto">However, if you have unbalanced parentheses, you need to escape or use the +<p data-sourcepos="8643:1-8644:13" dir="auto">However, if you have unbalanced parentheses, you need to escape or use the <code><...></code> form:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7636:1-7640:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](foo\(and\(bar\))</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="foo(and(bar)">link</a></p></span></code></pre> +<pre data-sourcepos="8646:1-8648:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](foo\(and\(bar\))</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7643:1-7647:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](<foo(and(bar)>)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="foo(and(bar)">link</a></p></span></code></pre> +<pre data-sourcepos="8650:1-8652:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="foo(and(bar)">link</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7650:1-7651:12" dir="auto">Parentheses and other symbols can also be escaped, as usual +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8655:1-8657:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](<foo(and(bar)>)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8659:1-8661:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="foo(and(bar)">link</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="8664:1-8665:12" dir="auto">Parentheses and other symbols can also be escaped, as usual in Markdown:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7653:1-7657:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](foo\)\:)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="foo):">link</a></p></span></code></pre> +<pre data-sourcepos="8667:1-8669:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](foo\)\:)</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7660:1-7660:52" dir="auto">A link can contain fragment identifiers and queries:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7662:1-7672:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](#fragment)</span> +<pre data-sourcepos="8671:1-8673:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="foo):">link</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="8676:1-8676:52" dir="auto">A link can contain fragment identifiers and queries:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8678:1-8684:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](#fragment)</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext">[link](http://example.com#fragment)</span> <span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext">[link](http://example.com?foo=3#frag)</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><p><a href="#fragment">link</a></p></span> -<span id="LC8" class="line" lang="plaintext"><p><a href="http://example.com#fragment">link</a></p></span> -<span id="LC9" class="line" lang="plaintext"><p><a href="http://example.com?foo=3#frag">link</a></p></span></code></pre> +<span id="LC5" class="line" lang="plaintext">[link](http://example.com?foo=3#frag)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8686:1-8690:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="#fragment">link</a></p></span> +<span id="LC2" class="line" lang="plaintext"><p><a href="http://example.com#fragment">link</a></p></span> +<span id="LC3" class="line" lang="plaintext"><p><a href="http://example.com?foo=3#frag">link</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7675:1-7676:17" dir="auto">Note that a backslash before a non-escapable character is +<p data-sourcepos="8693:1-8694:17" dir="auto">Note that a backslash before a non-escapable character is just a backslash:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7678:1-7682:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](foo\bar)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="foo%5Cbar">link</a></p></span></code></pre> +<pre data-sourcepos="8696:1-8698:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](foo\bar)</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7685:1-7692:52" dir="auto">URL-escaping should be left alone inside the destination, as all +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8700:1-8702:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="foo%5Cbar">link</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="8705:1-8712:52" dir="auto">URL-escaping should be left alone inside the destination, as all URL-escaped characters are also valid URL characters. Entity and numerical character references in the destination will be parsed into the corresponding Unicode code points, as usual. These may @@ -6816,62 +7838,76 @@ does not enforce any particular policy for rendering URLs in HTML or other formats. Renderers may make different decisions about how to escape or normalize URLs in the output.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7694:1-7698:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](foo%20b&auml;)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="foo%20b%C3%A4">link</a></p></span></code></pre> +<pre data-sourcepos="8714:1-8716:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](foo%20b&auml;)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8718:1-8720:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="foo%20b%C3%A4">link</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7701:1-7703:23" dir="auto">Note that, because titles can often be parsed as destinations, +<p data-sourcepos="8723:1-8725:23" dir="auto">Note that, because titles can often be parsed as destinations, if you try to omit the destination and keep the title, you'll get unexpected results:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7705:1-7709:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link]("title")</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="%22title%22">link</a></p></span></code></pre> +<pre data-sourcepos="8727:1-8729:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link]("title")</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7712:1-7712:62" dir="auto">Titles may be in single quotes, double quotes, or parentheses:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7714:1-7722:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/url "title")</span> +<pre data-sourcepos="8731:1-8733:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="%22title%22">link</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="8736:1-8736:62" dir="auto">Titles may be in single quotes, double quotes, or parentheses:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8738:1-8742:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/url "title")</span> <span id="LC2" class="line" lang="plaintext">[link](/url 'title')</span> -<span id="LC3" class="line" lang="plaintext">[link](/url (title))</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/url" title="title">link</a></span> -<span id="LC6" class="line" lang="plaintext"><a href="/url" title="title">link</a></span> -<span id="LC7" class="line" lang="plaintext"><a href="/url" title="title">link</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[link](/url (title))</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8744:1-8748:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title">link</a></span> +<span id="LC2" class="line" lang="plaintext"><a href="/url" title="title">link</a></span> +<span id="LC3" class="line" lang="plaintext"><a href="/url" title="title">link</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7725:1-7726:22" dir="auto">Backslash escapes and entity and numeric character references +<p data-sourcepos="8751:1-8752:22" dir="auto">Backslash escapes and entity and numeric character references may be used in titles:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7728:1-7732:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/url "title \"&quot;")</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="/url" title="title &quot;&quot;">link</a></p></span></code></pre> +<pre data-sourcepos="8754:1-8756:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/url "title \"&quot;")</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7735:1-7736:64" dir="auto">Titles must be separated from the link using a [whitespace]. +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8758:1-8760:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title &quot;&quot;">link</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="8763:1-8764:64" dir="auto">Titles must be separated from the link using a [whitespace]. Other [Unicode whitespace] like non-breaking space doesn't work.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7738:1-7742:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/url "title")</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="/url%C2%A0%22title%22">link</a></p></span></code></pre> +<pre data-sourcepos="8766:1-8768:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/url "title")</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8770:1-8772:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url%C2%A0%22title%22">link</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="8775:1-8775:56" dir="auto">Nested balanced quotes are not allowed without escaping:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8777:1-8779:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/url "title "and" title")</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8781:1-8783:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[link](/url &quot;title &quot;and&quot; title&quot;)</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7745:1-7745:56" dir="auto">Nested balanced quotes are not allowed without escaping:</p> +<p data-sourcepos="8786:1-8786:67" dir="auto">But it is easy to work around this by using a different quote type:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7747:1-7751:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/url "title "and" title")</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>[link](/url &quot;title &quot;and&quot; title&quot;)</p></span></code></pre> +<pre data-sourcepos="8788:1-8790:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/url 'title "and" title')</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7754:1-7754:67" dir="auto">But it is easy to work around this by using a different quote type:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7756:1-7760:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/url 'title "and" title')</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="/url" title="title &quot;and&quot; title">link</a></p></span></code></pre> +<pre data-sourcepos="8792:1-8794:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title &quot;and&quot; title">link</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7763:1-7776:61" dir="auto">(Note: <code>Markdown.pl</code> did allow double quotes inside a double-quoted +<p data-sourcepos="8797:1-8810:61" dir="auto">(Note: <code>Markdown.pl</code> did allow double quotes inside a double-quoted title, and its test suite included a test demonstrating this. But it is hard to see a good rationale for the extra complexity this brings, since there are already many ways---backslash escaping, @@ -6885,136 +7921,170 @@ with <code>"</code> and end with <code>)</code>. <code>Markdown.pl</code> 1.0.1 titles with no closing quotation mark, though 1.0.2b8 does not. It seems preferable to adopt a simple, rational rule that works the same way in inline links and link reference definitions.)</p> -<p data-sourcepos="7778:1-7778:57" dir="auto">[Whitespace] is allowed around the destination and title:</p> +<p data-sourcepos="8812:1-8812:57" dir="auto">[Whitespace] is allowed around the destination and title:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7780:1-7785:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link]( /uri</span> -<span id="LC2" class="line" lang="plaintext"> "title" )</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p><a href="/uri" title="title">link</a></p></span></code></pre> +<pre data-sourcepos="8814:1-8817:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link]( /uri</span> +<span id="LC2" class="line" lang="plaintext"> "title" )</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7788:1-7789:22" dir="auto">But it is not allowed between the link text and the +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8819:1-8821:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri" title="title">link</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="8824:1-8825:22" dir="auto">But it is not allowed between the link text and the following parenthesis:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7791:1-7795:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link] (/uri)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>[link] (/uri)</p></span></code></pre> +<pre data-sourcepos="8827:1-8829:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link] (/uri)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8831:1-8833:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[link] (/uri)</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7798:1-7799:24" dir="auto">The link text may contain balanced brackets, but not unbalanced ones, +<p data-sourcepos="8836:1-8837:24" dir="auto">The link text may contain balanced brackets, but not unbalanced ones, unless they are escaped:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7801:1-7805:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link [foo [bar]]](/uri)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="/uri">link [foo [bar]]</a></p></span></code></pre> +<pre data-sourcepos="8839:1-8841:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link [foo [bar]]](/uri)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8843:1-8845:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri">link [foo [bar]]</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8848:1-8850:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link] bar](/uri)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8852:1-8854:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[link] bar](/uri)</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8857:1-8859:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link [bar](/uri)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8861:1-8863:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[link <a href="/uri">bar</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8866:1-8868:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link \[bar](/uri)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8870:1-8872:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri">link [bar</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="8875:1-8875:41" dir="auto">The link text may contain inline content:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8877:1-8879:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link *foo **bar** `#`*](/uri)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8881:1-8883:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7808:1-7812:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link] bar](/uri)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>[link] bar](/uri)</p></span></code></pre> +<pre data-sourcepos="8886:1-8888:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[![moon](moon.jpg)](/uri)</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7815:1-7819:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link [bar](/uri)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>[link <a href="/uri">bar</a></p></span></code></pre> +<pre data-sourcepos="8890:1-8892:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p></span></code></pre> <copy-code></copy-code> </div> +<p data-sourcepos="8895:1-8895:68" dir="auto">However, links may not contain other links, at any level of nesting.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7822:1-7826:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link \[bar](/uri)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="/uri">link [bar</a></p></span></code></pre> +<pre data-sourcepos="8897:1-8899:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo [bar](/uri)](/uri)</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7829:1-7829:41" dir="auto">The link text may contain inline content:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7831:1-7835:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link *foo **bar** `#`*](/uri)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p></span></code></pre> +<pre data-sourcepos="8901:1-8903:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo <a href="/uri">bar</a>](/uri)</p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7838:1-7842:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[![moon](moon.jpg)](/uri)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p></span></code></pre> +<pre data-sourcepos="8906:1-8908:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo *[bar [baz](/uri)](/uri)*](/uri)</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7845:1-7845:68" dir="auto">However, links may not contain other links, at any level of nesting.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7847:1-7851:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo [bar](/uri)](/uri)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>[foo <a href="/uri">bar</a>](/uri)</p></span></code></pre> +<pre data-sourcepos="8910:1-8912:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo <em>[bar <a href="/uri">baz</a>](/uri)</em>](/uri)</p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7854:1-7858:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo *[bar [baz](/uri)](/uri)*](/uri)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>[foo <em>[bar <a href="/uri">baz</a>](/uri)</em>](/uri)</p></span></code></pre> +<pre data-sourcepos="8915:1-8917:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![[[foo](uri1)](uri2)](uri3)</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7861:1-7865:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![[[foo](uri1)](uri2)](uri3)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><img src="uri3" alt="[foo](uri2)" /></p></span></code></pre> +<pre data-sourcepos="8919:1-8921:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="uri3" alt="[foo](uri2)" /></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7868:1-7869:18" dir="auto">These cases illustrate the precedence of link text grouping over +<p data-sourcepos="8924:1-8925:18" dir="auto">These cases illustrate the precedence of link text grouping over emphasis grouping:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7871:1-7875:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*[foo*](/uri)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>*<a href="/uri">foo*</a></p></span></code></pre> +<pre data-sourcepos="8927:1-8929:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*[foo*](/uri)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8931:1-8933:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*<a href="/uri">foo*</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8936:1-8938:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo *bar](baz*)</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7878:1-7882:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo *bar](baz*)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="baz*">foo *bar</a></p></span></code></pre> +<pre data-sourcepos="8940:1-8942:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="baz*">foo *bar</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7885:1-7886:11" dir="auto">Note that brackets that <em>aren't</em> part of links do not take +<p data-sourcepos="8945:1-8946:11" dir="auto">Note that brackets that <em>aren't</em> part of links do not take precedence:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7888:1-7892:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo [bar* baz]</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><em>foo [bar</em> baz]</p></span></code></pre> +<pre data-sourcepos="8948:1-8950:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo [bar* baz]</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8952:1-8954:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo [bar</em> baz]</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7895:1-7896:33" dir="auto">These cases illustrate the precedence of HTML tags, code spans, +<p data-sourcepos="8957:1-8958:33" dir="auto">These cases illustrate the precedence of HTML tags, code spans, and autolinks over link grouping:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7898:1-7902:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo <bar attr="](baz)"></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>[foo <bar attr="](baz)"></p></span></code></pre> +<pre data-sourcepos="8960:1-8962:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo <bar attr="](baz)"></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8964:1-8966:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo <bar attr="](baz)"></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8969:1-8971:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo`](/uri)`</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="8973:1-8975:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo<code>](/uri)</code></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7905:1-7909:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo`](/uri)`</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>[foo<code>](/uri)</code></p></span></code></pre> +<pre data-sourcepos="8978:1-8980:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo<http://example.com/?search=](uri)></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7912:1-7916:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo<http://example.com/?search=](uri)></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>[foo<a href="http://example.com/?search=%5D(uri)">http://example.com/?search=](uri)</a></p></span></code></pre> +<pre data-sourcepos="8982:1-8984:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo<a href="http://example.com/?search=%5D(uri)">http://example.com/?search=](uri)</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7919:1-7921:41" dir="auto">There are three kinds of <a href="@">reference link</a>s: +<p data-sourcepos="8987:1-8989:41" dir="auto">There are three kinds of <a href="@">reference link</a>s: <a href="#full-reference-link">full</a>, <a href="#collapsed-reference-link">collapsed</a>, and <a href="#shortcut-reference-link">shortcut</a>.</p> -<p data-sourcepos="7923:1-7925:71" dir="auto">A <a href="@">full reference link</a> +<p data-sourcepos="8991:1-8993:71" dir="auto">A <a href="@">full reference link</a> consists of a [link text] immediately followed by a [link label] that [matches] a [link reference definition] elsewhere in the document.</p> -<p data-sourcepos="7927:1-7933:9" dir="auto">A <a href="@">link label</a> begins with a left bracket (<code>[</code>) and ends +<p data-sourcepos="8995:1-9001:9" dir="auto">A <a href="@">link label</a> begins with a left bracket (<code>[</code>) and ends with the first right bracket (<code>]</code>) that is not backslash-escaped. Between these brackets there must be at least one [non-whitespace character]. Unescaped square bracket characters are not allowed inside the opening and closing square brackets of [link labels]. A link label can have at most 999 characters inside the square brackets.</p> -<p data-sourcepos="7935:1-7942:69" dir="auto">One label <a href="@">matches</a> +<p data-sourcepos="9003:1-9010:69" dir="auto">One label <a href="@">matches</a> another just in case their normalized forms are equal. To normalize a label, strip off the opening and closing brackets, perform the <em>Unicode case fold</em>, strip leading and trailing @@ -7022,168 +8092,202 @@ perform the <em>Unicode case fold</em>, strip leading and trailing [whitespace] to a single space. If there are multiple matching reference link definitions, the one that comes first in the document is used. (It is desirable in such cases to emit a warning.)</p> -<p data-sourcepos="7944:1-7946:37" dir="auto">The contents of the first link label are parsed as inlines, which are +<p data-sourcepos="9012:1-9014:37" dir="auto">The contents of the first link label are parsed as inlines, which are used as the link's text. The link's URI and title are provided by the matching [link reference definition].</p> -<p data-sourcepos="7948:1-7948:25" dir="auto">Here is a simple example:</p> +<p data-sourcepos="9016:1-9016:25" dir="auto">Here is a simple example:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7950:1-7956:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][bar]</span> +<pre data-sourcepos="9018:1-9022:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][bar]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[bar]: /url "title"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/url" title="title">foo</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[bar]: /url "title"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9024:1-9026:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title">foo</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7959:1-7960:22" dir="auto">The rules for the [link text] are the same as with +<p data-sourcepos="9029:1-9030:22" dir="auto">The rules for the [link text] are the same as with [inline links]. Thus:</p> -<p data-sourcepos="7962:1-7963:24" dir="auto">The link text may contain balanced brackets, but not unbalanced ones, +<p data-sourcepos="9032:1-9033:24" dir="auto">The link text may contain balanced brackets, but not unbalanced ones, unless they are escaped:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7965:1-7971:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link [foo [bar]]][ref]</span> +<pre data-sourcepos="9035:1-9039:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link [foo [bar]]][ref]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/uri">link [foo [bar]]</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9041:1-9043:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri">link [foo [bar]]</a></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7974:1-7980:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link \[bar][ref]</span> +<pre data-sourcepos="9046:1-9050:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link \[bar][ref]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/uri">link [bar</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9052:1-9054:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri">link [bar</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="7983:1-7983:41" dir="auto">The link text may contain inline content:</p> +<p data-sourcepos="9057:1-9057:41" dir="auto">The link text may contain inline content:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7985:1-7991:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link *foo **bar** `#`*][ref]</span> +<pre data-sourcepos="9059:1-9063:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link *foo **bar** `#`*][ref]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9065:1-9067:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7994:1-8000:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[![moon](moon.jpg)][ref]</span> +<pre data-sourcepos="9070:1-9074:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[![moon](moon.jpg)][ref]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9076:1-9078:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8003:1-8003:68" dir="auto">However, links may not contain other links, at any level of nesting.</p> +<p data-sourcepos="9081:1-9081:68" dir="auto">However, links may not contain other links, at any level of nesting.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8005:1-8011:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo [bar](/uri)][ref]</span> +<pre data-sourcepos="9083:1-9087:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo [bar](/uri)][ref]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>[foo <a href="/uri">bar</a>]<a href="/uri">ref</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9089:1-9091:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo <a href="/uri">bar</a>]<a href="/uri">ref</a></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8014:1-8020:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo *bar [baz][ref]*][ref]</span> +<pre data-sourcepos="9094:1-9098:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo *bar [baz][ref]*][ref]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>[foo <em>bar <a href="/uri">baz</a></em>]<a href="/uri">ref</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8023:1-8024:38" dir="auto">(In the examples above, we have two [shortcut reference links] +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9100:1-9102:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo <em>bar <a href="/uri">baz</a></em>]<a href="/uri">ref</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="9105:1-9106:38" dir="auto">(In the examples above, we have two [shortcut reference links] instead of one [full reference link].)</p> -<p data-sourcepos="8026:1-8027:18" dir="auto">The following cases illustrate the precedence of link text grouping over +<p data-sourcepos="9108:1-9109:18" dir="auto">The following cases illustrate the precedence of link text grouping over emphasis grouping:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8029:1-8035:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*[foo*][ref]</span> +<pre data-sourcepos="9111:1-9115:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*[foo*][ref]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>*<a href="/uri">foo*</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9117:1-9119:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*<a href="/uri">foo*</a></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8038:1-8044:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo *bar][ref]</span> +<pre data-sourcepos="9122:1-9126:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo *bar][ref]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/uri">foo *bar</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9128:1-9130:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri">foo *bar</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8047:1-8048:33" dir="auto">These cases illustrate the precedence of HTML tags, code spans, +<p data-sourcepos="9133:1-9134:33" dir="auto">These cases illustrate the precedence of HTML tags, code spans, and autolinks over link grouping:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8050:1-8056:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo <bar attr="][ref]"></span> +<pre data-sourcepos="9136:1-9140:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo <bar attr="][ref]"></span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>[foo <bar attr="][ref]"></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9142:1-9144:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo <bar attr="][ref]"></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8059:1-8065:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo`][ref]`</span> +<pre data-sourcepos="9147:1-9151:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo`][ref]`</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>[foo<code>][ref]</code></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9153:1-9155:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo<code>][ref]</code></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8068:1-8074:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo<http://example.com/?search=][ref]></span> +<pre data-sourcepos="9158:1-9162:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo<http://example.com/?search=][ref]></span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>[foo<a href="http://example.com/?search=%5D%5Bref%5D">http://example.com/?search=][ref]</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[ref]: /uri</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9164:1-9166:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo<a href="http://example.com/?search=%5D%5Bref%5D">http://example.com/?search=][ref]</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8077:1-8077:29" dir="auto">Matching is case-insensitive:</p> +<p data-sourcepos="9169:1-9169:29" dir="auto">Matching is case-insensitive:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8079:1-8085:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][BaR]</span> +<pre data-sourcepos="9171:1-9175:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][BaR]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[bar]: /url "title"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/url" title="title">foo</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[bar]: /url "title"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9177:1-9179:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title">foo</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8088:1-8088:26" dir="auto">Unicode case fold is used:</p> +<p data-sourcepos="9182:1-9182:26" dir="auto">Unicode case fold is used:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8090:1-8096:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[Толпой][Толпой] is a Russian word.</span> +<pre data-sourcepos="9184:1-9188:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[Толпой][Толпой] is a Russian word.</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[ТОЛПОЙ]: /url</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/url">Толпой</a> is a Russian word.</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[ТОЛПОЙ]: /url</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9190:1-9192:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url">Толпой</a> is a Russian word.</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8099:1-8100:33" dir="auto">Consecutive internal [whitespace] is treated as one space for +<p data-sourcepos="9195:1-9196:33" dir="auto">Consecutive internal [whitespace] is treated as one space for purposes of determining matching:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8102:1-8109:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[Foo</span> +<pre data-sourcepos="9198:1-9203:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[Foo</span> <span id="LC2" class="line" lang="plaintext"> bar]: /url</span> <span id="LC3" class="line" lang="plaintext"></span> -<span id="LC4" class="line" lang="plaintext">[Baz][Foo bar]</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><p><a href="/url">Baz</a></p></span></code></pre> +<span id="LC4" class="line" lang="plaintext">[Baz][Foo bar]</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8112:1-8113:13" dir="auto">No [whitespace] is allowed between the [link text] and the +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9205:1-9207:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url">Baz</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="9210:1-9211:13" dir="auto">No [whitespace] is allowed between the [link text] and the [link label]:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8115:1-8121:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo] [bar]</span> +<pre data-sourcepos="9213:1-9217:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo] [bar]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[bar]: /url "title"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>[foo] <a href="/url" title="title">bar</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[bar]: /url "title"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9219:1-9221:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo] <a href="/url" title="title">bar</a></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8124:1-8132:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]</span> +<pre data-sourcepos="9224:1-9229:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]</span> <span id="LC2" class="line" lang="plaintext">[bar]</span> <span id="LC3" class="line" lang="plaintext"></span> -<span id="LC4" class="line" lang="plaintext">[bar]: /url "title"</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><p>[foo]</span> -<span id="LC7" class="line" lang="plaintext"><a href="/url" title="title">bar</a></p></span></code></pre> +<span id="LC4" class="line" lang="plaintext">[bar]: /url "title"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9231:1-9234:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo]</span> +<span id="LC2" class="line" lang="plaintext"><a href="/url" title="title">bar</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8135:1-8144:9" dir="auto">This is a departure from John Gruber's original Markdown syntax +<p data-sourcepos="9237:1-9246:9" dir="auto">This is a departure from John Gruber's original Markdown syntax description, which explicitly allows whitespace between the link text and the link label. It brings reference links in line with [inline links], which (according to both original Markdown and @@ -7194,113 +8298,131 @@ link text and the link label, then in the following we will have a single reference link, not two shortcut reference links, as intended:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8146:1-8152:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown">[foo]</span> +<pre data-sourcepos="9248:1-9254:3" class="code highlight js-syntax-highlight language-markdown" lang="markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown">[foo]</span> <span id="LC2" class="line" lang="markdown">[bar]</span> <span id="LC3" class="line" lang="markdown"></span> <span id="LC4" class="line" lang="markdown"><span class="p">[</span><span class="ss">foo</span><span class="p">]:</span> <span class="sx">/url1</span></span> <span id="LC5" class="line" lang="markdown"><span class="p">[</span><span class="ss">bar</span><span class="p">]:</span> <span class="sx">/url2</span></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8154:1-8160:20" dir="auto">(Note that [shortcut reference links] were introduced by Gruber +<p data-sourcepos="9256:1-9262:20" dir="auto">(Note that [shortcut reference links] were introduced by Gruber himself in a beta version of <code>Markdown.pl</code>, but never included in the official syntax description. Without shortcut reference links, it is harmless to allow space between the link text and link label; but once shortcut references are introduced, it is too dangerous to allow this, as it frequently leads to unintended results.)</p> -<p data-sourcepos="8162:1-8163:18" dir="auto">When there are multiple matching [link reference definitions], +<p data-sourcepos="9264:1-9265:18" dir="auto">When there are multiple matching [link reference definitions], the first is used:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8165:1-8173:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url1</span> +<pre data-sourcepos="9267:1-9273:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url1</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext">[foo]: /url2</span> <span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext">[bar][foo]</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><p><a href="/url1">bar</a></p></span></code></pre> +<span id="LC5" class="line" lang="plaintext">[bar][foo]</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9275:1-9277:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url1">bar</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8176:1-8178:40" dir="auto">Note that matching is performed on normalized strings, not parsed +<p data-sourcepos="9280:1-9282:40" dir="auto">Note that matching is performed on normalized strings, not parsed inline content. So the following does not match, even though the labels define equivalent inline content:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8180:1-8186:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[bar][foo\!]</span> +<pre data-sourcepos="9284:1-9288:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[bar][foo\!]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo!]: /url</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>[bar][foo!]</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo!]: /url</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8189:1-8190:18" dir="auto">[Link labels] cannot contain brackets, unless they are +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9290:1-9292:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[bar][foo!]</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="9295:1-9296:18" dir="auto">[Link labels] cannot contain brackets, unless they are backslash-escaped:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8192:1-8199:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][ref[]</span> +<pre data-sourcepos="9298:1-9302:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][ref[]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[ref[]: /uri</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>[foo][ref[]</p></span> -<span id="LC6" class="line" lang="plaintext"><p>[ref[]: /uri</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[ref[]: /uri</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9304:1-9307:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo][ref[]</p></span> +<span id="LC2" class="line" lang="plaintext"><p>[ref[]: /uri</p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8202:1-8209:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][ref[bar]]</span> +<pre data-sourcepos="9310:1-9314:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][ref[bar]]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[ref[bar]]: /uri</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>[foo][ref[bar]]</p></span> -<span id="LC6" class="line" lang="plaintext"><p>[ref[bar]]: /uri</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[ref[bar]]: /uri</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8212:1-8219:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[[[foo]]]</span> +<pre data-sourcepos="9316:1-9319:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo][ref[bar]]</p></span> +<span id="LC2" class="line" lang="plaintext"><p>[ref[bar]]: /uri</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9322:1-9326:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[[[foo]]]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[[[foo]]]: /url</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>[[[foo]]]</p></span> -<span id="LC6" class="line" lang="plaintext"><p>[[[foo]]]: /url</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[[[foo]]]: /url</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8222:1-8228:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][ref\[]</span> +<pre data-sourcepos="9328:1-9331:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[[[foo]]]</p></span> +<span id="LC2" class="line" lang="plaintext"><p>[[[foo]]]: /url</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9334:1-9338:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][ref\[]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[ref\[]: /uri</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/uri">foo</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[ref\[]: /uri</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8231:1-8231:55" dir="auto">Note that in this example <code>]</code> is not backslash-escaped:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8233:1-8239:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[bar\\]: /uri</span> +<pre data-sourcepos="9340:1-9342:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri">foo</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="9345:1-9345:55" dir="auto">Note that in this example <code>]</code> is not backslash-escaped:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9347:1-9351:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[bar\\]: /uri</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[bar\\]</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/uri">bar\</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[bar\\]</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9353:1-9355:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/uri">bar\</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8242:1-8242:68" dir="auto">A [link label] must contain at least one [non-whitespace character]:</p> +<p data-sourcepos="9358:1-9358:68" dir="auto">A [link label] must contain at least one [non-whitespace character]:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8244:1-8251:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[]</span> +<pre data-sourcepos="9360:1-9364:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[]: /uri</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>[]</p></span> -<span id="LC6" class="line" lang="plaintext"><p>[]: /uri</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[]: /uri</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9366:1-9369:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[]</p></span> +<span id="LC2" class="line" lang="plaintext"><p>[]: /uri</p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8254:1-8265:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[</span> +<pre data-sourcepos="9372:1-9378:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[</span> <span id="LC2" class="line" lang="plaintext"> ]</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext">[</span> -<span id="LC5" class="line" lang="plaintext"> ]: /uri</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><p>[</span> -<span id="LC8" class="line" lang="plaintext">]</p></span> -<span id="LC9" class="line" lang="plaintext"><p>[</span> -<span id="LC10" class="line" lang="plaintext">]: /uri</p></span></code></pre> +<span id="LC5" class="line" lang="plaintext"> ]: /uri</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9380:1-9385:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[</span> +<span id="LC2" class="line" lang="plaintext">]</p></span> +<span id="LC3" class="line" lang="plaintext"><p>[</span> +<span id="LC4" class="line" lang="plaintext">]: /uri</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8268:1-8275:40" dir="auto">A <a href="@">collapsed reference link</a> +<p data-sourcepos="9388:1-9395:40" dir="auto">A <a href="@">collapsed reference link</a> consists of a [link label] that [matches] a [link reference definition] elsewhere in the document, followed by the string <code>[]</code>. @@ -7309,43 +8431,51 @@ which are used as the link's text. The link's URI and title are provided by the matching reference link definition. Thus, <code>[foo][]</code> is equivalent to <code>[foo][foo]</code>.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8277:1-8283:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][]</span> +<pre data-sourcepos="9397:1-9401:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/url" title="title">foo</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9403:1-9405:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title">foo</a></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8286:1-8292:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[*foo* bar][]</span> +<pre data-sourcepos="9408:1-9412:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[*foo* bar][]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[*foo* bar]: /url "title"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/url" title="title"><em>foo</em> bar</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[*foo* bar]: /url "title"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9414:1-9416:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title"><em>foo</em> bar</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8295:1-8295:37" dir="auto">The link labels are case-insensitive:</p> +<p data-sourcepos="9419:1-9419:37" dir="auto">The link labels are case-insensitive:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8297:1-8303:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[Foo][]</span> +<pre data-sourcepos="9421:1-9425:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[Foo][]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/url" title="title">Foo</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9427:1-9429:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title">Foo</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8307:1-8308:41" dir="auto">As with full reference links, [whitespace] is not +<p data-sourcepos="9433:1-9434:41" dir="auto">As with full reference links, [whitespace] is not allowed between the two sets of brackets:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8310:1-8318:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo] </span> +<pre data-sourcepos="9436:1-9441:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo] </span> <span id="LC2" class="line" lang="plaintext">[]</span> <span id="LC3" class="line" lang="plaintext"></span> -<span id="LC4" class="line" lang="plaintext">[foo]: /url "title"</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><p><a href="/url" title="title">foo</a></span> -<span id="LC7" class="line" lang="plaintext">[]</p></span></code></pre> +<span id="LC4" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9443:1-9446:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title">foo</a></span> +<span id="LC2" class="line" lang="plaintext">[]</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8321:1-8328:41" dir="auto">A <a href="@">shortcut reference link</a> +<p data-sourcepos="9449:1-9456:41" dir="auto">A <a href="@">shortcut reference link</a> consists of a [link label] that [matches] a [link reference definition] elsewhere in the document and is not followed by <code>[]</code> or a link label. @@ -7354,146 +8484,176 @@ which are used as the link's text. The link's URI and title are provided by the matching link reference definition. Thus, <code>[foo]</code> is equivalent to <code>[foo][]</code>.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8330:1-8336:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]</span> +<pre data-sourcepos="9458:1-9462:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/url" title="title">foo</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8339:1-8345:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[*foo* bar]</span> +<pre data-sourcepos="9464:1-9466:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title">foo</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9469:1-9473:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[*foo* bar]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[*foo* bar]: /url "title"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/url" title="title"><em>foo</em> bar</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[*foo* bar]: /url "title"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9475:1-9477:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title"><em>foo</em> bar</a></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8348:1-8354:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[[*foo* bar]]</span> +<pre data-sourcepos="9480:1-9484:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[[*foo* bar]]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[*foo* bar]: /url "title"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>[<a href="/url" title="title"><em>foo</em> bar</a>]</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[*foo* bar]: /url "title"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9486:1-9488:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[<a href="/url" title="title"><em>foo</em> bar</a>]</p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8357:1-8363:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[[bar [foo]</span> +<pre data-sourcepos="9491:1-9495:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[[bar [foo]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]: /url</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>[[bar <a href="/url">foo</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]: /url</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9497:1-9499:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[[bar <a href="/url">foo</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8366:1-8366:37" dir="auto">The link labels are case-insensitive:</p> +<p data-sourcepos="9502:1-9502:37" dir="auto">The link labels are case-insensitive:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8368:1-8374:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[Foo]</span> +<pre data-sourcepos="9504:1-9508:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[Foo]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/url" title="title">Foo</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8377:1-8377:48" dir="auto">A space after the link text should be preserved:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8379:1-8385:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo] bar</span> +<pre data-sourcepos="9510:1-9512:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url" title="title">Foo</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="9515:1-9515:48" dir="auto">A space after the link text should be preserved:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9517:1-9521:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo] bar</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]: /url</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/url">foo</a> bar</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]: /url</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9523:1-9525:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url">foo</a> bar</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8388:1-8389:31" dir="auto">If you just want bracketed text, you can backslash-escape the +<p data-sourcepos="9528:1-9529:31" dir="auto">If you just want bracketed text, you can backslash-escape the opening bracket to avoid links:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8391:1-8397:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\[foo]</span> +<pre data-sourcepos="9531:1-9535:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\[foo]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>[foo]</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8400:1-8401:26" dir="auto">Note that this is a link, because a link label ends with the first +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9537:1-9539:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo]</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="9542:1-9543:26" dir="auto">Note that this is a link, because a link label ends with the first following closing bracket:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8403:1-8409:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo*]: /url</span> +<pre data-sourcepos="9545:1-9549:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo*]: /url</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">*[foo*]</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>*<a href="/url">foo*</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">*[foo*]</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9551:1-9553:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*<a href="/url">foo*</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8412:1-8413:11" dir="auto">Full and compact references take precedence over shortcut +<p data-sourcepos="9556:1-9557:11" dir="auto">Full and compact references take precedence over shortcut references:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8415:1-8422:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][bar]</span> +<pre data-sourcepos="9559:1-9564:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][bar]</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext">[foo]: /url1</span> -<span id="LC4" class="line" lang="plaintext">[bar]: /url2</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><p><a href="/url2">foo</a></p></span></code></pre> +<span id="LC4" class="line" lang="plaintext">[bar]: /url2</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8424:1-8430:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][]</span> +<pre data-sourcepos="9566:1-9568:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url2">foo</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9570:1-9574:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]: /url1</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/url1">foo</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]: /url1</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9576:1-9578:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url1">foo</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8432:1-8432:34" dir="auto">Inline links also take precedence:</p> +<p data-sourcepos="9580:1-9580:34" dir="auto">Inline links also take precedence:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8434:1-8440:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]()</span> +<pre data-sourcepos="9582:1-9586:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]()</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]: /url1</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="">foo</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]: /url1</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9588:1-9590:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="">foo</a></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8442:1-8448:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo](not a link)</span> +<pre data-sourcepos="9592:1-9596:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo](not a link)</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]: /url1</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="/url1">foo</a>(not a link)</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]: /url1</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8450:1-8451:23" dir="auto">In the following case <code>[bar][baz]</code> is parsed as a reference, +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9598:1-9600:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url1">foo</a>(not a link)</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="9602:1-9603:23" dir="auto">In the following case <code>[bar][baz]</code> is parsed as a reference, <code>[foo]</code> as normal text:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8453:1-8459:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][bar][baz]</span> +<pre data-sourcepos="9605:1-9609:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][bar][baz]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[baz]: /url</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>[foo]<a href="/url">bar</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[baz]: /url</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9611:1-9613:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo]<a href="/url">bar</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8462:1-8463:19" dir="auto">Here, though, <code>[foo][bar]</code> is parsed as a reference, since +<p data-sourcepos="9616:1-9617:19" dir="auto">Here, though, <code>[foo][bar]</code> is parsed as a reference, since <code>[bar]</code> is defined:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8465:1-8472:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][bar][baz]</span> +<pre data-sourcepos="9619:1-9624:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][bar][baz]</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext">[baz]: /url1</span> -<span id="LC4" class="line" lang="plaintext">[bar]: /url2</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><p><a href="/url2">foo</a><a href="/url1">baz</a></p></span></code></pre> +<span id="LC4" class="line" lang="plaintext">[bar]: /url2</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8475:1-8476:65" dir="auto">Here <code>[foo]</code> is not parsed as a shortcut reference, because it +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9626:1-9628:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="/url2">foo</a><a href="/url1">baz</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="9631:1-9632:65" dir="auto">Here <code>[foo]</code> is not parsed as a shortcut reference, because it is followed by a link label (even though <code>[bar]</code> is not defined):</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8478:1-8485:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][bar][baz]</span> +<pre data-sourcepos="9634:1-9639:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo][bar][baz]</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext">[baz]: /url1</span> -<span id="LC4" class="line" lang="plaintext">[foo]: /url2</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><p>[foo]<a href="/url1">bar</a></p></span></code></pre> +<span id="LC4" class="line" lang="plaintext">[foo]: /url2</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9641:1-9643:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo]<a href="/url1">bar</a></p></span></code></pre> <copy-code></copy-code> </div> -<h2 data-sourcepos="8489:1-8489:9" dir="auto"> +<h2 data-sourcepos="9647:1-9647:9" dir="auto"> <a id="user-content-images" class="anchor" href="#images" aria-hidden="true"></a>Images</h2> -<p data-sourcepos="8491:1-8499:55" dir="auto">Syntax for images is like the syntax for links, with one +<p data-sourcepos="9649:1-9657:55" dir="auto">Syntax for images is like the syntax for links, with one difference. Instead of [link text], we have an <a href="@">image description</a>. The rules for this are the same as for [link text], except that (a) an @@ -7503,1116 +8663,1324 @@ An image description has inline elements as its contents. When an image is rendered to HTML, this is standardly used as the image's <code>alt</code> attribute.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8501:1-8505:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo](/url "title")</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><img src="/url" alt="foo" title="title" /></p></span></code></pre> +<pre data-sourcepos="9659:1-9661:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo](/url "title")</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8508:1-8514:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo *bar*]</span> +<pre data-sourcepos="9663:1-9665:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url" alt="foo" title="title" /></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9668:1-9672:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo *bar*]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo *bar*]: train.jpg "train & tracks"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" /></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo *bar*]: train.jpg "train & tracks"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9674:1-9676:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" /></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9679:1-9681:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo ![bar](/url)](/url2)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9683:1-9685:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url2" alt="foo bar" /></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8517:1-8521:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo ![bar](/url)](/url2)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><img src="/url2" alt="foo bar" /></p></span></code></pre> +<pre data-sourcepos="9688:1-9690:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo [bar](/url)](/url2)</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8524:1-8528:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo [bar](/url)](/url2)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><img src="/url2" alt="foo bar" /></p></span></code></pre> +<pre data-sourcepos="9692:1-9694:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url2" alt="foo bar" /></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8531:1-8536:40" dir="auto">Though this spec is concerned with parsing, not rendering, it is +<p data-sourcepos="9697:1-9702:40" dir="auto">Though this spec is concerned with parsing, not rendering, it is recommended that in rendering to HTML, only the plain string content of the [image description] be used. Note that in the above example, the alt attribute's value is <code>foo bar</code>, not <code>foo [bar](/url)</code> or <code>foo <a href="/url">bar</a></code>. Only the plain string content is rendered, without formatting.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8538:1-8544:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo *bar*][]</span> +<pre data-sourcepos="9704:1-9708:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo *bar*][]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo *bar*]: train.jpg "train & tracks"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" /></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo *bar*]: train.jpg "train & tracks"</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8547:1-8553:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo *bar*][foobar]</span> +<pre data-sourcepos="9710:1-9712:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" /></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9715:1-9719:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo *bar*][foobar]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[FOOBAR]: train.jpg "train & tracks"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" /></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[FOOBAR]: train.jpg "train & tracks"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9721:1-9723:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="train.jpg" alt="foo bar" title="train &amp; tracks" /></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8556:1-8560:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo](train.jpg)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><img src="train.jpg" alt="foo" /></p></span></code></pre> +<pre data-sourcepos="9726:1-9728:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo](train.jpg)</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8563:1-8567:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">My ![foo bar](/path/to/train.jpg "title" )</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>My <img src="/path/to/train.jpg" alt="foo bar" title="title" /></p></span></code></pre> +<pre data-sourcepos="9730:1-9732:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="train.jpg" alt="foo" /></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8570:1-8574:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo](<url>)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><img src="url" alt="foo" /></p></span></code></pre> +<pre data-sourcepos="9735:1-9737:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">My ![foo bar](/path/to/train.jpg "title" )</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8577:1-8581:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![](/url)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><img src="/url" alt="" /></p></span></code></pre> +<pre data-sourcepos="9739:1-9741:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>My <img src="/path/to/train.jpg" alt="foo bar" title="title" /></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8584:1-8584:16" dir="auto">Reference-style:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8586:1-8592:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo][bar]</span> +<pre data-sourcepos="9744:1-9746:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo](<url>)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9748:1-9750:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="url" alt="foo" /></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9753:1-9755:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![](/url)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9757:1-9759:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url" alt="" /></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="9762:1-9762:16" dir="auto">Reference-style:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9764:1-9768:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo][bar]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[bar]: /url</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><img src="/url" alt="foo" /></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[bar]: /url</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9770:1-9772:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url" alt="foo" /></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8595:1-8601:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo][bar]</span> +<pre data-sourcepos="9775:1-9779:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo][bar]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[BAR]: /url</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><img src="/url" alt="foo" /></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[BAR]: /url</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9781:1-9783:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url" alt="foo" /></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8604:1-8604:10" dir="auto">Collapsed:</p> +<p data-sourcepos="9786:1-9786:10" dir="auto">Collapsed:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8606:1-8612:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo][]</span> +<pre data-sourcepos="9788:1-9792:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo][]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><img src="/url" alt="foo" title="title" /></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9794:1-9796:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url" alt="foo" title="title" /></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8615:1-8621:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![*foo* bar][]</span> +<pre data-sourcepos="9799:1-9803:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![*foo* bar][]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[*foo* bar]: /url "title"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><img src="/url" alt="foo bar" title="title" /></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[*foo* bar]: /url "title"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9805:1-9807:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url" alt="foo bar" title="title" /></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8624:1-8624:32" dir="auto">The labels are case-insensitive:</p> +<p data-sourcepos="9810:1-9810:32" dir="auto">The labels are case-insensitive:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8626:1-8632:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![Foo][]</span> +<pre data-sourcepos="9812:1-9816:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![Foo][]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><img src="/url" alt="Foo" title="title" /></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9818:1-9820:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url" alt="Foo" title="title" /></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8635:1-8636:33" dir="auto">As with reference links, [whitespace] is not allowed +<p data-sourcepos="9823:1-9824:33" dir="auto">As with reference links, [whitespace] is not allowed between the two sets of brackets:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8638:1-8646:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo] </span> +<pre data-sourcepos="9826:1-9831:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo] </span> <span id="LC2" class="line" lang="plaintext">[]</span> <span id="LC3" class="line" lang="plaintext"></span> -<span id="LC4" class="line" lang="plaintext">[foo]: /url "title"</span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><p><img src="/url" alt="foo" title="title" /></span> -<span id="LC7" class="line" lang="plaintext">[]</p></span></code></pre> +<span id="LC4" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9833:1-9836:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url" alt="foo" title="title" /></span> +<span id="LC2" class="line" lang="plaintext">[]</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8649:1-8649:9" dir="auto">Shortcut:</p> +<p data-sourcepos="9839:1-9839:9" dir="auto">Shortcut:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8651:1-8657:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo]</span> +<pre data-sourcepos="9841:1-9845:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![foo]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><img src="/url" alt="foo" title="title" /></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9847:1-9849:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url" alt="foo" title="title" /></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8660:1-8666:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![*foo* bar]</span> +<pre data-sourcepos="9852:1-9856:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![*foo* bar]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[*foo* bar]: /url "title"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><img src="/url" alt="foo bar" title="title" /></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[*foo* bar]: /url "title"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9858:1-9860:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url" alt="foo bar" title="title" /></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8669:1-8669:56" dir="auto">Note that link labels cannot contain unescaped brackets:</p> +<p data-sourcepos="9863:1-9863:56" dir="auto">Note that link labels cannot contain unescaped brackets:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8671:1-8678:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![[foo]]</span> +<pre data-sourcepos="9865:1-9869:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![[foo]]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[[foo]]: /url "title"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>![[foo]]</p></span> -<span id="LC6" class="line" lang="plaintext"><p>[[foo]]: /url &quot;title&quot;</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[[foo]]: /url "title"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9871:1-9874:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>![[foo]]</p></span> +<span id="LC2" class="line" lang="plaintext"><p>[[foo]]: /url &quot;title&quot;</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8681:1-8681:37" dir="auto">The link labels are case-insensitive:</p> +<p data-sourcepos="9877:1-9877:37" dir="auto">The link labels are case-insensitive:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8683:1-8689:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![Foo]</span> +<pre data-sourcepos="9879:1-9883:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![Foo]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><img src="/url" alt="Foo" title="title" /></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9885:1-9887:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="/url" alt="Foo" title="title" /></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8692:1-8693:33" dir="auto">If you just want a literal <code>!</code> followed by bracketed text, you can +<p data-sourcepos="9890:1-9891:33" dir="auto">If you just want a literal <code>!</code> followed by bracketed text, you can backslash-escape the opening <code>[</code>:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8695:1-8701:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">!\[foo]</span> +<pre data-sourcepos="9893:1-9897:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">!\[foo]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>![foo]</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9899:1-9901:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>![foo]</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8704:1-8705:4" dir="auto">If you want a link after a literal <code>!</code>, backslash-escape the +<p data-sourcepos="9904:1-9905:4" dir="auto">If you want a link after a literal <code>!</code>, backslash-escape the <code>!</code>:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8707:1-8713:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\![foo]</span> +<pre data-sourcepos="9907:1-9911:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\![foo]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>!<a href="/url" title="title">foo</a></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9913:1-9915:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>!<a href="/url" title="title">foo</a></p></span></code></pre> <copy-code></copy-code> </div> -<h2 data-sourcepos="8716:1-8716:12" dir="auto"> +<h2 data-sourcepos="9918:1-9918:12" dir="auto"> <a id="user-content-autolinks" class="anchor" href="#autolinks" aria-hidden="true"></a>Autolinks</h2> -<p data-sourcepos="8718:1-8720:18" dir="auto"><a href="@">Autolink</a>s are absolute URIs and email addresses inside +<p data-sourcepos="9920:1-9922:18" dir="auto"><a href="@">Autolink</a>s are absolute URIs and email addresses inside <code><</code> and <code>></code>. They are parsed as links, with the URL or email address as the link label.</p> -<p data-sourcepos="8722:1-8724:52" dir="auto">A <a href="@">URI autolink</a> consists of <code><</code>, followed by an +<p data-sourcepos="9924:1-9926:52" dir="auto">A <a href="@">URI autolink</a> consists of <code><</code>, followed by an [absolute URI] followed by <code>></code>. It is parsed as a link to the URI, with the URI as the link's label.</p> -<p data-sourcepos="8726:1-8731:25" dir="auto">An <a href="@">absolute URI</a>, +<p data-sourcepos="9928:1-9933:25" dir="auto">An <a href="@">absolute URI</a>, for these purposes, consists of a [scheme] followed by a colon (<code>:</code>) followed by zero or more characters other than ASCII [whitespace] and control characters, <code><</code>, and <code>></code>. If the URI includes these characters, they must be percent-encoded (e.g. <code>%20</code> for a space).</p> -<p data-sourcepos="8733:1-8736:37" dir="auto">For purposes of this spec, a <a href="@">scheme</a> is any sequence +<p data-sourcepos="9935:1-9938:37" dir="auto">For purposes of this spec, a <a href="@">scheme</a> is any sequence of 2--32 characters beginning with an ASCII letter and followed by any combination of ASCII letters, digits, or the symbols plus ("+"), period ("."), or hyphen ("-").</p> -<p data-sourcepos="8738:1-8738:30" dir="auto">Here are some valid autolinks:</p> +<p data-sourcepos="9940:1-9940:30" dir="auto">Here are some valid autolinks:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9942:1-9944:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><http://foo.bar.baz></span></code></pre> +<copy-code></copy-code> +</div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8740:1-8744:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><http://foo.bar.baz></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="http://foo.bar.baz">http://foo.bar.baz</a></p></span></code></pre> +<pre data-sourcepos="9946:1-9948:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://foo.bar.baz">http://foo.bar.baz</a></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8747:1-8751:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><http://foo.bar.baz/test?q=hello&id=22&boolean></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="http://foo.bar.baz/test?q=hello&amp;id=22&amp;boolean">http://foo.bar.baz/test?q=hello&amp;id=22&amp;boolean</a></p></span></code></pre> +<pre data-sourcepos="9951:1-9953:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><http://foo.bar.baz/test?q=hello&id=22&boolean></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8754:1-8758:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><irc://foo.bar:2233/baz></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="irc://foo.bar:2233/baz">irc://foo.bar:2233/baz</a></p></span></code></pre> +<pre data-sourcepos="9955:1-9957:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://foo.bar.baz/test?q=hello&amp;id=22&amp;boolean">http://foo.bar.baz/test?q=hello&amp;id=22&amp;boolean</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8761:1-8761:23" dir="auto">Uppercase is also fine:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8763:1-8767:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><MAILTO:FOO@BAR.BAZ></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="MAILTO:FOO@BAR.BAZ">MAILTO:FOO@BAR.BAZ</a></p></span></code></pre> +<pre data-sourcepos="9960:1-9962:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><irc://foo.bar:2233/baz></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8770:1-8773:18" dir="auto">Note that many strings that count as [absolute URIs] for +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9964:1-9966:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="irc://foo.bar:2233/baz">irc://foo.bar:2233/baz</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="9969:1-9969:23" dir="auto">Uppercase is also fine:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9971:1-9973:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><MAILTO:FOO@BAR.BAZ></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9975:1-9977:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="MAILTO:FOO@BAR.BAZ">MAILTO:FOO@BAR.BAZ</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="9980:1-9983:18" dir="auto">Note that many strings that count as [absolute URIs] for purposes of this spec are not valid URIs, because their schemes are not registered or because of other problems with their syntax:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8775:1-8779:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a+b+c:d></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="a+b+c:d">a+b+c:d</a></p></span></code></pre> +<pre data-sourcepos="9985:1-9987:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a+b+c:d></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9989:1-9991:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="a+b+c:d">a+b+c:d</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9994:1-9996:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><made-up-scheme://foo,bar></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="9998:1-10000:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="made-up-scheme://foo,bar">made-up-scheme://foo,bar</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10003:1-10005:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><http://../></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10007:1-10009:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://../">http://../</a></p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8782:1-8786:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><made-up-scheme://foo,bar></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="made-up-scheme://foo,bar">made-up-scheme://foo,bar</a></p></span></code></pre> +<pre data-sourcepos="10012:1-10014:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><localhost:5001/foo></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8789:1-8793:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><http://../></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="http://../">http://../</a></p></span></code></pre> +<pre data-sourcepos="10016:1-10018:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="localhost:5001/foo">localhost:5001/foo</a></p></span></code></pre> <copy-code></copy-code> </div> +<p data-sourcepos="10021:1-10021:36" dir="auto">Spaces are not allowed in autolinks:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8796:1-8800:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><localhost:5001/foo></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="localhost:5001/foo">localhost:5001/foo</a></p></span></code></pre> +<pre data-sourcepos="10023:1-10025:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><http://foo.bar/baz bim></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8803:1-8803:36" dir="auto">Spaces are not allowed in autolinks:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8805:1-8809:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><http://foo.bar/baz bim></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>&lt;http://foo.bar/baz bim&gt;</p></span></code></pre> +<pre data-sourcepos="10027:1-10029:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt;http://foo.bar/baz bim&gt;</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8812:1-8812:47" dir="auto">Backslash-escapes do not work inside autolinks:</p> +<p data-sourcepos="10032:1-10032:47" dir="auto">Backslash-escapes do not work inside autolinks:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8814:1-8818:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><http://example.com/\[\></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="http://example.com/%5C%5B%5C">http://example.com/\[\</a></p></span></code></pre> +<pre data-sourcepos="10034:1-10036:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><http://example.com/\[\></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8821:1-8824:55" dir="auto">An <a href="@">email autolink</a> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10038:1-10040:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://example.com/%5C%5B%5C">http://example.com/\[\</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="10043:1-10046:55" dir="auto">An <a href="@">email autolink</a> consists of <code><</code>, followed by an [email address], followed by <code>></code>. The link's label is the email address, and the URL is <code>mailto:</code> followed by the email address.</p> -<p data-sourcepos="8826:1-8829:83" dir="auto">An <a href="@">email address</a>, +<p data-sourcepos="10048:1-10051:83" dir="auto">An <a href="@">email address</a>, for these purposes, is anything that matches the <a href="https://html.spec.whatwg.org/multipage/forms.html#e-mail-state-(type=email)" rel="nofollow noreferrer noopener" target="_blank">non-normative regex from the HTML5 spec</a>:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8831:5-8833:0" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?</span> +<pre data-sourcepos="10053:5-10055:0" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?</span> <span id="LC2" class="line" lang="plaintext">(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8834:1-8834:28" dir="auto">Examples of email autolinks:</p> +<p data-sourcepos="10056:1-10056:28" dir="auto">Examples of email autolinks:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10058:1-10060:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><foo@bar.example.com></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10062:1-10064:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="mailto:foo@bar.example.com">foo@bar.example.com</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10067:1-10069:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><foo+special@Bar.baz-bar0.com></span></code></pre> +<copy-code></copy-code> +</div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8836:1-8840:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><foo@bar.example.com></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="mailto:foo@bar.example.com">foo@bar.example.com</a></p></span></code></pre> +<pre data-sourcepos="10071:1-10073:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="mailto:foo+special@Bar.baz-bar0.com">foo+special@Bar.baz-bar0.com</a></p></span></code></pre> <copy-code></copy-code> </div> +<p data-sourcepos="10076:1-10076:53" dir="auto">Backslash-escapes do not work inside email autolinks:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8843:1-8847:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><foo+special@Bar.baz-bar0.com></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="mailto:foo+special@Bar.baz-bar0.com">foo+special@Bar.baz-bar0.com</a></p></span></code></pre> +<pre data-sourcepos="10078:1-10080:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><foo\+@bar.example.com></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8850:1-8850:53" dir="auto">Backslash-escapes do not work inside email autolinks:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8852:1-8856:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><foo\+@bar.example.com></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>&lt;foo+@bar.example.com&gt;</p></span></code></pre> +<pre data-sourcepos="10082:1-10084:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt;foo+@bar.example.com&gt;</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8859:1-8859:24" dir="auto">These are not autolinks:</p> +<p data-sourcepos="10087:1-10087:24" dir="auto">These are not autolinks:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8861:1-8865:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>&lt;&gt;</p></span></code></pre> +<pre data-sourcepos="10089:1-10091:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8868:1-8872:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">< http://foo.bar ></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>&lt; http://foo.bar &gt;</p></span></code></pre> +<pre data-sourcepos="10093:1-10095:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt;&gt;</p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8875:1-8879:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><m:abc></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>&lt;m:abc&gt;</p></span></code></pre> +<pre data-sourcepos="10098:1-10100:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">< http://foo.bar ></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8882:1-8886:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><foo.bar.baz></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>&lt;foo.bar.baz&gt;</p></span></code></pre> +<pre data-sourcepos="10102:1-10104:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt; http://foo.bar &gt;</p></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8889:1-8893:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">http://example.com</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>http://example.com</p></span></code></pre> +<pre data-sourcepos="10107:1-10109:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><m:abc></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8896:1-8900:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo@bar.example.com</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo@bar.example.com</p></span></code></pre> +<pre data-sourcepos="10111:1-10113:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt;m:abc&gt;</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10116:1-10118:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><foo.bar.baz></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10120:1-10122:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt;foo.bar.baz&gt;</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10125:1-10127:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">http://example.com</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10129:1-10131:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>http://example.com</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10134:1-10136:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo@bar.example.com</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10138:1-10140:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo@bar.example.com</p></span></code></pre> <copy-code></copy-code> </div> <div> -<h2 data-sourcepos="8904:1-8904:24"> +<h2 data-sourcepos="10144:1-10144:24"> <a id="user-content-autolinks-extension" class="anchor" href="#autolinks-extension" aria-hidden="true"></a>Autolinks (extension)</h2> -<p data-sourcepos="8906:1-8907:29">GFM enables the <code>autolink</code> extension, where autolinks will be recognised in a +<p data-sourcepos="10146:1-10147:29">GFM enables the <code>autolink</code> extension, where autolinks will be recognised in a greater number of conditions.</p> -<p data-sourcepos="8909:1-8913:8">[Autolink]s can also be constructed without requiring the use of <code><</code> and to <code>></code> +<p data-sourcepos="10149:1-10153:8">[Autolink]s can also be constructed without requiring the use of <code><</code> and to <code>></code> to delimit them, although they will be recognized under a smaller set of circumstances. All such recognized autolinks can only come at the beginning of a line, after whitespace, or any of the delimiting characters <code>*</code>, <code>_</code>, <code>~</code>, and <code>(</code>.</p> -<p data-sourcepos="8915:1-8921:73">An <a href="@">extended www autolink</a> will be recognized +<p data-sourcepos="10155:1-10161:73">An <a href="@">extended www autolink</a> will be recognized when the text <code>www.</code> is found followed by a [valid domain]. A <a href="@">valid domain</a> consists of segments of alphanumeric characters, underscores (<code>_</code>) and hyphens (<code>-</code>) separated by periods (<code>.</code>). There must be at least one period, and no underscores may be present in the last two segments of the domain.</p> -<p data-sourcepos="8923:1-8923:49">The scheme <code>http</code> will be inserted automatically:</p> +<p data-sourcepos="10163:1-10163:49">The scheme <code>http</code> will be inserted automatically:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10165:1-10167:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">www.commonmark.org</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10169:1-10171:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://www.commonmark.org">www.commonmark.org</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="10173:1-10173:77">After a [valid domain], zero or more non-space non-<code><</code> characters may follow:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8925:1-8929:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">www.commonmark.org</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="http://www.commonmark.org">www.commonmark.org</a></p></span></code></pre> +<pre data-sourcepos="10175:1-10177:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Visit www.commonmark.org/help for more information.</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8931:1-8931:77">After a [valid domain], zero or more non-space non-<code><</code> characters may follow:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8933:1-8937:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Visit www.commonmark.org/help for more information.</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>Visit <a href="http://www.commonmark.org/help">www.commonmark.org/help</a> for more information.</p></span></code></pre> +<pre data-sourcepos="10179:1-10181:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Visit <a href="http://www.commonmark.org/help">www.commonmark.org/help</a> for more information.</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8939:1-8939:64">We then apply <a href="@">extended autolink path validation</a> as follows:</p> -<p data-sourcepos="8941:1-8943:21">Trailing punctuation (specifically, <code>?</code>, <code>!</code>, <code>.</code>, <code>,</code>, <code>:</code>, <code>*</code>, <code>_</code>, and <code>~</code>) +<p data-sourcepos="10183:1-10183:64">We then apply <a href="@">extended autolink path validation</a> as follows:</p> +<p data-sourcepos="10185:1-10187:21">Trailing punctuation (specifically, <code>?</code>, <code>!</code>, <code>.</code>, <code>,</code>, <code>:</code>, <code>*</code>, <code>_</code>, and <code>~</code>) will not be considered part of the autolink, though they may be included in the interior of the link:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8945:1-8952:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Visit www.commonmark.org.</span> +<pre data-sourcepos="10189:1-10193:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Visit www.commonmark.org.</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">Visit www.commonmark.org/a.b.</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>Visit <a href="http://www.commonmark.org">www.commonmark.org</a>.</p></span> -<span id="LC6" class="line" lang="plaintext"><p>Visit <a href="http://www.commonmark.org/a.b">www.commonmark.org/a.b</a>.</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">Visit www.commonmark.org/a.b.</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10195:1-10198:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Visit <a href="http://www.commonmark.org">www.commonmark.org</a>.</p></span> +<span id="LC2" class="line" lang="plaintext"><p>Visit <a href="http://www.commonmark.org/a.b">www.commonmark.org/a.b</a>.</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8954:1-8957:76">When an autolink ends in <code>)</code>, we scan the entire autolink for the total number +<p data-sourcepos="10200:1-10203:76">When an autolink ends in <code>)</code>, we scan the entire autolink for the total number of parentheses. If there is a greater number of closing parentheses than opening ones, we don't consider the unmatched trailing parentheses part of the autolink, in order to facilitate including an autolink inside a parenthesis:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8959:1-8972:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">www.google.com/search?q=Markup+(business)</span> +<pre data-sourcepos="10205:1-10213:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">www.google.com/search?q=Markup+(business)</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext">www.google.com/search?q=Markup+(business)))</span> <span id="LC4" class="line" lang="plaintext"></span> <span id="LC5" class="line" lang="plaintext">(www.google.com/search?q=Markup+(business))</span> <span id="LC6" class="line" lang="plaintext"></span> -<span id="LC7" class="line" lang="plaintext">(www.google.com/search?q=Markup+(business)</span> -<span id="LC8" class="line" lang="plaintext">.</span> -<span id="LC9" class="line" lang="plaintext"><p><a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a></p></span> -<span id="LC10" class="line" lang="plaintext"><p><a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a>))</p></span> -<span id="LC11" class="line" lang="plaintext"><p>(<a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a>)</p></span> -<span id="LC12" class="line" lang="plaintext"><p>(<a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a></p></span></code></pre> +<span id="LC7" class="line" lang="plaintext">(www.google.com/search?q=Markup+(business)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10215:1-10220:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a></p></span> +<span id="LC2" class="line" lang="plaintext"><p><a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a>))</p></span> +<span id="LC3" class="line" lang="plaintext"><p>(<a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a>)</p></span> +<span id="LC4" class="line" lang="plaintext"><p>(<a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8974:1-8976:8">This check is only done when the link ends in a closing parentheses <code>)</code>, so if +<p data-sourcepos="10222:1-10224:8">This check is only done when the link ends in a closing parentheses <code>)</code>, so if the only parentheses are in the interior of the autolink, no special rules are applied:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8978:1-8982:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">www.google.com/search?q=(business))+ok</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="http://www.google.com/search?q=(business))+ok">www.google.com/search?q=(business))+ok</a></p></span></code></pre> +<pre data-sourcepos="10226:1-10228:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">www.google.com/search?q=(business))+ok</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10230:1-10232:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://www.google.com/search?q=(business))+ok">www.google.com/search?q=(business))+ok</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8984:1-8987:13">If an autolink ends in a semicolon (<code>;</code>), we check to see if it appears to +<p data-sourcepos="10234:1-10237:13">If an autolink ends in a semicolon (<code>;</code>), we check to see if it appears to resemble an [entity reference][entity references]; if the preceding text is <code>&</code> followed by one or more alphanumeric characters. If so, it is excluded from the autolink:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8989:1-8996:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">www.google.com/search?q=commonmark&hl=en</span> +<pre data-sourcepos="10239:1-10243:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">www.google.com/search?q=commonmark&hl=en</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">www.google.com/search?q=commonmark&hl;</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><a href="http://www.google.com/search?q=commonmark&amp;hl=en">www.google.com/search?q=commonmark&amp;hl=en</a></p></span> -<span id="LC6" class="line" lang="plaintext"><p><a href="http://www.google.com/search?q=commonmark">www.google.com/search?q=commonmark</a>&amp;hl;</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">www.google.com/search?q=commonmark&hl;</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10245:1-10248:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://www.google.com/search?q=commonmark&amp;hl=en">www.google.com/search?q=commonmark&amp;hl=en</a></p></span> +<span id="LC2" class="line" lang="plaintext"><p><a href="http://www.google.com/search?q=commonmark">www.google.com/search?q=commonmark</a>&amp;hl;</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="8998:1-8998:33"><code><</code> immediately ends an autolink.</p> +<p data-sourcepos="10250:1-10250:33"><code><</code> immediately ends an autolink.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9000:1-9004:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">www.commonmark.org/he<lp</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="http://www.commonmark.org/he">www.commonmark.org/he</a>&lt;lp</p></span></code></pre> +<pre data-sourcepos="10252:1-10254:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">www.commonmark.org/he<lp</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9006:1-9009:36">An <a href="@">extended url autolink</a> will be recognised when one of the schemes +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10256:1-10258:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://www.commonmark.org/he">www.commonmark.org/he</a>&lt;lp</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="10260:1-10263:36">An <a href="@">extended url autolink</a> will be recognised when one of the schemes <code>http://</code>, <code>https://</code>, or <code>ftp://</code>, followed by a [valid domain], then zero or more non-space non-<code><</code> characters according to [extended autolink path validation]:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9011:1-9021:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">http://commonmark.org</span> +<pre data-sourcepos="10265:1-10271:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">http://commonmark.org</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext">(Visit https://encrypted.google.com/search?q=Markup+(business))</span> <span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext">Anonymous FTP is available at ftp://foo.bar.baz.</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><p><a href="http://commonmark.org">http://commonmark.org</a></p></span> -<span id="LC8" class="line" lang="plaintext"><p>(Visit <a href="https://encrypted.google.com/search?q=Markup+(business)">https://encrypted.google.com/search?q=Markup+(business)</a>)</p></span> -<span id="LC9" class="line" lang="plaintext"><p>Anonymous FTP is available at <a href="ftp://foo.bar.baz">ftp://foo.bar.baz</a>.</p></span></code></pre> +<span id="LC5" class="line" lang="plaintext">Anonymous FTP is available at ftp://foo.bar.baz.</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10273:1-10277:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="http://commonmark.org">http://commonmark.org</a></p></span> +<span id="LC2" class="line" lang="plaintext"><p>(Visit <a href="https://encrypted.google.com/search?q=Markup+(business)">https://encrypted.google.com/search?q=Markup+(business)</a>)</p></span> +<span id="LC3" class="line" lang="plaintext"><p>Anonymous FTP is available at <a href="ftp://foo.bar.baz">ftp://foo.bar.baz</a>.</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9024:1-9026:20">An <a href="@">extended email autolink</a> will be recognised when an email address is +<p data-sourcepos="10280:1-10282:20">An <a href="@">extended email autolink</a> will be recognised when an email address is recognised within any text node. Email addresses are recognised according to the following rules:</p> -<ul data-sourcepos="9028:1-9034:0"> -<li data-sourcepos="9028:1-9028:75">One ore more characters which are alphanumeric, or <code>.</code>, <code>-</code>, <code>_</code>, or <code>+</code>.</li> -<li data-sourcepos="9029:1-9029:16">An <code>@</code> symbol.</li> -<li data-sourcepos="9030:1-9034:0">One or more characters which are alphanumeric, or <code>-</code> or <code>_</code>, +<ul data-sourcepos="10284:1-10290:0"> +<li data-sourcepos="10284:1-10284:75">One ore more characters which are alphanumeric, or <code>.</code>, <code>-</code>, <code>_</code>, or <code>+</code>.</li> +<li data-sourcepos="10285:1-10285:16">An <code>@</code> symbol.</li> +<li data-sourcepos="10286:1-10290:0">One or more characters which are alphanumeric, or <code>-</code> or <code>_</code>, separated by periods (<code>.</code>). There must be at least one period. The last character must not be one of <code>-</code> or <code>_</code>.</li> </ul> -<p data-sourcepos="9035:1-9035:71">The scheme <code>mailto:</code> will automatically be added to the generated link:</p> +<p data-sourcepos="10291:1-10291:71">The scheme <code>mailto:</code> will automatically be added to the generated link:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10293:1-10295:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo@bar.baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10297:1-10299:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="mailto:foo@bar.baz">foo@bar.baz</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="10301:1-10301:44"><code>+</code> can occur before the <code>@</code>, but not after.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9037:1-9041:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo@bar.baz</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="mailto:foo@bar.baz">foo@bar.baz</a></p></span></code></pre> +<pre data-sourcepos="10303:1-10305:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">hello@mail+xyz.example isn't valid, but hello+xyz@mail.example is.</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9043:1-9043:44"><code>+</code> can occur before the <code>@</code>, but not after.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9045:1-9049:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">hello@mail+xyz.example isn't valid, but hello+xyz@mail.example is.</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>hello@mail+xyz.example isn't valid, but <a href="mailto:hello+xyz@mail.example">hello+xyz@mail.example</a> is.</p></span></code></pre> +<pre data-sourcepos="10307:1-10309:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>hello@mail+xyz.example isn't valid, but <a href="mailto:hello+xyz@mail.example">hello+xyz@mail.example</a> is.</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9051:1-9053:12"><code>.</code>, <code>-</code>, and <code>_</code> can occur on both sides of the <code>@</code>, but only <code>.</code> may occur at +<p data-sourcepos="10311:1-10313:12"><code>.</code>, <code>-</code>, and <code>_</code> can occur on both sides of the <code>@</code>, but only <code>.</code> may occur at the end of the email address, in which case it will not be considered part of the address:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9055:1-9068:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">a.b-c_d@a.b</span> +<pre data-sourcepos="10315:1-10323:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">a.b-c_d@a.b</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext">a.b-c_d@a.b.</span> <span id="LC4" class="line" lang="plaintext"></span> <span id="LC5" class="line" lang="plaintext">a.b-c_d@a.b-</span> <span id="LC6" class="line" lang="plaintext"></span> -<span id="LC7" class="line" lang="plaintext">a.b-c_d@a.b_</span> -<span id="LC8" class="line" lang="plaintext">.</span> -<span id="LC9" class="line" lang="plaintext"><p><a href="mailto:a.b-c_d@a.b">a.b-c_d@a.b</a></p></span> -<span id="LC10" class="line" lang="plaintext"><p><a href="mailto:a.b-c_d@a.b">a.b-c_d@a.b</a>.</p></span> -<span id="LC11" class="line" lang="plaintext"><p>a.b-c_d@a.b-</p></span> -<span id="LC12" class="line" lang="plaintext"><p>a.b-c_d@a.b_</p></span></code></pre> +<span id="LC7" class="line" lang="plaintext">a.b-c_d@a.b_</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10325:1-10330:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="mailto:a.b-c_d@a.b">a.b-c_d@a.b</a></p></span> +<span id="LC2" class="line" lang="plaintext"><p><a href="mailto:a.b-c_d@a.b">a.b-c_d@a.b</a>.</p></span> +<span id="LC3" class="line" lang="plaintext"><p>a.b-c_d@a.b-</p></span> +<span id="LC4" class="line" lang="plaintext"><p>a.b-c_d@a.b_</p></span></code></pre> <copy-code></copy-code> </div> </div> -<h2 data-sourcepos="9072:1-9072:11" dir="auto"> +<h2 data-sourcepos="10334:1-10334:11" dir="auto"> <a id="user-content-raw-html" class="anchor" href="#raw-html" aria-hidden="true"></a>Raw HTML</h2> -<p data-sourcepos="9074:1-9077:57" dir="auto">Text between <code><</code> and <code>></code> that looks like an HTML tag is parsed as a +<p data-sourcepos="10336:1-10339:57" dir="auto">Text between <code><</code> and <code>></code> that looks like an HTML tag is parsed as a raw HTML tag and will be rendered in HTML without escaping. Tag and attribute names are not limited to current HTML tags, so custom tags (and even, say, DocBook tags) may be used.</p> -<p data-sourcepos="9079:1-9079:29" dir="auto">Here is the grammar for tags:</p> -<p data-sourcepos="9081:1-9083:14" dir="auto">A <a href="@">tag name</a> consists of an ASCII letter +<p data-sourcepos="10341:1-10341:29" dir="auto">Here is the grammar for tags:</p> +<p data-sourcepos="10343:1-10345:14" dir="auto">A <a href="@">tag name</a> consists of an ASCII letter followed by zero or more ASCII letters, digits, or hyphens (<code>-</code>).</p> -<p data-sourcepos="9085:1-9087:32" dir="auto">An <a href="@">attribute</a> consists of [whitespace], +<p data-sourcepos="10347:1-10349:32" dir="auto">An <a href="@">attribute</a> consists of [whitespace], an [attribute name], and an optional [attribute value specification].</p> -<p data-sourcepos="9089:1-9092:52" dir="auto">An <a href="@">attribute name</a> +<p data-sourcepos="10351:1-10354:52" dir="auto">An <a href="@">attribute name</a> consists of an ASCII letter, <code>_</code>, or <code>:</code>, followed by zero or more ASCII letters, digits, <code>_</code>, <code>.</code>, <code>:</code>, or <code>-</code>. (Note: This is the XML specification restricted to ASCII. HTML5 is laxer.)</p> -<p data-sourcepos="9094:1-9097:7" dir="auto">An <a href="@">attribute value specification</a> +<p data-sourcepos="10356:1-10359:7" dir="auto">An <a href="@">attribute value specification</a> consists of optional [whitespace], a <code>=</code> character, optional [whitespace], and an [attribute value].</p> -<p data-sourcepos="9099:1-9101:72" dir="auto">An <a href="@">attribute value</a> +<p data-sourcepos="10361:1-10363:72" dir="auto">An <a href="@">attribute value</a> consists of an [unquoted attribute value], a [single-quoted attribute value], or a [double-quoted attribute value].</p> -<p data-sourcepos="9103:1-9105:60" dir="auto">An <a href="@">unquoted attribute value</a> +<p data-sourcepos="10365:1-10367:60" dir="auto">An <a href="@">unquoted attribute value</a> is a nonempty string of characters not including [whitespace], <code>"</code>, <code>'</code>, <code>=</code>, <code><</code>, <code>></code>, or <code>`</code>.</p> -<p data-sourcepos="9107:1-9109:46" dir="auto">A <a href="@">single-quoted attribute value</a> +<p data-sourcepos="10369:1-10371:46" dir="auto">A <a href="@">single-quoted attribute value</a> consists of <code>'</code>, zero or more characters not including <code>'</code>, and a final <code>'</code>.</p> -<p data-sourcepos="9111:1-9113:46" dir="auto">A <a href="@">double-quoted attribute value</a> +<p data-sourcepos="10373:1-10375:46" dir="auto">A <a href="@">double-quoted attribute value</a> consists of <code>"</code>, zero or more characters not including <code>"</code>, and a final <code>"</code>.</p> -<p data-sourcepos="9115:1-9117:31" dir="auto">An <a href="@">open tag</a> consists of a <code><</code> character, a [tag name], +<p data-sourcepos="10377:1-10379:31" dir="auto">An <a href="@">open tag</a> consists of a <code><</code> character, a [tag name], zero or more [attributes], optional [whitespace], an optional <code>/</code> character, and a <code>></code> character.</p> -<p data-sourcepos="9119:1-9120:57" dir="auto">A <a href="@">closing tag</a> consists of the string <code></</code>, a +<p data-sourcepos="10381:1-10382:57" dir="auto">A <a href="@">closing tag</a> consists of the string <code></</code>, a [tag name], optional [whitespace], and the character <code>></code>.</p> -<p data-sourcepos="9122:1-9125:63" dir="auto">An <a href="@">HTML comment</a> consists of <code><!--</code> + <em>text</em> + <code>--></code>, +<p data-sourcepos="10384:1-10387:63" dir="auto">An <a href="@">HTML comment</a> consists of <code><!--</code> + <em>text</em> + <code>--></code>, where <em>text</em> does not start with <code>></code> or <code>-></code>, does not end with <code>-</code>, and does not contain <code>--</code>. (See the <a href="http://www.w3.org/TR/html5/syntax.html#comments" rel="nofollow noreferrer noopener" target="_blank">HTML5 spec</a>.)</p> -<p data-sourcepos="9127:1-9130:5" dir="auto">A <a href="@">processing instruction</a> +<p data-sourcepos="10389:1-10392:5" dir="auto">A <a href="@">processing instruction</a> consists of the string <code><?</code>, a string of characters not including the string <code>?></code>, and the string <code>?></code>.</p> -<p data-sourcepos="9132:1-9135:37" dir="auto">A <a href="@">declaration</a> consists of the +<p data-sourcepos="10394:1-10397:37" dir="auto">A <a href="@">declaration</a> consists of the string <code><!</code>, a name consisting of one or more uppercase ASCII letters, [whitespace], a string of characters not including the character <code>></code>, and the character <code>></code>.</p> -<p data-sourcepos="9137:1-9139:28" dir="auto">A <a href="@">CDATA section</a> consists of +<p data-sourcepos="10399:1-10401:28" dir="auto">A <a href="@">CDATA section</a> consists of the string <code><![CDATA[</code>, a string of characters not including the string <code>]]></code>, and the string <code>]]></code>.</p> -<p data-sourcepos="9141:1-9143:21" dir="auto">An <a href="@">HTML tag</a> consists of an [open tag], a [closing tag], +<p data-sourcepos="10403:1-10405:21" dir="auto">An <a href="@">HTML tag</a> consists of an [open tag], a [closing tag], an [HTML comment], a [processing instruction], a [declaration], or a [CDATA section].</p> -<p data-sourcepos="9145:1-9145:31" dir="auto">Here are some simple open tags:</p> +<p data-sourcepos="10407:1-10407:31" dir="auto">Here are some simple open tags:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10409:1-10411:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a><bab><c2c></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10413:1-10415:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a><bab><c2c></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="10418:1-10418:15" dir="auto">Empty elements:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10420:1-10422:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a/><b2/></span></code></pre> +<copy-code></copy-code> +</div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9147:1-9151:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a><bab><c2c></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a><bab><c2c></p></span></code></pre> +<pre data-sourcepos="10424:1-10426:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a/><b2/></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9154:1-9154:15" dir="auto">Empty elements:</p> +<p data-sourcepos="10429:1-10429:24" dir="auto">[Whitespace] is allowed:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9156:1-9160:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a/><b2/></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a/><b2/></p></span></code></pre> +<pre data-sourcepos="10431:1-10434:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a /><b2</span> +<span id="LC2" class="line" lang="plaintext">data="foo" ></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9163:1-9163:24" dir="auto">[Whitespace] is allowed:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9165:1-9171:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a /><b2</span> -<span id="LC2" class="line" lang="plaintext">data="foo" ></span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p><a /><b2</span> -<span id="LC5" class="line" lang="plaintext">data="foo" ></p></span></code></pre> +<pre data-sourcepos="10436:1-10439:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a /><b2</span> +<span id="LC2" class="line" lang="plaintext">data="foo" ></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9174:1-9174:16" dir="auto">With attributes:</p> +<p data-sourcepos="10442:1-10442:16" dir="auto">With attributes:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9176:1-9182:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a foo="bar" bam = 'baz <em>"</em>'</span> -<span id="LC2" class="line" lang="plaintext">_boolean zoop:33=zoop:33 /></span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p><a foo="bar" bam = 'baz <em>"</em>'</span> -<span id="LC5" class="line" lang="plaintext">_boolean zoop:33=zoop:33 /></p></span></code></pre> +<pre data-sourcepos="10444:1-10447:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a foo="bar" bam = 'baz <em>"</em>'</span> +<span id="LC2" class="line" lang="plaintext">_boolean zoop:33=zoop:33 /></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9185:1-9185:29" dir="auto">Custom tag names can be used:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9187:1-9191:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo <responsive-image src="foo.jpg" /></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>Foo <responsive-image src="foo.jpg" /></p></span></code></pre> +<pre data-sourcepos="10449:1-10452:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a foo="bar" bam = 'baz <em>"</em>'</span> +<span id="LC2" class="line" lang="plaintext">_boolean zoop:33=zoop:33 /></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9194:1-9194:38" dir="auto">Illegal tag names, not parsed as HTML:</p> +<p data-sourcepos="10455:1-10455:29" dir="auto">Custom tag names can be used:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9196:1-9200:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><33> <__></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>&lt;33&gt; &lt;__&gt;</p></span></code></pre> +<pre data-sourcepos="10457:1-10459:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo <responsive-image src="foo.jpg" /></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9203:1-9203:24" dir="auto">Illegal attribute names:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9205:1-9209:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a h*#ref="hi"></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>&lt;a h*#ref=&quot;hi&quot;&gt;</p></span></code></pre> +<pre data-sourcepos="10461:1-10463:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo <responsive-image src="foo.jpg" /></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9212:1-9212:25" dir="auto">Illegal attribute values:</p> +<p data-sourcepos="10466:1-10466:38" dir="auto">Illegal tag names, not parsed as HTML:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9214:1-9218:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="hi'> <a href=hi'></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>&lt;a href=&quot;hi'&gt; &lt;a href=hi'&gt;</p></span></code></pre> +<pre data-sourcepos="10468:1-10470:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><33> <__></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9221:1-9221:21" dir="auto">Illegal [whitespace]:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9223:1-9233:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">< a><</span> +<pre data-sourcepos="10472:1-10474:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt;33&gt; &lt;__&gt;</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="10477:1-10477:24" dir="auto">Illegal attribute names:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10479:1-10481:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a h*#ref="hi"></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10483:1-10485:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt;a h*#ref=&quot;hi&quot;&gt;</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="10488:1-10488:25" dir="auto">Illegal attribute values:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10490:1-10492:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="hi'> <a href=hi'></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10494:1-10496:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt;a href=&quot;hi'&gt; &lt;a href=hi'&gt;</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="10499:1-10499:21" dir="auto">Illegal [whitespace]:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10501:1-10506:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">< a><</span> <span id="LC2" class="line" lang="plaintext">foo><bar/ ></span> <span id="LC3" class="line" lang="plaintext"><foo bar=baz</span> -<span id="LC4" class="line" lang="plaintext">bim!bop /></span> -<span id="LC5" class="line" lang="plaintext">.</span> -<span id="LC6" class="line" lang="plaintext"><p>&lt; a&gt;&lt;</span> -<span id="LC7" class="line" lang="plaintext">foo&gt;&lt;bar/ &gt;</span> -<span id="LC8" class="line" lang="plaintext">&lt;foo bar=baz</span> -<span id="LC9" class="line" lang="plaintext">bim!bop /&gt;</p></span></code></pre> +<span id="LC4" class="line" lang="plaintext">bim!bop /></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10508:1-10513:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt; a&gt;&lt;</span> +<span id="LC2" class="line" lang="plaintext">foo&gt;&lt;bar/ &gt;</span> +<span id="LC3" class="line" lang="plaintext">&lt;foo bar=baz</span> +<span id="LC4" class="line" lang="plaintext">bim!bop /&gt;</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="10516:1-10516:21" dir="auto">Missing [whitespace]:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10518:1-10520:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href='bar'title=title></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10522:1-10524:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt;a href='bar'title=title&gt;</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9236:1-9236:21" dir="auto">Missing [whitespace]:</p> +<p data-sourcepos="10527:1-10527:13" dir="auto">Closing tags:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9238:1-9242:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href='bar'title=title></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>&lt;a href='bar'title=title&gt;</p></span></code></pre> +<pre data-sourcepos="10529:1-10531:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></a></foo ></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9245:1-9245:13" dir="auto">Closing tags:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9247:1-9251:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></a></foo ></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p></a></foo ></p></span></code></pre> +<pre data-sourcepos="10533:1-10535:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p></a></foo ></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9254:1-9254:34" dir="auto">Illegal attributes in closing tag:</p> +<p data-sourcepos="10538:1-10538:34" dir="auto">Illegal attributes in closing tag:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9256:1-9260:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></a href="foo"></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>&lt;/a href=&quot;foo&quot;&gt;</p></span></code></pre> +<pre data-sourcepos="10540:1-10542:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></a href="foo"></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9263:1-9263:9" dir="auto">Comments:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9265:1-9271:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <!-- this is a</span> -<span id="LC2" class="line" lang="plaintext">comment - with hyphen --></span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>foo <!-- this is a</span> -<span id="LC5" class="line" lang="plaintext">comment - with hyphen --></p></span></code></pre> +<pre data-sourcepos="10544:1-10546:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt;/a href=&quot;foo&quot;&gt;</p></span></code></pre> <copy-code></copy-code> </div> +<p data-sourcepos="10549:1-10549:9" dir="auto">Comments:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9274:1-9278:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <!-- not a comment -- two hyphens --></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo &lt;!-- not a comment -- two hyphens --&gt;</p></span></code></pre> +<pre data-sourcepos="10551:1-10554:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <!-- this is a</span> +<span id="LC2" class="line" lang="plaintext">comment - with hyphen --></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9281:1-9281:13" dir="auto">Not comments:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9283:1-9290:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <!--> foo --></span> +<pre data-sourcepos="10556:1-10559:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <!-- this is a</span> +<span id="LC2" class="line" lang="plaintext">comment - with hyphen --></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10562:1-10564:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <!-- not a comment -- two hyphens --></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10566:1-10568:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo &lt;!-- not a comment -- two hyphens --&gt;</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="10571:1-10571:13" dir="auto">Not comments:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10573:1-10577:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <!--> foo --></span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">foo <!-- foo---></span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p>foo &lt;!--&gt; foo --&gt;</p></span> -<span id="LC6" class="line" lang="plaintext"><p>foo &lt;!-- foo---&gt;</p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">foo <!-- foo---></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10579:1-10582:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo &lt;!--&gt; foo --&gt;</p></span> +<span id="LC2" class="line" lang="plaintext"><p>foo &lt;!-- foo---&gt;</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9293:1-9293:24" dir="auto">Processing instructions:</p> +<p data-sourcepos="10585:1-10585:24" dir="auto">Processing instructions:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9295:1-9299:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <?php echo $a; ?></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo <?php echo $a; ?></p></span></code></pre> +<pre data-sourcepos="10587:1-10589:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <?php echo $a; ?></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9302:1-9302:13" dir="auto">Declarations:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9304:1-9308:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <!ELEMENT br EMPTY></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo <!ELEMENT br EMPTY></p></span></code></pre> +<pre data-sourcepos="10591:1-10593:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <?php echo $a; ?></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9311:1-9311:15" dir="auto">CDATA sections:</p> +<p data-sourcepos="10596:1-10596:13" dir="auto">Declarations:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9313:1-9317:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <![CDATA[>&<]]></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo <![CDATA[>&<]]></p></span></code></pre> +<pre data-sourcepos="10598:1-10600:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <!ELEMENT br EMPTY></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9320:1-9321:11" dir="auto">Entity and numeric character references are preserved in HTML +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10602:1-10604:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <!ELEMENT br EMPTY></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="10607:1-10607:15" dir="auto">CDATA sections:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10609:1-10611:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <![CDATA[>&<]]></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10613:1-10615:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <![CDATA[>&<]]></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="10618:1-10619:11" dir="auto">Entity and numeric character references are preserved in HTML attributes:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9323:1-9327:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <a href="&ouml;"></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo <a href="&ouml;"></p></span></code></pre> +<pre data-sourcepos="10621:1-10623:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <a href="&ouml;"></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9330:1-9330:49" dir="auto">Backslash escapes do not work in HTML attributes:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9332:1-9336:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <a href="\*"></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo <a href="\*"></p></span></code></pre> +<pre data-sourcepos="10625:1-10627:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <a href="&ouml;"></p></span></code></pre> <copy-code></copy-code> </div> +<p data-sourcepos="10630:1-10630:49" dir="auto">Backslash escapes do not work in HTML attributes:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9339:1-9343:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="\""></span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>&lt;a href=&quot;&quot;&quot;&gt;</p></span></code></pre> +<pre data-sourcepos="10632:1-10634:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <a href="\*"></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10636:1-10638:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <a href="\*"></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10641:1-10643:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="\""></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10645:1-10647:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt;a href=&quot;&quot;&quot;&gt;</p></span></code></pre> <copy-code></copy-code> </div> <div> -<h2 data-sourcepos="9348:1-9348:34"> +<h2 data-sourcepos="10652:1-10652:34"> <a id="user-content-disallowed-raw-html-extension" class="anchor" href="#disallowed-raw-html-extension" aria-hidden="true"></a>Disallowed Raw HTML (extension)</h2> -<p data-sourcepos="9350:1-9351:36">GFM enables the <code>tagfilter</code> extension, where the following HTML tags will be +<p data-sourcepos="10654:1-10655:36">GFM enables the <code>tagfilter</code> extension, where the following HTML tags will be filtered when rendering HTML output:</p> -<ul data-sourcepos="9353:1-9362:0"> -<li data-sourcepos="9353:1-9353:11"><code><title></code></li> -<li data-sourcepos="9354:1-9354:14"><code><textarea></code></li> -<li data-sourcepos="9355:1-9355:11"><code><style></code></li> -<li data-sourcepos="9356:1-9356:9"><code><xmp></code></li> -<li data-sourcepos="9357:1-9357:12"><code><iframe></code></li> -<li data-sourcepos="9358:1-9358:13"><code><noembed></code></li> -<li data-sourcepos="9359:1-9359:14"><code><noframes></code></li> -<li data-sourcepos="9360:1-9360:12"><code><script></code></li> -<li data-sourcepos="9361:1-9362:0"><code><plaintext></code></li> +<ul data-sourcepos="10657:1-10666:0"> +<li data-sourcepos="10657:1-10657:11"><code><title></code></li> +<li data-sourcepos="10658:1-10658:14"><code><textarea></code></li> +<li data-sourcepos="10659:1-10659:11"><code><style></code></li> +<li data-sourcepos="10660:1-10660:9"><code><xmp></code></li> +<li data-sourcepos="10661:1-10661:12"><code><iframe></code></li> +<li data-sourcepos="10662:1-10662:13"><code><noembed></code></li> +<li data-sourcepos="10663:1-10663:14"><code><noframes></code></li> +<li data-sourcepos="10664:1-10664:12"><code><script></code></li> +<li data-sourcepos="10665:1-10666:0"><code><plaintext></code></li> </ul> -<p data-sourcepos="9363:1-9366:71">Filtering is done by replacing the leading <code><</code> with the entity <code>&lt;</code>. These +<p data-sourcepos="10667:1-10670:71">Filtering is done by replacing the leading <code><</code> with the entity <code>&lt;</code>. These tags are chosen in particular as they change how HTML is interpreted in a way unique to them (i.e. nested HTML is interpreted differently), and this is usually undesireable in the context of other rendered Markdown content.</p> -<p data-sourcepos="9368:1-9368:39">All other HTML tags are left untouched.</p> +<p data-sourcepos="10672:1-10672:39">All other HTML tags are left untouched.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9370:1-9381:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><strong> <title> <style> <em></span> +<pre data-sourcepos="10674:1-10680:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><strong> <title> <style> <em></span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext"><blockquote></span> <span id="LC4" class="line" lang="plaintext"> <xmp> is disallowed. <XMP> is also disallowed.</span> -<span id="LC5" class="line" lang="plaintext"></blockquote></span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><p><strong> &lt;title> &lt;style> <em></p></span> -<span id="LC8" class="line" lang="plaintext"><blockquote></span> -<span id="LC9" class="line" lang="plaintext"> &lt;xmp> is disallowed. &lt;XMP> is also disallowed.</span> -<span id="LC10" class="line" lang="plaintext"></blockquote></span></code></pre> +<span id="LC5" class="line" lang="plaintext"></blockquote></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10682:1-10687:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong> &lt;title> &lt;style> <em></p></span> +<span id="LC2" class="line" lang="plaintext"><blockquote></span> +<span id="LC3" class="line" lang="plaintext"> &lt;xmp> is disallowed. &lt;XMP> is also disallowed.</span> +<span id="LC4" class="line" lang="plaintext"></blockquote></span></code></pre> <copy-code></copy-code> </div> </div> -<h2 data-sourcepos="9385:1-9385:19" dir="auto"> +<h2 data-sourcepos="10691:1-10691:19" dir="auto"> <a id="user-content-hard-line-breaks" class="anchor" href="#hard-line-breaks" aria-hidden="true"></a>Hard line breaks</h2> -<p data-sourcepos="9387:1-9390:27" dir="auto">A line break (not in a code span or HTML tag) that is preceded +<p data-sourcepos="10693:1-10696:27" dir="auto">A line break (not in a code span or HTML tag) that is preceded by two or more spaces and does not occur at the end of a block is parsed as a <a href="@">hard line break</a> (rendered in HTML as a <code><br /></code> tag):</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9392:1-9398:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo </span> -<span id="LC2" class="line" lang="plaintext">baz</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>foo<br /></span> -<span id="LC5" class="line" lang="plaintext">baz</p></span></code></pre> +<pre data-sourcepos="10698:1-10701:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo </span> +<span id="LC2" class="line" lang="plaintext">baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10703:1-10706:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo<br /></span> +<span id="LC2" class="line" lang="plaintext">baz</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9401:1-9402:48" dir="auto">For a more visible alternative, a backslash before the +<p data-sourcepos="10709:1-10710:48" dir="auto">For a more visible alternative, a backslash before the [line ending] may be used instead of two spaces:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9404:1-9410:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo\</span> -<span id="LC2" class="line" lang="plaintext">baz</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>foo<br /></span> -<span id="LC5" class="line" lang="plaintext">baz</p></span></code></pre> +<pre data-sourcepos="10712:1-10715:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo\</span> +<span id="LC2" class="line" lang="plaintext">baz</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9413:1-9413:33" dir="auto">More than two spaces can be used:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9415:1-9421:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo </span> -<span id="LC2" class="line" lang="plaintext">baz</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>foo<br /></span> -<span id="LC5" class="line" lang="plaintext">baz</p></span></code></pre> +<pre data-sourcepos="10717:1-10720:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo<br /></span> +<span id="LC2" class="line" lang="plaintext">baz</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="10723:1-10723:33" dir="auto">More than two spaces can be used:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10725:1-10728:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo </span> +<span id="LC2" class="line" lang="plaintext">baz</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9424:1-9424:61" dir="auto">Leading spaces at the beginning of the next line are ignored:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9426:1-9432:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo </span> -<span id="LC2" class="line" lang="plaintext"> bar</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>foo<br /></span> -<span id="LC5" class="line" lang="plaintext">bar</p></span></code></pre> +<pre data-sourcepos="10730:1-10733:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo<br /></span> +<span id="LC2" class="line" lang="plaintext">baz</p></span></code></pre> <copy-code></copy-code> </div> +<p data-sourcepos="10736:1-10736:61" dir="auto">Leading spaces at the beginning of the next line are ignored:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9435:1-9441:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo\</span> -<span id="LC2" class="line" lang="plaintext"> bar</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>foo<br /></span> -<span id="LC5" class="line" lang="plaintext">bar</p></span></code></pre> +<pre data-sourcepos="10738:1-10741:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo </span> +<span id="LC2" class="line" lang="plaintext"> bar</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9444:1-9445:26" dir="auto">Line breaks can occur inside emphasis, links, and other constructs +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10743:1-10746:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo<br /></span> +<span id="LC2" class="line" lang="plaintext">bar</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10749:1-10752:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo\</span> +<span id="LC2" class="line" lang="plaintext"> bar</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10754:1-10757:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo<br /></span> +<span id="LC2" class="line" lang="plaintext">bar</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="10760:1-10761:26" dir="auto">Line breaks can occur inside emphasis, links, and other constructs that allow inline content:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9447:1-9453:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo </span> -<span id="LC2" class="line" lang="plaintext">bar*</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p><em>foo<br /></span> -<span id="LC5" class="line" lang="plaintext">bar</em></p></span></code></pre> +<pre data-sourcepos="10763:1-10766:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo </span> +<span id="LC2" class="line" lang="plaintext">bar*</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10768:1-10771:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo<br /></span> +<span id="LC2" class="line" lang="plaintext">bar</em></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10774:1-10777:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo\</span> +<span id="LC2" class="line" lang="plaintext">bar*</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10779:1-10782:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>foo<br /></span> +<span id="LC2" class="line" lang="plaintext">bar</em></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="10785:1-10785:42" dir="auto">Line breaks do not occur inside code spans</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10787:1-10790:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`code </span> +<span id="LC2" class="line" lang="plaintext">span`</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10792:1-10794:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>code span</code></p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10797:1-10800:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`code\</span> +<span id="LC2" class="line" lang="plaintext">span`</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9456:1-9462:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">*foo\</span> -<span id="LC2" class="line" lang="plaintext">bar*</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p><em>foo<br /></span> -<span id="LC5" class="line" lang="plaintext">bar</em></p></span></code></pre> +<pre data-sourcepos="10802:1-10804:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>code\ span</code></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9465:1-9465:42" dir="auto">Line breaks do not occur inside code spans</p> +<p data-sourcepos="10807:1-10807:13" dir="auto">or HTML tags:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9467:1-9472:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`code </span> -<span id="LC2" class="line" lang="plaintext">span`</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p><code>code span</code></p></span></code></pre> +<pre data-sourcepos="10809:1-10812:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="foo </span> +<span id="LC2" class="line" lang="plaintext">bar"></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9475:1-9480:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`code\</span> -<span id="LC2" class="line" lang="plaintext">span`</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p><code>code\ span</code></p></span></code></pre> +<pre data-sourcepos="10814:1-10817:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="foo </span> +<span id="LC2" class="line" lang="plaintext">bar"></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9483:1-9483:13" dir="auto">or HTML tags:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9485:1-9491:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="foo </span> -<span id="LC2" class="line" lang="plaintext">bar"></span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p><a href="foo </span> -<span id="LC5" class="line" lang="plaintext">bar"></p></span></code></pre> +<pre data-sourcepos="10820:1-10823:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="foo\</span> +<span id="LC2" class="line" lang="plaintext">bar"></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9494:1-9500:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="foo\</span> -<span id="LC2" class="line" lang="plaintext">bar"></span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p><a href="foo\</span> -<span id="LC5" class="line" lang="plaintext">bar"></p></span></code></pre> +<pre data-sourcepos="10825:1-10828:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="foo\</span> +<span id="LC2" class="line" lang="plaintext">bar"></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9503:1-9505:20" dir="auto">Hard line breaks are for separating inline content within a block. +<p data-sourcepos="10831:1-10833:20" dir="auto">Hard line breaks are for separating inline content within a block. Neither syntax for hard line breaks works at the end of a paragraph or other block element:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9507:1-9511:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo\</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo\</p></span></code></pre> +<pre data-sourcepos="10835:1-10837:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo\</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10839:1-10841:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo\</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10844:1-10846:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo </span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10848:1-10850:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo</p></span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10853:1-10855:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">### foo\</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9514:1-9518:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo </span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>foo</p></span></code></pre> +<pre data-sourcepos="10857:1-10859:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h3>foo\</h3></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9521:1-9525:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">### foo\</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><h3>foo\</h3></span></code></pre> +<pre data-sourcepos="10862:1-10864:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">### foo </span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9528:1-9532:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">### foo </span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><h3>foo</h3></span></code></pre> +<pre data-sourcepos="10866:1-10868:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h3>foo</h3></span></code></pre> <copy-code></copy-code> </div> -<h2 data-sourcepos="9535:1-9535:19" dir="auto"> +<h2 data-sourcepos="10871:1-10871:19" dir="auto"> <a id="user-content-soft-line-breaks" class="anchor" href="#soft-line-breaks" aria-hidden="true"></a>Soft line breaks</h2> -<p data-sourcepos="9537:1-9541:62" dir="auto">A regular line break (not in a code span or HTML tag) that is not +<p data-sourcepos="10873:1-10877:62" dir="auto">A regular line break (not in a code span or HTML tag) that is not preceded by two or more spaces or a backslash is parsed as a <a href="@">softbreak</a>. (A softbreak may be rendered in HTML either as a [line ending] or as a space. The result will be the same in browsers. In the examples here, a [line ending] will be used.)</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9543:1-9549:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span> -<span id="LC2" class="line" lang="plaintext">baz</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>foo</span> -<span id="LC5" class="line" lang="plaintext">baz</p></span></code></pre> +<pre data-sourcepos="10879:1-10882:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span> +<span id="LC2" class="line" lang="plaintext">baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10884:1-10887:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo</span> +<span id="LC2" class="line" lang="plaintext">baz</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9552:1-9553:8" dir="auto">Spaces at the end of the line and beginning of the next line are +<p data-sourcepos="10890:1-10891:8" dir="auto">Spaces at the end of the line and beginning of the next line are removed:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9555:1-9561:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo </span> -<span id="LC2" class="line" lang="plaintext"> baz</span> -<span id="LC3" class="line" lang="plaintext">.</span> -<span id="LC4" class="line" lang="plaintext"><p>foo</span> -<span id="LC5" class="line" lang="plaintext">baz</p></span></code></pre> +<pre data-sourcepos="10893:1-10896:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo </span> +<span id="LC2" class="line" lang="plaintext"> baz</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10898:1-10901:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo</span> +<span id="LC2" class="line" lang="plaintext">baz</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9564:1-9565:25" dir="auto">A conforming parser may render a soft line break in HTML either as a +<p data-sourcepos="10904:1-10905:25" dir="auto">A conforming parser may render a soft line break in HTML either as a line break or as a space.</p> -<p data-sourcepos="9567:1-9568:20" dir="auto">A renderer may also provide an option to render soft line breaks +<p data-sourcepos="10907:1-10908:20" dir="auto">A renderer may also provide an option to render soft line breaks as hard line breaks.</p> -<h2 data-sourcepos="9570:1-9570:18" dir="auto"> +<h2 data-sourcepos="10910:1-10910:18" dir="auto"> <a id="user-content-textual-content" class="anchor" href="#textual-content" aria-hidden="true"></a>Textual content</h2> -<p data-sourcepos="9572:1-9573:35" dir="auto">Any characters not given an interpretation by the above rules will +<p data-sourcepos="10912:1-10913:35" dir="auto">Any characters not given an interpretation by the above rules will be parsed as plain textual content.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9575:1-9579:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">hello $.;'there</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>hello $.;'there</p></span></code></pre> +<pre data-sourcepos="10915:1-10917:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">hello $.;'there</span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9582:1-9586:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo χρῆν</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>Foo χρῆν</p></span></code></pre> +<pre data-sourcepos="10919:1-10921:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>hello $.;'there</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9589:1-9589:39" dir="auto">Internal spaces are preserved verbatim:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9591:1-9595:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Multiple spaces</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>Multiple spaces</p></span></code></pre> +<pre data-sourcepos="10924:1-10926:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Foo χρῆν</span></code></pre> <copy-code></copy-code> </div> -<h1 data-sourcepos="9598:1-9598:40" dir="auto"> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10928:1-10930:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo χρῆν</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="10933:1-10933:39" dir="auto">Internal spaces are preserved verbatim:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10935:1-10937:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Multiple spaces</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10939:1-10941:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Multiple spaces</p></span></code></pre> +<copy-code></copy-code> +</div> +<h1 data-sourcepos="10944:1-10944:40" dir="auto"> <a id="user-content-gitlab-official-specification-markdown" class="anchor" href="#gitlab-official-specification-markdown" aria-hidden="true"></a>GitLab Official Specification Markdown</h1> -<p data-sourcepos="9600:1-9603:104" dir="auto">Currently, only some of the GitLab-specific markdown features are +<p data-sourcepos="10946:1-10949:104" dir="auto">Currently, only some of the GitLab-specific markdown features are listed in this section. We may eventually add all GitLab-specific features currently listed as supported in the <a href="https://docs.gitlab.com/ee/user/markdown.html" rel="nofollow noreferrer noopener" target="_blank">user-facing documentation for GitLab Flavored Markdown</a>.</p> -<p data-sourcepos="9605:1-9606:69" dir="auto">There is currently only this single top-level heading, but the +<p data-sourcepos="10951:1-10952:69" dir="auto">There is currently only this single top-level heading, but the examples may be split into multiple top-level headings in the future.</p> -<h2 data-sourcepos="9608:1-9608:12" dir="auto"> +<h2 data-sourcepos="10954:1-10954:12" dir="auto"> <a id="user-content-footnotes" class="anchor" href="#footnotes" aria-hidden="true"></a>Footnotes</h2> -<p data-sourcepos="9610:1-9611:143" dir="auto">See +<p data-sourcepos="10956:1-10957:143" dir="auto">See <a href="https://docs.gitlab.com/ee/user/markdown.html#footnotes" rel="nofollow noreferrer noopener" target="_blank">the footnotes section of the user-facing documentation for GitLab Flavored Markdown</a>.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9613:1-9637:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">footnote reference tag [^fortytwo]</span> -<span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[^fortytwo]: footnote text</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p></span> -<span id="LC6" class="line" lang="plaintext">footnote reference tag</span> -<span id="LC7" class="line" lang="plaintext"><sup></span> -<span id="LC8" class="line" lang="plaintext"><a href="#fn-fortytwo-42" id="fnref-fortytwo-42" data-footnote-ref></span> -<span id="LC9" class="line" lang="plaintext">1</span> -<span id="LC10" class="line" lang="plaintext"></a></span> -<span id="LC11" class="line" lang="plaintext"></sup></span> -<span id="LC12" class="line" lang="plaintext"></p></span> -<span id="LC13" class="line" lang="plaintext"><section data-footnotes></span> -<span id="LC14" class="line" lang="plaintext"><ol></span> -<span id="LC15" class="line" lang="plaintext"><li id="fn-fortytwo-42"></span> -<span id="LC16" class="line" lang="plaintext"><p></span> -<span id="LC17" class="line" lang="plaintext">footnote text</span> -<span id="LC18" class="line" lang="plaintext"><a href="#fnref-fortytwo-42" data-footnote-backref></span> -<span id="LC19" class="line" lang="plaintext"></a></span> -<span id="LC20" class="line" lang="plaintext"></p></span> -<span id="LC21" class="line" lang="plaintext"></li></span> -<span id="LC22" class="line" lang="plaintext"></ol></span> -<span id="LC23" class="line" lang="plaintext"></section></span></code></pre> -<copy-code></copy-code> -</div> -<h2 data-sourcepos="9639:1-9639:18" dir="auto"> +<pre data-sourcepos="10959:1-10963:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">footnote reference tag [^fortytwo]</span> +<span id="LC2" class="line" lang="plaintext"></span> +<span id="LC3" class="line" lang="plaintext">[^fortytwo]: footnote text</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="10965:1-10985:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p></span> +<span id="LC2" class="line" lang="plaintext">footnote reference tag</span> +<span id="LC3" class="line" lang="plaintext"><sup></span> +<span id="LC4" class="line" lang="plaintext"><a href="#fn-fortytwo-42" id="fnref-fortytwo-42" data-footnote-ref></span> +<span id="LC5" class="line" lang="plaintext">1</span> +<span id="LC6" class="line" lang="plaintext"></a></span> +<span id="LC7" class="line" lang="plaintext"></sup></span> +<span id="LC8" class="line" lang="plaintext"></p></span> +<span id="LC9" class="line" lang="plaintext"><section data-footnotes></span> +<span id="LC10" class="line" lang="plaintext"><ol></span> +<span id="LC11" class="line" lang="plaintext"><li id="fn-fortytwo-42"></span> +<span id="LC12" class="line" lang="plaintext"><p></span> +<span id="LC13" class="line" lang="plaintext">footnote text</span> +<span id="LC14" class="line" lang="plaintext"><a href="#fnref-fortytwo-42" data-footnote-backref></span> +<span id="LC15" class="line" lang="plaintext"></a></span> +<span id="LC16" class="line" lang="plaintext"></p></span> +<span id="LC17" class="line" lang="plaintext"></li></span> +<span id="LC18" class="line" lang="plaintext"></ol></span> +<span id="LC19" class="line" lang="plaintext"></section></span></code></pre> +<copy-code></copy-code> +</div> +<h2 data-sourcepos="10987:1-10987:18" dir="auto"> <a id="user-content-task-list-items" class="anchor" href="#task-list-items" aria-hidden="true"></a>Task list items</h2> -<p data-sourcepos="9641:1-9642:117" dir="auto">See +<p data-sourcepos="10989:1-10990:117" dir="auto">See <a href="https://docs.gitlab.com/ee/user/markdown.html#task-lists" rel="nofollow noreferrer noopener" target="_blank">Task lists</a> in the GitLab Flavored Markdown documentation.</p> -<p data-sourcepos="9644:1-9647:39" dir="auto">Task list items (checkboxes) are defined as a GitHub Flavored Markdown extension in a section above. +<p data-sourcepos="10992:1-10995:39" dir="auto">Task list items (checkboxes) are defined as a GitHub Flavored Markdown extension in a section above. GitLab extends the behavior of task list items to support additional features. Some of these features are in-progress, and should not yet be considered part of the official GitLab Flavored Markdown specification.</p> -<p data-sourcepos="9649:1-9649:85" dir="auto">Some of the behavior of task list items is implemented as client-side JavaScript/CSS.</p> -<p data-sourcepos="9651:1-9651:80" dir="auto">The following are some basic examples; more examples may be added in the future.</p> -<p data-sourcepos="9653:1-9653:16" dir="auto">Incomplete task:</p> +<p data-sourcepos="10997:1-10997:85" dir="auto">Some of the behavior of task list items is implemented as client-side JavaScript/CSS.</p> +<p data-sourcepos="10999:1-10999:80" dir="auto">The following are some basic examples; more examples may be added in the future.</p> +<p data-sourcepos="11001:1-11001:16" dir="auto">Incomplete task:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9655:1-9665:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [ ] incomplete</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><ul></span> -<span id="LC4" class="line" lang="plaintext"><li></span> -<span id="LC5" class="line" lang="plaintext"><task-button/></span> -<span id="LC6" class="line" lang="plaintext"><input type="checkbox" disabled/></span> -<span id="LC7" class="line" lang="plaintext">incomplete</span> -<span id="LC8" class="line" lang="plaintext"></li></span> -<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre> +<pre data-sourcepos="11003:1-11005:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [ ] incomplete</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9667:1-9667:15" dir="auto">Completed task:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9669:1-9679:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [x] completed</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><ul></span> -<span id="LC4" class="line" lang="plaintext"><li></span> -<span id="LC5" class="line" lang="plaintext"><task-button/></span> -<span id="LC6" class="line" lang="plaintext"><input type="checkbox" checked disabled/></span> -<span id="LC7" class="line" lang="plaintext">completed</span> -<span id="LC8" class="line" lang="plaintext"></li></span> -<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre> +<pre data-sourcepos="11007:1-11015:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><task-button/></span> +<span id="LC4" class="line" lang="plaintext"><input type="checkbox" disabled/></span> +<span id="LC5" class="line" lang="plaintext">incomplete</span> +<span id="LC6" class="line" lang="plaintext"></li></span> +<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9681:1-9681:18" dir="auto">Inapplicable task:</p> +<p data-sourcepos="11017:1-11017:15" dir="auto">Completed task:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9683:1-9695:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [~] inapplicable</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><ul></span> -<span id="LC4" class="line" lang="plaintext"><li></span> -<span id="LC5" class="line" lang="plaintext"><task-button/></span> -<span id="LC6" class="line" lang="plaintext"><input type="checkbox" data-inapplicable disabled></span> -<span id="LC7" class="line" lang="plaintext"><s></span> -<span id="LC8" class="line" lang="plaintext">inapplicable</span> -<span id="LC9" class="line" lang="plaintext"></s></span> -<span id="LC10" class="line" lang="plaintext"></li></span> -<span id="LC11" class="line" lang="plaintext"></ul></span></code></pre> +<pre data-sourcepos="11019:1-11021:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [x] completed</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="11023:1-11031:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><task-button/></span> +<span id="LC4" class="line" lang="plaintext"><input type="checkbox" checked disabled/></span> +<span id="LC5" class="line" lang="plaintext">completed</span> +<span id="LC6" class="line" lang="plaintext"></li></span> +<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="11033:1-11033:18" dir="auto">Inapplicable task:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="11035:1-11037:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [~] inapplicable</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="11039:1-11049:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><task-button/></span> +<span id="LC4" class="line" lang="plaintext"><input type="checkbox" data-inapplicable disabled></span> +<span id="LC5" class="line" lang="plaintext"><s></span> +<span id="LC6" class="line" lang="plaintext">inapplicable</span> +<span id="LC7" class="line" lang="plaintext"></s></span> +<span id="LC8" class="line" lang="plaintext"></li></span> +<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9697:1-9698:50" dir="auto">Inapplicable task in a "loose" list. Note that the <code><del></code> tag is not applied to the +<p data-sourcepos="11051:1-11052:50" dir="auto">Inapplicable task in a "loose" list. Note that the <code><del></code> tag is not applied to the loose text; it has strikethrough applied with CSS.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9700:1-9719:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [~] inapplicable</span> +<pre data-sourcepos="11054:1-11058:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [~] inapplicable</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext"> text in loose list</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><ul></span> -<span id="LC6" class="line" lang="plaintext"><li></span> -<span id="LC7" class="line" lang="plaintext"><p></span> -<span id="LC8" class="line" lang="plaintext"><task-button/></span> -<span id="LC9" class="line" lang="plaintext"><input type="checkbox" data-inapplicable disabled></span> -<span id="LC10" class="line" lang="plaintext"><s></span> -<span id="LC11" class="line" lang="plaintext">inapplicable</span> -<span id="LC12" class="line" lang="plaintext"></s></span> -<span id="LC13" class="line" lang="plaintext"></p></span> -<span id="LC14" class="line" lang="plaintext"><p></span> -<span id="LC15" class="line" lang="plaintext">text in loose list</span> -<span id="LC16" class="line" lang="plaintext"></p></span> -<span id="LC17" class="line" lang="plaintext"></li></span> -<span id="LC18" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> text in loose list</span></code></pre> <copy-code></copy-code> </div> -<h2 data-sourcepos="9721:1-9721:15" dir="auto"> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="11060:1-11075:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p></span> +<span id="LC4" class="line" lang="plaintext"><task-button/></span> +<span id="LC5" class="line" lang="plaintext"><input type="checkbox" data-inapplicable disabled></span> +<span id="LC6" class="line" lang="plaintext"><s></span> +<span id="LC7" class="line" lang="plaintext">inapplicable</span> +<span id="LC8" class="line" lang="plaintext"></s></span> +<span id="LC9" class="line" lang="plaintext"></p></span> +<span id="LC10" class="line" lang="plaintext"><p></span> +<span id="LC11" class="line" lang="plaintext">text in loose list</span> +<span id="LC12" class="line" lang="plaintext"></p></span> +<span id="LC13" class="line" lang="plaintext"></li></span> +<span id="LC14" class="line" lang="plaintext"></ul></span></code></pre> +<copy-code></copy-code> +</div> +<h2 data-sourcepos="11077:1-11077:15" dir="auto"> <a id="user-content-front-matter" class="anchor" href="#front-matter" aria-hidden="true"></a>Front matter</h2> -<p data-sourcepos="9723:1-9724:121" dir="auto">See +<p data-sourcepos="11079:1-11080:121" dir="auto">See <a href="https://docs.gitlab.com/ee/user/markdown.html#front-matter" rel="nofollow noreferrer noopener" target="_blank">Front matter</a> in the GitLab Flavored Markdown documentation.</p> -<p data-sourcepos="9726:1-9727:95" dir="auto">Front matter is metadata included at the beginning of a Markdown document, preceding the content. +<p data-sourcepos="11082:1-11083:95" dir="auto">Front matter is metadata included at the beginning of a Markdown document, preceding the content. This data can be used by static site generators like Jekyll, Hugo, and many other applications.</p> -<p data-sourcepos="9729:1-9729:18" dir="auto">YAML front matter:</p> +<p data-sourcepos="11085:1-11085:18" dir="auto">YAML front matter:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9731:1-9741:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">---</span> +<pre data-sourcepos="11087:1-11091:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">---</span> <span id="LC2" class="line" lang="plaintext">title: YAML front matter</span> -<span id="LC3" class="line" lang="plaintext">---</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><pre></span> -<span id="LC6" class="line" lang="plaintext"><code></span> -<span id="LC7" class="line" lang="plaintext">title: YAML front matter</span> -<span id="LC8" class="line" lang="plaintext"></code></span> -<span id="LC9" class="line" lang="plaintext"></pre></span></code></pre> +<span id="LC3" class="line" lang="plaintext">---</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9743:1-9743:18" dir="auto">TOML front matter:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9745:1-9755:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">+++</span> +<pre data-sourcepos="11093:1-11099:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre></span> +<span id="LC2" class="line" lang="plaintext"><code></span> +<span id="LC3" class="line" lang="plaintext">title: YAML front matter</span> +<span id="LC4" class="line" lang="plaintext"></code></span> +<span id="LC5" class="line" lang="plaintext"></pre></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="11101:1-11101:18" dir="auto">TOML front matter:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="11103:1-11107:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">+++</span> <span id="LC2" class="line" lang="plaintext">title: TOML front matter</span> -<span id="LC3" class="line" lang="plaintext">+++</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><pre></span> -<span id="LC6" class="line" lang="plaintext"><code></span> -<span id="LC7" class="line" lang="plaintext">title: TOML front matter</span> -<span id="LC8" class="line" lang="plaintext"></code></span> -<span id="LC9" class="line" lang="plaintext"></pre></span></code></pre> +<span id="LC3" class="line" lang="plaintext">+++</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="11109:1-11115:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre></span> +<span id="LC2" class="line" lang="plaintext"><code></span> +<span id="LC3" class="line" lang="plaintext">title: TOML front matter</span> +<span id="LC4" class="line" lang="plaintext"></code></span> +<span id="LC5" class="line" lang="plaintext"></pre></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9757:1-9757:18" dir="auto">JSON front matter:</p> +<p data-sourcepos="11117:1-11117:18" dir="auto">JSON front matter:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9759:1-9773:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">;;;</span> +<pre data-sourcepos="11119:1-11125:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">;;;</span> <span id="LC2" class="line" lang="plaintext">{</span> <span id="LC3" class="line" lang="plaintext"> "title": "JSON front matter"</span> <span id="LC4" class="line" lang="plaintext">}</span> -<span id="LC5" class="line" lang="plaintext">;;;</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><pre></span> -<span id="LC8" class="line" lang="plaintext"><code></span> -<span id="LC9" class="line" lang="plaintext">{</span> -<span id="LC10" class="line" lang="plaintext"> "title": "JSON front matter"</span> -<span id="LC11" class="line" lang="plaintext">}</span> -<span id="LC12" class="line" lang="plaintext"></code></span> -<span id="LC13" class="line" lang="plaintext"></pre></span></code></pre> +<span id="LC5" class="line" lang="plaintext">;;;</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="11127:1-11135:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre></span> +<span id="LC2" class="line" lang="plaintext"><code></span> +<span id="LC3" class="line" lang="plaintext">{</span> +<span id="LC4" class="line" lang="plaintext"> "title": "JSON front matter"</span> +<span id="LC5" class="line" lang="plaintext">}</span> +<span id="LC6" class="line" lang="plaintext"></code></span> +<span id="LC7" class="line" lang="plaintext"></pre></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9775:1-9775:66" dir="auto">Front matter blocks should be inserted at the top of the document:</p> +<p data-sourcepos="11137:1-11137:66" dir="auto">Front matter blocks should be inserted at the top of the document:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9777:1-9787:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">text</span> +<pre data-sourcepos="11139:1-11145:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">text</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext">---</span> <span id="LC4" class="line" lang="plaintext">title: YAML front matter</span> -<span id="LC5" class="line" lang="plaintext">---</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><p>text</p></span> -<span id="LC8" class="line" lang="plaintext"><hr></span> -<span id="LC9" class="line" lang="plaintext"><h2>title: YAML front matter</h2></span></code></pre> +<span id="LC5" class="line" lang="plaintext">---</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9789:1-9789:74" dir="auto">Front matter block delimiters shouldn’t be preceded by space characters:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9791:1-9798:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ---</span> +<pre data-sourcepos="11147:1-11151:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>text</p></span> +<span id="LC2" class="line" lang="plaintext"><hr></span> +<span id="LC3" class="line" lang="plaintext"><h2>title: YAML front matter</h2></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="11153:1-11153:74" dir="auto">Front matter block delimiters shouldn’t be preceded by space characters:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="11155:1-11159:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ---</span> <span id="LC2" class="line" lang="plaintext">title: YAML front matter</span> -<span id="LC3" class="line" lang="plaintext">---</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><hr></span> -<span id="LC6" class="line" lang="plaintext"><h2>title: YAML front matter</h2></span></code></pre> +<span id="LC3" class="line" lang="plaintext">---</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="11161:1-11164:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr></span> +<span id="LC2" class="line" lang="plaintext"><h2>title: YAML front matter</h2></span></code></pre> <copy-code></copy-code> </div> -<h2 data-sourcepos="9800:1-9800:20" dir="auto"> +<h2 data-sourcepos="11166:1-11166:20" dir="auto"> <a id="user-content-table-of-contents" class="anchor" href="#table-of-contents" aria-hidden="true"></a>Table of contents</h2> -<p data-sourcepos="9802:1-9804:46" dir="auto">See +<p data-sourcepos="11168:1-11170:46" dir="auto">See <a href="https://docs.gitlab.com/ee/user/markdown.html#table-of-contents" rel="nofollow noreferrer noopener" target="_blank">table of contents</a> in the GitLab Flavored Markdown documentation.</p> -<p data-sourcepos="9806:1-9807:58" dir="auto">A table of contents is an unordered list that links to subheadings in the document. +<p data-sourcepos="11172:1-11173:58" dir="auto">A table of contents is an unordered list that links to subheadings in the document. Add either the <code>[[_TOC_]]</code> or </p><ul class="section-nav"> <li> <a href="#preliminaries">Preliminaries</a><ul> @@ -8686,164 +10054,192 @@ Add either the <code>[[_TOC_]]</code> or </p><ul class="section-nav"> </li> </ul> tag on its own line. <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9809:1-9826:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[TOC]</span> +<pre data-sourcepos="11175:1-11181:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[TOC]</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext"># Heading 1</span> <span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext">## Heading 2</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><nav></span> -<span id="LC8" class="line" lang="plaintext"> <ul></span> -<span id="LC9" class="line" lang="plaintext"> <li><a href="#heading-1">Heading 1</a></li></span> -<span id="LC10" class="line" lang="plaintext"> <ul></span> -<span id="LC11" class="line" lang="plaintext"> <li><a href="#heading-2">Heading 2</a></li></span> -<span id="LC12" class="line" lang="plaintext"> </ul></span> -<span id="LC13" class="line" lang="plaintext"> </ul></span> -<span id="LC14" class="line" lang="plaintext"></nav></span> -<span id="LC15" class="line" lang="plaintext"><h1>Heading 1</h1></span> -<span id="LC16" class="line" lang="plaintext"><h2>Heading 2</h2></span></code></pre> +<span id="LC5" class="line" lang="plaintext">## Heading 2</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="11183:1-11194:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><nav></span> +<span id="LC2" class="line" lang="plaintext"> <ul></span> +<span id="LC3" class="line" lang="plaintext"> <li><a href="#heading-1">Heading 1</a></li></span> +<span id="LC4" class="line" lang="plaintext"> <ul></span> +<span id="LC5" class="line" lang="plaintext"> <li><a href="#heading-2">Heading 2</a></li></span> +<span id="LC6" class="line" lang="plaintext"> </ul></span> +<span id="LC7" class="line" lang="plaintext"> </ul></span> +<span id="LC8" class="line" lang="plaintext"></nav></span> +<span id="LC9" class="line" lang="plaintext"><h1>Heading 1</h1></span> +<span id="LC10" class="line" lang="plaintext"><h2>Heading 2</h2></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9828:1-9845:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[[_TOC_]]</span> +<pre data-sourcepos="11196:1-11202:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[[_TOC_]]</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext"># Heading 1</span> <span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext">## Heading 2</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><nav></span> -<span id="LC8" class="line" lang="plaintext"> <ul></span> -<span id="LC9" class="line" lang="plaintext"> <li><a href="#heading-1">Heading 1</a></li></span> -<span id="LC10" class="line" lang="plaintext"> <ul></span> -<span id="LC11" class="line" lang="plaintext"> <li><a href="#heading-2">Heading 2</a></li></span> -<span id="LC12" class="line" lang="plaintext"> </ul></span> -<span id="LC13" class="line" lang="plaintext"> </ul></span> -<span id="LC14" class="line" lang="plaintext"></nav></span> -<span id="LC15" class="line" lang="plaintext"><h1>Heading 1</h1></span> -<span id="LC16" class="line" lang="plaintext"><h2>Heading 2</h2></span></code></pre> -<copy-code></copy-code> -</div> -<p data-sourcepos="9847:1-9848:5" dir="auto">A table of contents is a block element. It should preceded and followed by a blank +<span id="LC5" class="line" lang="plaintext">## Heading 2</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="11204:1-11215:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><nav></span> +<span id="LC2" class="line" lang="plaintext"> <ul></span> +<span id="LC3" class="line" lang="plaintext"> <li><a href="#heading-1">Heading 1</a></li></span> +<span id="LC4" class="line" lang="plaintext"> <ul></span> +<span id="LC5" class="line" lang="plaintext"> <li><a href="#heading-2">Heading 2</a></li></span> +<span id="LC6" class="line" lang="plaintext"> </ul></span> +<span id="LC7" class="line" lang="plaintext"> </ul></span> +<span id="LC8" class="line" lang="plaintext"></nav></span> +<span id="LC9" class="line" lang="plaintext"><h1>Heading 1</h1></span> +<span id="LC10" class="line" lang="plaintext"><h2>Heading 2</h2></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="11217:1-11218:5" dir="auto">A table of contents is a block element. It should preceded and followed by a blank line.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9850:1-9859:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[[_TOC_]]</span> +<pre data-sourcepos="11220:1-11226:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[[_TOC_]]</span> <span id="LC2" class="line" lang="plaintext">text</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext">text</span> -<span id="LC5" class="line" lang="plaintext">[TOC]</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><p>[[<em>TOC</em>]]text</p></span> -<span id="LC8" class="line" lang="plaintext"><p>text[TOC]</p></span></code></pre> +<span id="LC5" class="line" lang="plaintext">[TOC]</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="11228:1-11231:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[[<em>TOC</em>]]text</p></span> +<span id="LC2" class="line" lang="plaintext"><p>text[TOC]</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9861:1-9861:60" dir="auto">A table of contents can be indented with up to three spaces.</p> +<p data-sourcepos="11233:1-11233:60" dir="auto">A table of contents can be indented with up to three spaces.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9863:1-9874:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> [[_TOC_]]</span> +<pre data-sourcepos="11235:1-11239:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> [[_TOC_]]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext"># Heading 1</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><nav></span> -<span id="LC6" class="line" lang="plaintext"> <ul></span> -<span id="LC7" class="line" lang="plaintext"> <li><a href="#heading-1">Heading 1</a></li></span> -<span id="LC8" class="line" lang="plaintext"> </ul></span> -<span id="LC9" class="line" lang="plaintext"></nav></span> -<span id="LC10" class="line" lang="plaintext"><h1>Heading 1</h1></span></code></pre> +<span id="LC3" class="line" lang="plaintext"># Heading 1</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="11241:1-11248:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><nav></span> +<span id="LC2" class="line" lang="plaintext"> <ul></span> +<span id="LC3" class="line" lang="plaintext"> <li><a href="#heading-1">Heading 1</a></li></span> +<span id="LC4" class="line" lang="plaintext"> </ul></span> +<span id="LC5" class="line" lang="plaintext"></nav></span> +<span id="LC6" class="line" lang="plaintext"><h1>Heading 1</h1></span></code></pre> <copy-code></copy-code> </div> -<h1 data-sourcepos="9876:1-9876:36" dir="auto"> +<h1 data-sourcepos="11250:1-11250:36" dir="auto"> <a id="user-content-gitlab-internal-extension-markdown" class="anchor" href="#gitlab-internal-extension-markdown" aria-hidden="true"></a>GitLab Internal Extension Markdown</h1> -<h2 data-sourcepos="9878:1-9878:8" dir="auto"> +<h2 data-sourcepos="11252:1-11252:8" dir="auto"> <a id="user-content-audio" class="anchor" href="#audio" aria-hidden="true"></a>Audio</h2> -<p data-sourcepos="9880:1-9881:107" dir="auto">See +<p data-sourcepos="11254:1-11255:107" dir="auto">See <a href="https://docs.gitlab.com/ee/user/markdown.html#audio" rel="nofollow noreferrer noopener" target="_blank">audio</a> in the GitLab Flavored Markdown documentation.</p> -<p data-sourcepos="9883:1-9885:63" dir="auto">GLFM renders image elements as an audio player as long as the resource’s file extension is +<p data-sourcepos="11257:1-11259:63" dir="auto">GLFM renders image elements as an audio player as long as the resource’s file extension is one of the following supported audio extensions <code>.mp3</code>, <code>.oga</code>, <code>.ogg</code>, <code>.spx</code>, and <code>.wav</code>. Audio ignore the alternative text part of an image declaration.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9887:1-9891:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![audio](audio.oga "audio title")</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><audio src="audio.oga" title="audio title"></audio></p></span></code></pre> +<pre data-sourcepos="11261:1-11263:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![audio](audio.oga "audio title")</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="11265:1-11267:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><audio src="audio.oga" title="audio title"></audio></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9893:1-9893:41" dir="auto">Reference definitions work audio as well:</p> +<p data-sourcepos="11269:1-11269:41" dir="auto">Reference definitions work audio as well:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9895:1-9901:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[audio]: audio.oga "audio title"</span> +<pre data-sourcepos="11271:1-11275:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[audio]: audio.oga "audio title"</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">![audio][audio]</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><audio src="audio.oga" title="audio title"></audio></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">![audio][audio]</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="11277:1-11279:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><audio src="audio.oga" title="audio title"></audio></p></span></code></pre> <copy-code></copy-code> </div> -<h2 data-sourcepos="9903:1-9903:8" dir="auto"> +<h2 data-sourcepos="11281:1-11281:8" dir="auto"> <a id="user-content-video" class="anchor" href="#video" aria-hidden="true"></a>Video</h2> -<p data-sourcepos="9905:1-9906:109" dir="auto">See +<p data-sourcepos="11283:1-11284:109" dir="auto">See <a href="https://docs.gitlab.com/ee/user/markdown.html#videos" rel="nofollow noreferrer noopener" target="_blank">videos</a> in the GitLab Flavored Markdown documentation.</p> -<p data-sourcepos="9908:1-9910:64" dir="auto">GLFM renders image elements as a video player as long as the resource’s file extension is +<p data-sourcepos="11286:1-11288:64" dir="auto">GLFM renders image elements as a video player as long as the resource’s file extension is one of the following supported video extensions <code>.mp4</code>, <code>.m4v</code>, <code>.mov</code>, <code>.webm</code>, and <code>.ogv</code>. Videos ignore the alternative text part of an image declaration.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9913:1-9917:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![video](video.m4v "video title")</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><video src="video.m4v" title="video title"></video></p></span></code></pre> +<pre data-sourcepos="11291:1-11293:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">![video](video.m4v "video title")</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9919:1-9919:41" dir="auto">Reference definitions work video as well:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9921:1-9927:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[video]: video.mov "video title"</span> +<pre data-sourcepos="11295:1-11297:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><video src="video.m4v" title="video title"></video></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="11299:1-11299:41" dir="auto">Reference definitions work video as well:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="11301:1-11305:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[video]: video.mov "video title"</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">![video][video]</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p><video src="video.mov" title="video title"></video></p></span></code></pre> +<span id="LC3" class="line" lang="plaintext">![video][video]</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="11307:1-11309:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><video src="video.mov" title="video title"></video></p></span></code></pre> <copy-code></copy-code> </div> -<h2 data-sourcepos="9929:1-9929:41" dir="auto"> +<h2 data-sourcepos="11311:1-11311:41" dir="auto"> <a id="user-content-markdown-preview-api-request-overrides" class="anchor" href="#markdown-preview-api-request-overrides" aria-hidden="true"></a>Markdown Preview API Request Overrides</h2> -<p data-sourcepos="9931:1-9933:42" dir="auto">This section contains examples of all controllers which use <code>PreviewMarkdown</code> module +<p data-sourcepos="11313:1-11315:42" dir="auto">This section contains examples of all controllers which use <code>PreviewMarkdown</code> module and use different <code>markdown_context_params</code>. They exercise the various <code>preview_markdown</code> endpoints via <code>glfm_example_metadata.yml</code>.</p> -<p data-sourcepos="9936:1-9936:75" dir="auto"><code>preview_markdown</code> exercising <code>groups</code> API endpoint and <code>UploadLinkFilter</code>:</p> +<p data-sourcepos="11318:1-11318:75" dir="auto"><code>preview_markdown</code> exercising <code>groups</code> API endpoint and <code>UploadLinkFilter</code>:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="11320:1-11322:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[groups-test-file](/uploads/groups-test-file)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="11324:1-11326:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="groups-test-file">groups-test-file</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="11328:1-11328:81" dir="auto"><code>preview_markdown</code> exercising <code>projects</code> API endpoint and <code>RepositoryLinkFilter</code>:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9938:1-9942:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[groups-test-file](/uploads/groups-test-file)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="groups-test-file">groups-test-file</a></p></span></code></pre> +<pre data-sourcepos="11330:1-11332:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[projects-test-file](projects-test-file)</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9944:1-9944:81" dir="auto"><code>preview_markdown</code> exercising <code>projects</code> API endpoint and <code>RepositoryLinkFilter</code>:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9946:1-9950:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[projects-test-file](projects-test-file)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="projects-test-file">projects-test-file</a></p></span></code></pre> +<pre data-sourcepos="11334:1-11336:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="projects-test-file">projects-test-file</a></p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9952:1-9952:83" dir="auto"><code>preview_markdown</code> exercising <code>projects</code> API endpoint and <code>SnippetReferenceFilter</code>:</p> +<p data-sourcepos="11338:1-11338:83" dir="auto"><code>preview_markdown</code> exercising <code>projects</code> API endpoint and <code>SnippetReferenceFilter</code>:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9954:1-9958:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">This project snippet ID reference IS filtered: $88888</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>This project snippet ID reference IS filtered: $88888</p></span></code></pre> +<pre data-sourcepos="11340:1-11342:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">This project snippet ID reference IS filtered: $88888</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9960:1-9963:50" dir="auto"><code>preview_markdown</code> exercising personal (non-project) <code>snippets</code> API endpoint. This is +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="11344:1-11346:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>This project snippet ID reference IS filtered: $88888</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="11348:1-11351:50" dir="auto"><code>preview_markdown</code> exercising personal (non-project) <code>snippets</code> API endpoint. This is only used by the comment field on personal snippets. It has no unique custom markdown extension behavior, and specifically does not render snippet references via <code>SnippetReferenceFilter</code>, even if the ID is valid.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9965:1-9969:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">This personal snippet ID reference is not filtered: $99999</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p>This personal snippet ID reference is not filtered: $99999</p></span></code></pre> +<pre data-sourcepos="11353:1-11355:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">This personal snippet ID reference is not filtered: $99999</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="11357:1-11359:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>This personal snippet ID reference is not filtered: $99999</p></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9971:1-9971:80" dir="auto"><code>preview_markdown</code> exercising project <code>wikis</code> API endpoint and <code>WikiLinkFilter</code>:</p> +<p data-sourcepos="11361:1-11361:80" dir="auto"><code>preview_markdown</code> exercising project <code>wikis</code> API endpoint and <code>WikiLinkFilter</code>:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9973:1-9977:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[project-wikis-test-file](project-wikis-test-file)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="project-wikis-test-file">project-wikis-test-file</a></p></span></code></pre> +<pre data-sourcepos="11363:1-11365:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[project-wikis-test-file](project-wikis-test-file)</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="9979:1-9980:63" dir="auto"><code>preview_markdown</code> exercising group <code>wikis</code> API endpoint and <code>WikiLinkFilter</code>. This example +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="11367:1-11369:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="project-wikis-test-file">project-wikis-test-file</a></p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="11371:1-11372:63" dir="auto"><code>preview_markdown</code> exercising group <code>wikis</code> API endpoint and <code>WikiLinkFilter</code>. This example also requires an EE license enabling the <code>group_wikis</code> feature:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9982:1-9986:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[group-wikis-test-file](group-wikis-test-file)</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><p><a href="group-wikis-test-file">group-wikis-test-file</a></p></span></code></pre> +<pre data-sourcepos="11374:1-11376:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[group-wikis-test-file](group-wikis-test-file)</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="11378:1-11380:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="group-wikis-test-file">group-wikis-test-file</a></p></span></code></pre> <copy-code></copy-code> </div> diff --git a/glfm_specification/output_spec/spec.html b/glfm_specification/output_spec/spec.html index 3a7b08e0a5e..b872de9db45 100644 --- a/glfm_specification/output_spec/spec.html +++ b/glfm_specification/output_spec/spec.html @@ -20,183 +20,203 @@ examples may be split into multiple top-level headings in the future.</p> <p data-sourcepos="22:1-23:143" dir="auto">See <a href="https://docs.gitlab.com/ee/user/markdown.html#footnotes" rel="nofollow noreferrer noopener" target="_blank">the footnotes section of the user-facing documentation for GitLab Flavored Markdown</a>.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="25:1-49:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">footnote reference tag [^fortytwo]</span> +<pre data-sourcepos="25:1-29:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">footnote reference tag [^fortytwo]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[^fortytwo]: footnote text</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><p></span> -<span id="LC6" class="line" lang="plaintext">footnote reference tag</span> -<span id="LC7" class="line" lang="plaintext"><sup></span> -<span id="LC8" class="line" lang="plaintext"><a href="#fn-fortytwo-42" id="fnref-fortytwo-42" data-footnote-ref></span> -<span id="LC9" class="line" lang="plaintext">1</span> -<span id="LC10" class="line" lang="plaintext"></a></span> -<span id="LC11" class="line" lang="plaintext"></sup></span> -<span id="LC12" class="line" lang="plaintext"></p></span> -<span id="LC13" class="line" lang="plaintext"><section data-footnotes></span> -<span id="LC14" class="line" lang="plaintext"><ol></span> -<span id="LC15" class="line" lang="plaintext"><li id="fn-fortytwo-42"></span> -<span id="LC16" class="line" lang="plaintext"><p></span> -<span id="LC17" class="line" lang="plaintext">footnote text</span> -<span id="LC18" class="line" lang="plaintext"><a href="#fnref-fortytwo-42" data-footnote-backref></span> -<span id="LC19" class="line" lang="plaintext"></a></span> -<span id="LC20" class="line" lang="plaintext"></p></span> -<span id="LC21" class="line" lang="plaintext"></li></span> -<span id="LC22" class="line" lang="plaintext"></ol></span> -<span id="LC23" class="line" lang="plaintext"></section></span></code></pre> +<span id="LC3" class="line" lang="plaintext">[^fortytwo]: footnote text</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="31:1-51:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p></span> +<span id="LC2" class="line" lang="plaintext">footnote reference tag</span> +<span id="LC3" class="line" lang="plaintext"><sup></span> +<span id="LC4" class="line" lang="plaintext"><a href="#fn-fortytwo-42" id="fnref-fortytwo-42" data-footnote-ref></span> +<span id="LC5" class="line" lang="plaintext">1</span> +<span id="LC6" class="line" lang="plaintext"></a></span> +<span id="LC7" class="line" lang="plaintext"></sup></span> +<span id="LC8" class="line" lang="plaintext"></p></span> +<span id="LC9" class="line" lang="plaintext"><section data-footnotes></span> +<span id="LC10" class="line" lang="plaintext"><ol></span> +<span id="LC11" class="line" lang="plaintext"><li id="fn-fortytwo-42"></span> +<span id="LC12" class="line" lang="plaintext"><p></span> +<span id="LC13" class="line" lang="plaintext">footnote text</span> +<span id="LC14" class="line" lang="plaintext"><a href="#fnref-fortytwo-42" data-footnote-backref></span> +<span id="LC15" class="line" lang="plaintext"></a></span> +<span id="LC16" class="line" lang="plaintext"></p></span> +<span id="LC17" class="line" lang="plaintext"></li></span> +<span id="LC18" class="line" lang="plaintext"></ol></span> +<span id="LC19" class="line" lang="plaintext"></section></span></code></pre> <copy-code></copy-code> </div> -<h2 data-sourcepos="51:1-51:18" dir="auto"> +<h2 data-sourcepos="53:1-53:18" dir="auto"> <a id="user-content-task-list-items" class="anchor" href="#task-list-items" aria-hidden="true"></a>Task list items</h2> -<p data-sourcepos="53:1-54:117" dir="auto">See +<p data-sourcepos="55:1-56:117" dir="auto">See <a href="https://docs.gitlab.com/ee/user/markdown.html#task-lists" rel="nofollow noreferrer noopener" target="_blank">Task lists</a> in the GitLab Flavored Markdown documentation.</p> -<p data-sourcepos="56:1-59:39" dir="auto">Task list items (checkboxes) are defined as a GitHub Flavored Markdown extension in a section above. +<p data-sourcepos="58:1-61:39" dir="auto">Task list items (checkboxes) are defined as a GitHub Flavored Markdown extension in a section above. GitLab extends the behavior of task list items to support additional features. Some of these features are in-progress, and should not yet be considered part of the official GitLab Flavored Markdown specification.</p> -<p data-sourcepos="61:1-61:85" dir="auto">Some of the behavior of task list items is implemented as client-side JavaScript/CSS.</p> -<p data-sourcepos="63:1-63:80" dir="auto">The following are some basic examples; more examples may be added in the future.</p> -<p data-sourcepos="65:1-65:16" dir="auto">Incomplete task:</p> +<p data-sourcepos="63:1-63:85" dir="auto">Some of the behavior of task list items is implemented as client-side JavaScript/CSS.</p> +<p data-sourcepos="65:1-65:80" dir="auto">The following are some basic examples; more examples may be added in the future.</p> +<p data-sourcepos="67:1-67:16" dir="auto">Incomplete task:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="67:1-77:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [ ] incomplete</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><ul></span> -<span id="LC4" class="line" lang="plaintext"><li></span> -<span id="LC5" class="line" lang="plaintext"><task-button/></span> -<span id="LC6" class="line" lang="plaintext"><input type="checkbox" disabled/></span> -<span id="LC7" class="line" lang="plaintext">incomplete</span> -<span id="LC8" class="line" lang="plaintext"></li></span> -<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre> +<pre data-sourcepos="69:1-71:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [ ] incomplete</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="79:1-79:15" dir="auto">Completed task:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="81:1-91:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [x] completed</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><ul></span> -<span id="LC4" class="line" lang="plaintext"><li></span> -<span id="LC5" class="line" lang="plaintext"><task-button/></span> -<span id="LC6" class="line" lang="plaintext"><input type="checkbox" checked disabled/></span> -<span id="LC7" class="line" lang="plaintext">completed</span> -<span id="LC8" class="line" lang="plaintext"></li></span> -<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre> +<pre data-sourcepos="73:1-81:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><task-button/></span> +<span id="LC4" class="line" lang="plaintext"><input type="checkbox" disabled/></span> +<span id="LC5" class="line" lang="plaintext">incomplete</span> +<span id="LC6" class="line" lang="plaintext"></li></span> +<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="93:1-93:18" dir="auto">Inapplicable task:</p> +<p data-sourcepos="83:1-83:15" dir="auto">Completed task:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="95:1-107:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [~] inapplicable</span> -<span id="LC2" class="line" lang="plaintext">.</span> -<span id="LC3" class="line" lang="plaintext"><ul></span> -<span id="LC4" class="line" lang="plaintext"><li></span> -<span id="LC5" class="line" lang="plaintext"><task-button/></span> -<span id="LC6" class="line" lang="plaintext"><input type="checkbox" data-inapplicable disabled></span> -<span id="LC7" class="line" lang="plaintext"><s></span> -<span id="LC8" class="line" lang="plaintext">inapplicable</span> -<span id="LC9" class="line" lang="plaintext"></s></span> -<span id="LC10" class="line" lang="plaintext"></li></span> -<span id="LC11" class="line" lang="plaintext"></ul></span></code></pre> +<pre data-sourcepos="85:1-87:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [x] completed</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="109:1-110:50" dir="auto">Inapplicable task in a "loose" list. Note that the <code><del></code> tag is not applied to the +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="89:1-97:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><task-button/></span> +<span id="LC4" class="line" lang="plaintext"><input type="checkbox" checked disabled/></span> +<span id="LC5" class="line" lang="plaintext">completed</span> +<span id="LC6" class="line" lang="plaintext"></li></span> +<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="99:1-99:18" dir="auto">Inapplicable task:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="101:1-103:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [~] inapplicable</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="105:1-115:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><task-button/></span> +<span id="LC4" class="line" lang="plaintext"><input type="checkbox" data-inapplicable disabled></span> +<span id="LC5" class="line" lang="plaintext"><s></span> +<span id="LC6" class="line" lang="plaintext">inapplicable</span> +<span id="LC7" class="line" lang="plaintext"></s></span> +<span id="LC8" class="line" lang="plaintext"></li></span> +<span id="LC9" class="line" lang="plaintext"></ul></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="117:1-118:50" dir="auto">Inapplicable task in a "loose" list. Note that the <code><del></code> tag is not applied to the loose text; it has strikethrough applied with CSS.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="112:1-131:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [~] inapplicable</span> +<pre data-sourcepos="120:1-124:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [~] inapplicable</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext"> text in loose list</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><ul></span> -<span id="LC6" class="line" lang="plaintext"><li></span> -<span id="LC7" class="line" lang="plaintext"><p></span> -<span id="LC8" class="line" lang="plaintext"><task-button/></span> -<span id="LC9" class="line" lang="plaintext"><input type="checkbox" data-inapplicable disabled></span> -<span id="LC10" class="line" lang="plaintext"><s></span> -<span id="LC11" class="line" lang="plaintext">inapplicable</span> -<span id="LC12" class="line" lang="plaintext"></s></span> -<span id="LC13" class="line" lang="plaintext"></p></span> -<span id="LC14" class="line" lang="plaintext"><p></span> -<span id="LC15" class="line" lang="plaintext">text in loose list</span> -<span id="LC16" class="line" lang="plaintext"></p></span> -<span id="LC17" class="line" lang="plaintext"></li></span> -<span id="LC18" class="line" lang="plaintext"></ul></span></code></pre> +<span id="LC3" class="line" lang="plaintext"> text in loose list</span></code></pre> <copy-code></copy-code> </div> -<h2 data-sourcepos="133:1-133:15" dir="auto"> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="126:1-141:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> +<span id="LC2" class="line" lang="plaintext"><li></span> +<span id="LC3" class="line" lang="plaintext"><p></span> +<span id="LC4" class="line" lang="plaintext"><task-button/></span> +<span id="LC5" class="line" lang="plaintext"><input type="checkbox" data-inapplicable disabled></span> +<span id="LC6" class="line" lang="plaintext"><s></span> +<span id="LC7" class="line" lang="plaintext">inapplicable</span> +<span id="LC8" class="line" lang="plaintext"></s></span> +<span id="LC9" class="line" lang="plaintext"></p></span> +<span id="LC10" class="line" lang="plaintext"><p></span> +<span id="LC11" class="line" lang="plaintext">text in loose list</span> +<span id="LC12" class="line" lang="plaintext"></p></span> +<span id="LC13" class="line" lang="plaintext"></li></span> +<span id="LC14" class="line" lang="plaintext"></ul></span></code></pre> +<copy-code></copy-code> +</div> +<h2 data-sourcepos="143:1-143:15" dir="auto"> <a id="user-content-front-matter" class="anchor" href="#front-matter" aria-hidden="true"></a>Front matter</h2> -<p data-sourcepos="135:1-136:121" dir="auto">See +<p data-sourcepos="145:1-146:121" dir="auto">See <a href="https://docs.gitlab.com/ee/user/markdown.html#front-matter" rel="nofollow noreferrer noopener" target="_blank">Front matter</a> in the GitLab Flavored Markdown documentation.</p> -<p data-sourcepos="138:1-139:95" dir="auto">Front matter is metadata included at the beginning of a Markdown document, preceding the content. +<p data-sourcepos="148:1-149:95" dir="auto">Front matter is metadata included at the beginning of a Markdown document, preceding the content. This data can be used by static site generators like Jekyll, Hugo, and many other applications.</p> -<p data-sourcepos="141:1-141:18" dir="auto">YAML front matter:</p> +<p data-sourcepos="151:1-151:18" dir="auto">YAML front matter:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="143:1-153:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">---</span> +<pre data-sourcepos="153:1-157:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">---</span> <span id="LC2" class="line" lang="plaintext">title: YAML front matter</span> -<span id="LC3" class="line" lang="plaintext">---</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><pre></span> -<span id="LC6" class="line" lang="plaintext"><code></span> -<span id="LC7" class="line" lang="plaintext">title: YAML front matter</span> -<span id="LC8" class="line" lang="plaintext"></code></span> -<span id="LC9" class="line" lang="plaintext"></pre></span></code></pre> +<span id="LC3" class="line" lang="plaintext">---</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="155:1-155:18" dir="auto">TOML front matter:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="157:1-167:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">+++</span> +<pre data-sourcepos="159:1-165:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre></span> +<span id="LC2" class="line" lang="plaintext"><code></span> +<span id="LC3" class="line" lang="plaintext">title: YAML front matter</span> +<span id="LC4" class="line" lang="plaintext"></code></span> +<span id="LC5" class="line" lang="plaintext"></pre></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="167:1-167:18" dir="auto">TOML front matter:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="169:1-173:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">+++</span> <span id="LC2" class="line" lang="plaintext">title: TOML front matter</span> -<span id="LC3" class="line" lang="plaintext">+++</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><pre></span> -<span id="LC6" class="line" lang="plaintext"><code></span> -<span id="LC7" class="line" lang="plaintext">title: TOML front matter</span> -<span id="LC8" class="line" lang="plaintext"></code></span> -<span id="LC9" class="line" lang="plaintext"></pre></span></code></pre> +<span id="LC3" class="line" lang="plaintext">+++</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="169:1-169:18" dir="auto">JSON front matter:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="171:1-185:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">;;;</span> +<pre data-sourcepos="175:1-181:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre></span> +<span id="LC2" class="line" lang="plaintext"><code></span> +<span id="LC3" class="line" lang="plaintext">title: TOML front matter</span> +<span id="LC4" class="line" lang="plaintext"></code></span> +<span id="LC5" class="line" lang="plaintext"></pre></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="183:1-183:18" dir="auto">JSON front matter:</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="185:1-191:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">;;;</span> <span id="LC2" class="line" lang="plaintext">{</span> <span id="LC3" class="line" lang="plaintext"> "title": "JSON front matter"</span> <span id="LC4" class="line" lang="plaintext">}</span> -<span id="LC5" class="line" lang="plaintext">;;;</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><pre></span> -<span id="LC8" class="line" lang="plaintext"><code></span> -<span id="LC9" class="line" lang="plaintext">{</span> -<span id="LC10" class="line" lang="plaintext"> "title": "JSON front matter"</span> -<span id="LC11" class="line" lang="plaintext">}</span> -<span id="LC12" class="line" lang="plaintext"></code></span> -<span id="LC13" class="line" lang="plaintext"></pre></span></code></pre> +<span id="LC5" class="line" lang="plaintext">;;;</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="193:1-201:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre></span> +<span id="LC2" class="line" lang="plaintext"><code></span> +<span id="LC3" class="line" lang="plaintext">{</span> +<span id="LC4" class="line" lang="plaintext"> "title": "JSON front matter"</span> +<span id="LC5" class="line" lang="plaintext">}</span> +<span id="LC6" class="line" lang="plaintext"></code></span> +<span id="LC7" class="line" lang="plaintext"></pre></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="187:1-187:66" dir="auto">Front matter blocks should be inserted at the top of the document:</p> +<p data-sourcepos="203:1-203:66" dir="auto">Front matter blocks should be inserted at the top of the document:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="189:1-199:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">text</span> +<pre data-sourcepos="205:1-211:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">text</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext">---</span> <span id="LC4" class="line" lang="plaintext">title: YAML front matter</span> -<span id="LC5" class="line" lang="plaintext">---</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><p>text</p></span> -<span id="LC8" class="line" lang="plaintext"><hr></span> -<span id="LC9" class="line" lang="plaintext"><h2>title: YAML front matter</h2></span></code></pre> +<span id="LC5" class="line" lang="plaintext">---</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="213:1-217:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>text</p></span> +<span id="LC2" class="line" lang="plaintext"><hr></span> +<span id="LC3" class="line" lang="plaintext"><h2>title: YAML front matter</h2></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="201:1-201:74" dir="auto">Front matter block delimiters shouldn’t be preceded by space characters:</p> +<p data-sourcepos="219:1-219:74" dir="auto">Front matter block delimiters shouldn’t be preceded by space characters:</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="203:1-210:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ---</span> +<pre data-sourcepos="221:1-225:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> ---</span> <span id="LC2" class="line" lang="plaintext">title: YAML front matter</span> -<span id="LC3" class="line" lang="plaintext">---</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><hr></span> -<span id="LC6" class="line" lang="plaintext"><h2>title: YAML front matter</h2></span></code></pre> +<span id="LC3" class="line" lang="plaintext">---</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="227:1-230:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr></span> +<span id="LC2" class="line" lang="plaintext"><h2>title: YAML front matter</h2></span></code></pre> <copy-code></copy-code> </div> -<h2 data-sourcepos="212:1-212:20" dir="auto"> +<h2 data-sourcepos="232:1-232:20" dir="auto"> <a id="user-content-table-of-contents" class="anchor" href="#table-of-contents" aria-hidden="true"></a>Table of contents</h2> -<p data-sourcepos="214:1-216:46" dir="auto">See +<p data-sourcepos="234:1-236:46" dir="auto">See <a href="https://docs.gitlab.com/ee/user/markdown.html#table-of-contents" rel="nofollow noreferrer noopener" target="_blank">table of contents</a> in the GitLab Flavored Markdown documentation.</p> -<p data-sourcepos="218:1-219:58" dir="auto">A table of contents is an unordered list that links to subheadings in the document. +<p data-sourcepos="238:1-239:58" dir="auto">A table of contents is an unordered list that links to subheadings in the document. Add either the <code>[[_TOC_]]</code> or </p><ul class="section-nav"> <li><a href="#introduction">Introduction</a></li> <li> @@ -209,68 +229,76 @@ Add either the <code>[[_TOC_]]</code> or </p><ul class="section-nav"> </li> </ul> tag on its own line. <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="221:1-238:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[TOC]</span> +<pre data-sourcepos="241:1-247:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[TOC]</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext"># Heading 1</span> <span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext">## Heading 2</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><nav></span> -<span id="LC8" class="line" lang="plaintext"> <ul></span> -<span id="LC9" class="line" lang="plaintext"> <li><a href="#heading-1">Heading 1</a></li></span> -<span id="LC10" class="line" lang="plaintext"> <ul></span> -<span id="LC11" class="line" lang="plaintext"> <li><a href="#heading-2">Heading 2</a></li></span> -<span id="LC12" class="line" lang="plaintext"> </ul></span> -<span id="LC13" class="line" lang="plaintext"> </ul></span> -<span id="LC14" class="line" lang="plaintext"></nav></span> -<span id="LC15" class="line" lang="plaintext"><h1>Heading 1</h1></span> -<span id="LC16" class="line" lang="plaintext"><h2>Heading 2</h2></span></code></pre> +<span id="LC5" class="line" lang="plaintext">## Heading 2</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="249:1-260:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><nav></span> +<span id="LC2" class="line" lang="plaintext"> <ul></span> +<span id="LC3" class="line" lang="plaintext"> <li><a href="#heading-1">Heading 1</a></li></span> +<span id="LC4" class="line" lang="plaintext"> <ul></span> +<span id="LC5" class="line" lang="plaintext"> <li><a href="#heading-2">Heading 2</a></li></span> +<span id="LC6" class="line" lang="plaintext"> </ul></span> +<span id="LC7" class="line" lang="plaintext"> </ul></span> +<span id="LC8" class="line" lang="plaintext"></nav></span> +<span id="LC9" class="line" lang="plaintext"><h1>Heading 1</h1></span> +<span id="LC10" class="line" lang="plaintext"><h2>Heading 2</h2></span></code></pre> <copy-code></copy-code> </div> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="240:1-257:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[[_TOC_]]</span> +<pre data-sourcepos="262:1-268:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[[_TOC_]]</span> <span id="LC2" class="line" lang="plaintext"></span> <span id="LC3" class="line" lang="plaintext"># Heading 1</span> <span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext">## Heading 2</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><nav></span> -<span id="LC8" class="line" lang="plaintext"> <ul></span> -<span id="LC9" class="line" lang="plaintext"> <li><a href="#heading-1">Heading 1</a></li></span> -<span id="LC10" class="line" lang="plaintext"> <ul></span> -<span id="LC11" class="line" lang="plaintext"> <li><a href="#heading-2">Heading 2</a></li></span> -<span id="LC12" class="line" lang="plaintext"> </ul></span> -<span id="LC13" class="line" lang="plaintext"> </ul></span> -<span id="LC14" class="line" lang="plaintext"></nav></span> -<span id="LC15" class="line" lang="plaintext"><h1>Heading 1</h1></span> -<span id="LC16" class="line" lang="plaintext"><h2>Heading 2</h2></span></code></pre> +<span id="LC5" class="line" lang="plaintext">## Heading 2</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="270:1-281:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><nav></span> +<span id="LC2" class="line" lang="plaintext"> <ul></span> +<span id="LC3" class="line" lang="plaintext"> <li><a href="#heading-1">Heading 1</a></li></span> +<span id="LC4" class="line" lang="plaintext"> <ul></span> +<span id="LC5" class="line" lang="plaintext"> <li><a href="#heading-2">Heading 2</a></li></span> +<span id="LC6" class="line" lang="plaintext"> </ul></span> +<span id="LC7" class="line" lang="plaintext"> </ul></span> +<span id="LC8" class="line" lang="plaintext"></nav></span> +<span id="LC9" class="line" lang="plaintext"><h1>Heading 1</h1></span> +<span id="LC10" class="line" lang="plaintext"><h2>Heading 2</h2></span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="259:1-260:5" dir="auto">A table of contents is a block element. It should preceded and followed by a blank +<p data-sourcepos="283:1-284:5" dir="auto">A table of contents is a block element. It should preceded and followed by a blank line.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="262:1-271:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[[_TOC_]]</span> +<pre data-sourcepos="286:1-292:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[[_TOC_]]</span> <span id="LC2" class="line" lang="plaintext">text</span> <span id="LC3" class="line" lang="plaintext"></span> <span id="LC4" class="line" lang="plaintext">text</span> -<span id="LC5" class="line" lang="plaintext">[TOC]</span> -<span id="LC6" class="line" lang="plaintext">.</span> -<span id="LC7" class="line" lang="plaintext"><p>[[<em>TOC</em>]]text</p></span> -<span id="LC8" class="line" lang="plaintext"><p>text[TOC]</p></span></code></pre> +<span id="LC5" class="line" lang="plaintext">[TOC]</span></code></pre> <copy-code></copy-code> </div> -<p data-sourcepos="273:1-273:60" dir="auto">A table of contents can be indented with up to three spaces.</p> <div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="275:1-286:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> [[_TOC_]]</span> +<pre data-sourcepos="294:1-297:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[[<em>TOC</em>]]text</p></span> +<span id="LC2" class="line" lang="plaintext"><p>text[TOC]</p></span></code></pre> +<copy-code></copy-code> +</div> +<p data-sourcepos="299:1-299:60" dir="auto">A table of contents can be indented with up to three spaces.</p> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="301:1-305:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> [[_TOC_]]</span> <span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext"># Heading 1</span> -<span id="LC4" class="line" lang="plaintext">.</span> -<span id="LC5" class="line" lang="plaintext"><nav></span> -<span id="LC6" class="line" lang="plaintext"> <ul></span> -<span id="LC7" class="line" lang="plaintext"> <li><a href="#heading-1">Heading 1</a></li></span> -<span id="LC8" class="line" lang="plaintext"> </ul></span> -<span id="LC9" class="line" lang="plaintext"></nav></span> -<span id="LC10" class="line" lang="plaintext"><h1>Heading 1</h1></span></code></pre> +<span id="LC3" class="line" lang="plaintext"># Heading 1</span></code></pre> +<copy-code></copy-code> +</div> +<div class="gl-relative markdown-code-block js-markdown-code"> +<pre data-sourcepos="307:1-314:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><nav></span> +<span id="LC2" class="line" lang="plaintext"> <ul></span> +<span id="LC3" class="line" lang="plaintext"> <li><a href="#heading-1">Heading 1</a></li></span> +<span id="LC4" class="line" lang="plaintext"> </ul></span> +<span id="LC5" class="line" lang="plaintext"></nav></span> +<span id="LC6" class="line" lang="plaintext"><h1>Heading 1</h1></span></code></pre> <copy-code></copy-code> </div> diff --git a/lib/gitlab/ci/templates/Terraform/Base.gitlab-ci.yml b/lib/gitlab/ci/templates/Terraform/Base.gitlab-ci.yml index 9a40a23b276..dd1676f25b6 100644 --- a/lib/gitlab/ci/templates/Terraform/Base.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Terraform/Base.gitlab-ci.yml @@ -13,7 +13,7 @@ image: variables: TF_ROOT: ${CI_PROJECT_DIR} # The relative path to the root directory of the Terraform project - TF_STATE_NAME: ${TF_STATE_NAME:-default} # The name of the state file used by the GitLab Managed Terraform state backend + TF_STATE_NAME: default # The name of the state file used by the GitLab Managed Terraform state backend cache: key: "${TF_ROOT}" diff --git a/lib/gitlab/ci/templates/Terraform/Base.latest.gitlab-ci.yml b/lib/gitlab/ci/templates/Terraform/Base.latest.gitlab-ci.yml index 389ee888ae3..9c967d48de1 100644 --- a/lib/gitlab/ci/templates/Terraform/Base.latest.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Terraform/Base.latest.gitlab-ci.yml @@ -14,7 +14,7 @@ image: variables: TF_ROOT: ${CI_PROJECT_DIR} # The relative path to the root directory of the Terraform project - TF_STATE_NAME: ${TF_STATE_NAME:-default} # The name of the state file used by the GitLab Managed Terraform state backend + TF_STATE_NAME: default # The name of the state file used by the GitLab Managed Terraform state backend cache: key: "${TF_ROOT}" diff --git a/lib/gitlab/database/background_migration/batched_migration.rb b/lib/gitlab/database/background_migration/batched_migration.rb index 92cafd1d00e..209e281dd8d 100644 --- a/lib/gitlab/database/background_migration/batched_migration.rb +++ b/lib/gitlab/database/background_migration/batched_migration.rb @@ -98,6 +98,11 @@ module Gitlab .executable.queue_order.first end + def self.find_executable(id, connection:) + for_gitlab_schema(Gitlab::Database.gitlab_schemas_for_connection(connection)) + .executable.find_by_id(id) + end + def self.successful_rows_counts(migrations) BatchedJob .with_status(:succeeded) diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 571c9a05a50..8ce7e1972f4 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -10806,6 +10806,9 @@ msgstr "" msgid "ContributionAnalytics|No pushes for the selected time period." msgstr "" +msgid "ContributionAnalytics|There is too much data to calculate. Try lowering the period_limit setting in the insights configuration file." +msgstr "" + msgid "Contributions for %{calendar_date}" msgstr "" diff --git a/rubocop/cop/graphql/enum_values.rb b/rubocop/cop/graphql/enum_values.rb new file mode 100644 index 00000000000..71c42596334 --- /dev/null +++ b/rubocop/cop/graphql/enum_values.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +# This cop enforces the enum value conventions from the enum style guide: +# https://docs.gitlab.com/ee/development/api_graphql_styleguide.html#enums +# +# @example +# +# # bad +# class BadEnum < BaseEnum +# graphql_name 'Bad' +# +# value 'foo' +# end +# +# class UngoodEnum < BaseEnum +# graphql_name 'Ungood' +# +# ['bar'].each do |val| +# value val +# end +# end +# +# # good +# class GoodEnum < BaseEnum +# graphql_name 'Good' +# +# value 'FOO' +# end +# +# class GreatEnum < BaseEnum +# graphql_name 'Great' +# +# ['bar'].each do |val| +# value val.upcase +# end +# end + +module RuboCop + module Cop + module Graphql + class EnumValues < RuboCop::Cop::Base + MSG = "Enum values must either be an uppercase string literal or uppercased with the `upcase` method. " \ + "See https://docs.gitlab.com/ee/development/api_graphql_styleguide.html#enums" + + def_node_matcher :enum_value, <<~PATTERN + (send nil? :value $_ $...) + PATTERN + + def_node_search :deprecated?, <<~PATTERN + (hash <(pair (sym :deprecated) _) ...>) + PATTERN + + def_node_matcher :upcase_literal?, <<~PATTERN + (str #upcase?) + PATTERN + + def_node_matcher :upcase_method?, <<~PATTERN + `(send _ :upcase) + PATTERN + + def on_send(node) + value_node, params = enum_value(node) + + return unless value_node + return if params.any? { deprecated?(_1) } + return if upcase_literal?(value_node) || upcase_method?(value_node) + + add_offense(value_node) + end + + private + + def upcase?(str) + str == str.upcase + end + end + end + end +end diff --git a/scripts/lib/glfm/constants.rb b/scripts/lib/glfm/constants.rb index c4feef8464e..c432e5495dd 100644 --- a/scripts/lib/glfm/constants.rb +++ b/scripts/lib/glfm/constants.rb @@ -42,6 +42,10 @@ module Glfm version: alpha ... MARKDOWN + EXAMPLE_BACKTICKS_LENGTH = 32 + EXAMPLE_BACKTICKS_STRING = '`' * EXAMPLE_BACKTICKS_LENGTH + EXAMPLE_BEGIN_STRING = "#{EXAMPLE_BACKTICKS_STRING} example" + EXAMPLE_END_STRING = EXAMPLE_BACKTICKS_STRING INTRODUCTION_HEADER_LINE_TEXT = '# Introduction' BEGIN_TESTS_COMMENT_LINE_TEXT = '<!-- BEGIN TESTS -->' END_TESTS_COMMENT_LINE_TEXT = '<!-- END TESTS -->' diff --git a/scripts/lib/glfm/parse_examples.rb b/scripts/lib/glfm/parse_examples.rb index a15a6ecc47b..aedca274889 100644 --- a/scripts/lib/glfm/parse_examples.rb +++ b/scripts/lib/glfm/parse_examples.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require_relative 'constants' + # This module contains a Ruby port of Python logic from the `get_tests` method of the # `spec_test.py` script (see copy of original code in a comment at the bottom of this file): # https://github.com/github/cmark-gfm/blob/5dfedc7/test/spec_tests.py#L82 @@ -20,11 +22,11 @@ # in `scripts/lib/glfm/update_example_snapshots.rb` module Glfm module ParseExamples + include Constants + REGULAR_TEXT = 0 MARKDOWN_EXAMPLE = 1 HTML_OUTPUT = 2 - EXAMPLE_BACKTICKS_LENGTH = 32 - EXAMPLE_BACKTICKS_STRING = '`' * EXAMPLE_BACKTICKS_LENGTH # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/AbcSize def parse_examples(spec_txt_lines) @@ -47,11 +49,11 @@ module Glfm spec_txt_lines.each do |line| line_number += 1 stripped_line = line.strip - if stripped_line.start_with?("#{EXAMPLE_BACKTICKS_STRING} example") + if stripped_line.start_with?(EXAMPLE_BEGIN_STRING) # If beginning line of an example block... state = MARKDOWN_EXAMPLE extensions = stripped_line[(EXAMPLE_BACKTICKS_LENGTH + " example".length)..].split - elsif stripped_line == EXAMPLE_BACKTICKS_STRING + elsif stripped_line == EXAMPLE_END_STRING # Else if end line of an example block... state = REGULAR_TEXT example_number += 1 diff --git a/scripts/lib/glfm/update_specification.rb b/scripts/lib/glfm/update_specification.rb index 521c0919f64..b87005bdb90 100644 --- a/scripts/lib/glfm/update_specification.rb +++ b/scripts/lib/glfm/update_specification.rb @@ -171,12 +171,15 @@ module Glfm def generate_spec_html_files(spec_txt_string, snapshot_spec_md_string) output("Generating spec.html and snapshot_spec.html from spec.txt and snapshot_spec.md markdown...") + spec_txt_string_split_examples = split_examples_into_html_and_md(spec_txt_string) + snapshot_spec_md_string_split_examples = split_examples_into_html_and_md(snapshot_spec_md_string) + input_markdown_yml_string = <<~MARKDOWN --- spec_txt: | - #{spec_txt_string.gsub(/^/, ' ')} + #{spec_txt_string_split_examples.gsub(/^/, ' ')} snapshot_spec_md: | - #{snapshot_spec_md_string.gsub(/^/, ' ')} + #{snapshot_spec_md_string_split_examples.gsub(/^/, ' ')} MARKDOWN # NOTE: We must copy the input YAML file used by the `render_static_html.rb` @@ -209,6 +212,13 @@ module Glfm [rendered_html_hash.fetch(:spec_txt), rendered_html_hash.fetch(:snapshot_spec_md)] end + def split_examples_into_html_and_md(spec_md_string) + spec_md_string.gsub( + /(^#{EXAMPLE_BEGIN_STRING}.*?$(?:.|\n)*?)^\.$(\n(?:.|\n)*?^#{EXAMPLE_END_STRING}$)/mo, + "\\1#{EXAMPLE_BACKTICKS_STRING}\n\n#{EXAMPLE_BACKTICKS_STRING}\\2" + ) + end + def write_spec_html(spec_html_string) output("Writing #{GLFM_SPEC_TXT_PATH}...") FileUtils.mkdir_p(Pathname.new(GLFM_SPEC_HTML_PATH).dirname) diff --git a/spec/factories/container_repositories.rb b/spec/factories/container_repositories.rb index 210441430b0..66ac72fb5d7 100644 --- a/spec/factories/container_repositories.rb +++ b/spec/factories/container_repositories.rb @@ -21,6 +21,10 @@ FactoryBot.define do status { :delete_failed } end + trait :status_delete_ongoing do + status { :delete_ongoing } + end + trait :cleanup_scheduled do expiration_policy_cleanup_status { :cleanup_scheduled } end diff --git a/spec/lib/gitlab/database/background_migration/batched_migration_spec.rb b/spec/lib/gitlab/database/background_migration/batched_migration_spec.rb index 1ac9cbae036..9194c1ccb55 100644 --- a/spec/lib/gitlab/database/background_migration/batched_migration_spec.rb +++ b/spec/lib/gitlab/database/background_migration/batched_migration_spec.rb @@ -213,6 +213,59 @@ RSpec.describe Gitlab::Database::BackgroundMigration::BatchedMigration, type: :m end end + describe '.find_executable' do + let(:connection) { Gitlab::Database.database_base_models[:main].connection } + let(:migration_id) { migration.id } + + subject(:executable_migration) { described_class.find_executable(migration_id, connection: connection) } + + around do |example| + Gitlab::Database::SharedModel.using_connection(connection) do + example.run + end + end + + context 'when the migration does not exist' do + let(:migration_id) { non_existing_record_id } + + it 'returns nil' do + expect(executable_migration).to be_nil + end + end + + context 'when the migration is not active' do + let!(:migration) { create(:batched_background_migration, :finished) } + + it 'returns nil' do + expect(executable_migration).to be_nil + end + end + + context 'when the migration is on hold' do + let!(:migration) { create(:batched_background_migration, :active, on_hold_until: 10.minutes.from_now) } + + it 'returns nil' do + expect(executable_migration).to be_nil + end + end + + context 'when the migration is not available for the current connection' do + let!(:migration) { create(:batched_background_migration, :active, gitlab_schema: :gitlab_not_existing) } + + it 'returns nil' do + expect(executable_migration).to be_nil + end + end + + context 'when ther migration exists and is executable' do + let!(:migration) { create(:batched_background_migration, :active, gitlab_schema: :gitlab_main) } + + it 'returns the migration' do + expect(executable_migration).to eq(migration) + end + end + end + describe '.created_after' do let!(:migration_old) { create :batched_background_migration, created_at: 2.days.ago } let!(:migration_new) { create :batched_background_migration, created_at: 0.days.ago } diff --git a/spec/models/container_repository_spec.rb b/spec/models/container_repository_spec.rb index 0033e9bbd08..00588b5df5f 100644 --- a/spec/models/container_repository_spec.rb +++ b/spec/models/container_repository_spec.rb @@ -871,6 +871,28 @@ RSpec.describe ContainerRepository, :aggregate_failures do end end + describe '#set_delete_ongoing_status', :freeze_time do + let_it_be(:repository) { create(:container_repository) } + + subject { repository.set_delete_ongoing_status } + + it 'updates deletion status attributes' do + expect { subject }.to change(repository, :status).from(nil).to('delete_ongoing') + .and change(repository, :delete_started_at).from(nil).to(Time.zone.now) + end + end + + describe '#set_delete_scheduled_status' do + let_it_be(:repository) { create(:container_repository, :status_delete_ongoing, delete_started_at: 3.minutes.ago) } + + subject { repository.set_delete_scheduled_status } + + it 'updates delete attributes' do + expect { subject }.to change(repository, :status).from('delete_ongoing').to('delete_scheduled') + .and change(repository, :delete_started_at).to(nil) + end + end + context 'registry migration' do before do allow(repository.gitlab_api_client).to receive(:supports_gitlab_api?).and_return(true) diff --git a/spec/rubocop/cop/graphql/enum_values_spec.rb b/spec/rubocop/cop/graphql/enum_values_spec.rb new file mode 100644 index 00000000000..5609c86d9ec --- /dev/null +++ b/spec/rubocop/cop/graphql/enum_values_spec.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +require 'rubocop_spec_helper' +require_relative '../../../../rubocop/cop/graphql/enum_values' + +RSpec.describe RuboCop::Cop::Graphql::EnumValues do + it 'adds an offense when enum value is not uppercase' do + expect_offense(<<~ENUM) + module Types + class FakeEnum < BaseEnum + graphql_name 'Fake' + + value 'downcase', description: "Downcase." + ^^^^^^^^^^ #{described_class::MSG} + end + end + ENUM + end + + context 'when values are set dynamically' do + it 'adds an offense when enum value is set without `:upcase`' do + expect_offense(<<~ENUM) + VALUES = ['FOO', 'bar'] + + module Types + class FakeEnum < BaseEnum + graphql_name 'Fake' + + VALUES.each do |val| + value val, description: "Dynamic value." + ^^^ #{described_class::MSG} + end + end + end + ENUM + end + + it 'adds no offense when enum value is deprecated' do + expect_no_offenses(<<~ENUM) + module Types + class FakeEnum < BaseEnum + graphql_name 'Fake' + + value 'foo', deprecated: { reason: 'Use something else' } + end + end + ENUM + end + + it 'adds no offense when enum value is uppercased literally' do + expect_no_offenses(<<~'ENUM') + module Types + class FakeEnum < BaseEnum + graphql_name 'Fake' + + value 'FOO' + end + end + ENUM + end + + it 'adds no offense when enum value is calling upcased' do + expect_no_offenses(<<~'ENUM') + VALUES = ['FOO', 'bar'] + + module Types + class FakeEnum < BaseEnum + graphql_name 'Fake' + + VALUES.each do |val| + value val.underscore.upcase, description: "Dynamic value." + value "#{field.upcase.tr(' ', '_')}_ASC" + end + end + end + ENUM + end + end +end diff --git a/spec/scripts/lib/glfm/update_specification_spec.rb b/spec/scripts/lib/glfm/update_specification_spec.rb index 8a7d7100363..bd3d222639f 100644 --- a/spec/scripts/lib/glfm/update_specification_spec.rb +++ b/spec/scripts/lib/glfm/update_specification_spec.rb @@ -55,12 +55,20 @@ RSpec.describe Glfm::UpdateSpecification, '#process' do <<~MARKDOWN # Section with Examples - ## Strong + ## Emphasis and Strong ```````````````````````````````` example - __bold__ + _EMPHASIS LINE 1_ + _EMPHASIS LINE 2_ . - <p><strong>bold</strong></p> + <p><em>EMPHASIS LINE 1</em> + <em>EMPHASIS LINE 2</em></p> + ```````````````````````````````` + + ```````````````````````````````` example + __STRONG!__ + . + <p><strong>STRONG!</strong></p> ```````````````````````````````` End of last GitHub examples section. @@ -317,21 +325,33 @@ RSpec.describe Glfm::UpdateSpecification, '#process' do </div> <h1 data-sourcepos="5:1-5:23" dir="auto"> <a id="user-content-section-with-examples" class="anchor" href="#section-with-examples" aria-hidden="true"></a>Section with Examples</h1> - <h2 data-sourcepos="7:1-7:9" dir="auto"> - <a id="user-content-strong" class="anchor" href="#strong" aria-hidden="true"></a>Strong</h2> + <h2 data-sourcepos="7:1-7:22" dir="auto"> + <a id="user-content-emphasis-and-strong" class="anchor" href="#emphasis-and-strong" aria-hidden="true"></a>Emphasis and Strong</h2> + <div class="gl-relative markdown-code-block js-markdown-code"> + <pre data-sourcepos="9:1-12:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_EMPHASIS LINE 1_</span> + <span id="LC2" class="line" lang="plaintext">_EMPHASIS LINE 2_</span></code></pre> + <copy-code></copy-code> + </div> + <div class="gl-relative markdown-code-block js-markdown-code"> + <pre data-sourcepos="14:1-17:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>EMPHASIS LINE 1</em></span> + <span id="LC2" class="line" lang="plaintext"><em>EMPHASIS LINE 2</em></p></span></code></pre> + <copy-code></copy-code> + </div> + <div class="gl-relative markdown-code-block js-markdown-code"> + <pre data-sourcepos="19:1-21:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__STRONG!__</span></code></pre> + <copy-code></copy-code> + </div> <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="9:1-13:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="example" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">__bold__</span> - <span id="LC2" class="line" lang="plaintext">.</span> - <span id="LC3" class="line" lang="plaintext"><p><strong>bold</strong></p></span></code></pre> + <pre data-sourcepos="23:1-25:32" class="code highlight js-syntax-highlight language-plaintext" lang="plaintext" data-canonical-lang="" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>STRONG!</strong></p></span></code></pre> <copy-code></copy-code> </div> - <p data-sourcepos="15:1-15:36" dir="auto">End of last GitHub examples section.</p> - <h1 data-sourcepos="17:1-17:46" dir="auto"> + <p data-sourcepos="27:1-27:36" dir="auto">End of last GitHub examples section.</p> + <h1 data-sourcepos="29:1-29:46" dir="auto"> <a id="user-content-official-specification-section-with-examples" class="anchor" href="#official-specification-section-with-examples" aria-hidden="true"></a>Official Specification Section with Examples</h1> - <p data-sourcepos="19:1-19:14" dir="auto">Some examples.</p> - <h1 data-sourcepos="22:1-22:42" dir="auto"> + <p data-sourcepos="31:1-31:14" dir="auto">Some examples.</p> + <h1 data-sourcepos="34:1-34:42" dir="auto"> <a id="user-content-internal-extension-section-with-examples" class="anchor" href="#internal-extension-section-with-examples" aria-hidden="true"></a>Internal Extension Section with Examples</h1> - <p data-sourcepos="24:1-24:14" dir="auto">Some examples.</p> + <p data-sourcepos="36:1-36:14" dir="auto">Some examples.</p> RENDERED_HTML expect(snapshot_spec_html_contents).to be == expected_snapshot_spec_html end diff --git a/spec/services/clusters/applications/check_upgrade_progress_service_spec.rb b/spec/services/clusters/applications/check_upgrade_progress_service_spec.rb deleted file mode 100644 index dbde8cec9b9..00000000000 --- a/spec/services/clusters/applications/check_upgrade_progress_service_spec.rb +++ /dev/null @@ -1,94 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Clusters::Applications::CheckUpgradeProgressService do - reschedule_phashes = ::Gitlab::Kubernetes::Pod::PHASES - - [::Gitlab::Kubernetes::Pod::SUCCEEDED, ::Gitlab::Kubernetes::Pod::FAILED, ::Gitlab].freeze - - let(:application) { create(:clusters_applications_prometheus, :updating) } - let(:service) { described_class.new(application) } - let(:phase) { ::Gitlab::Kubernetes::Pod::UNKNOWN } - let(:errors) { nil } - - shared_examples 'a terminated upgrade' do - it 'removes the POD' do - expect(service).to receive(:remove_pod).once - - service.execute - end - end - - shared_examples 'a not yet terminated upgrade' do |a_phase| - let(:phase) { a_phase } - - context "when phase is #{a_phase}" do - context 'when not timed out' do - it 'reschedule a new check' do - expect(::ClusterWaitForAppUpdateWorker).to receive(:perform_in).once - expect(service).not_to receive(:remove_pod) - - service.execute - - expect(application).to be_updating - expect(application.status_reason).to be_nil - end - end - - context 'when timed out' do - let(:application) { create(:clusters_applications_prometheus, :timed_out, :updating) } - - it_behaves_like 'a terminated upgrade' - - it 'make the application update errored' do - expect(::ClusterWaitForAppUpdateWorker).not_to receive(:perform_in) - - service.execute - - expect(application).to be_update_errored - expect(application.status_reason).to eq("Update timed out") - end - end - end - end - - before do - allow(service).to receive(:phase).once.and_return(phase) - - allow(service).to receive(:errors).and_return(errors) - allow(service).to receive(:remove_pod).and_return(nil) - end - - describe '#execute' do - context 'when upgrade pod succeeded' do - let(:phase) { ::Gitlab::Kubernetes::Pod::SUCCEEDED } - - it_behaves_like 'a terminated upgrade' - - it 'make the application upgraded' do - expect(::ClusterWaitForAppUpdateWorker).not_to receive(:perform_in) - - service.execute - - expect(application).to be_updated - expect(application.status_reason).to be_nil - end - end - - context 'when upgrade pod failed' do - let(:phase) { ::Gitlab::Kubernetes::Pod::FAILED } - let(:errors) { 'test installation failed' } - - it_behaves_like 'a terminated upgrade' - - it 'make the application update errored' do - service.execute - - expect(application).to be_update_errored - expect(application.status_reason).to eq(errors) - end - end - - reschedule_phashes.each { |phase| it_behaves_like 'a not yet terminated upgrade', phase } - end -end diff --git a/spec/support/shared_examples/workers/batched_background_migration_worker_shared_examples.rb b/spec/support/shared_examples/workers/batched_background_migration_worker_shared_examples.rb index 1e70bb31767..0be55fd2a3e 100644 --- a/spec/support/shared_examples/workers/batched_background_migration_worker_shared_examples.rb +++ b/spec/support/shared_examples/workers/batched_background_migration_worker_shared_examples.rb @@ -137,8 +137,12 @@ RSpec.shared_examples 'it runs batched background migration jobs' do |tracking_d let(:lease_timeout) { 15.minutes } let(:lease_key) { described_class.name.demodulize.underscore } let(:interval_variance) { described_class::INTERVAL_VARIANCE } + let(:migration_id) { 123 } let(:migration) do - build(:batched_background_migration, :active, interval: job_interval, table_name: table_name) + build( + :batched_background_migration, :active, + id: migration_id, interval: job_interval, table_name: table_name + ) end before do @@ -150,45 +154,6 @@ RSpec.shared_examples 'it runs batched background migration jobs' do |tracking_d allow(migration).to receive(:reload) end - context 'when the reloaded migration is no longer active' do - it 'does not run the migration' do - expect_to_obtain_exclusive_lease(lease_key, timeout: lease_timeout) - - expect(migration).to receive(:reload) - expect(migration).to receive(:active?).and_return(false) - - expect(worker).not_to receive(:run_active_migration) - - worker.perform - end - end - - context 'when the interval has not elapsed' do - it 'does not run the migration' do - expect_to_obtain_exclusive_lease(lease_key, timeout: lease_timeout) - - expect(migration).to receive(:interval_elapsed?).with(variance: interval_variance).and_return(false) - - expect(worker).not_to receive(:run_active_migration) - - worker.perform - end - end - - context 'when the reloaded migration is still active and the interval has elapsed' do - it 'runs the migration' do - expect_to_obtain_exclusive_lease(lease_key, timeout: lease_timeout) - - expect_next_instance_of(Gitlab::Database::BackgroundMigration::BatchedMigrationRunner) do |instance| - expect(instance).to receive(:run_migration_job).with(migration) - end - - expect(worker).to receive(:run_active_migration).and_call_original - - worker.perform - end - end - context 'when the calculated timeout is less than the minimum allowed' do let(:minimum_timeout) { described_class::MINIMUM_LEASE_TIMEOUT } let(:job_interval) { 2.minutes } @@ -196,8 +161,8 @@ RSpec.shared_examples 'it runs batched background migration jobs' do |tracking_d it 'sets the lease timeout to the minimum value' do expect_to_obtain_exclusive_lease(lease_key, timeout: minimum_timeout) - expect_next_instance_of(Gitlab::Database::BackgroundMigration::BatchedMigrationRunner) do |instance| - expect(instance).to receive(:run_migration_job).with(migration) + expect_next_instance_of(Database::BatchedBackgroundMigration::ExecutionWorker) do |worker| + expect(worker).to receive(:perform).with(tracking_database, migration_id) end expect(worker).to receive(:run_active_migration).and_call_original @@ -217,10 +182,13 @@ RSpec.shared_examples 'it runs batched background migration jobs' do |tracking_d expect { worker.perform }.to raise_error(RuntimeError, 'I broke') end - it 'receives the correct connection' do + it 'delegetes the execution to ExecutionWorker' do base_model = Gitlab::Database.database_base_models[tracking_database] expect(Gitlab::Database::SharedModel).to receive(:using_connection).with(base_model.connection).and_yield + expect_next_instance_of(Database::BatchedBackgroundMigration::ExecutionWorker) do |worker| + expect(worker).to receive(:perform).with(tracking_database, migration_id) + end worker.perform end diff --git a/spec/workers/cluster_wait_for_app_update_worker_spec.rb b/spec/workers/cluster_wait_for_app_update_worker_spec.rb deleted file mode 100644 index b7f7622a0e6..00000000000 --- a/spec/workers/cluster_wait_for_app_update_worker_spec.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe ClusterWaitForAppUpdateWorker do - let(:check_upgrade_progress_service) { spy } - - before do - allow(::Clusters::Applications::CheckUpgradeProgressService).to receive(:new).and_return(check_upgrade_progress_service) - end - - it 'runs CheckUpgradeProgressService when application is found' do - application = create(:clusters_applications_prometheus) - - expect(check_upgrade_progress_service).to receive(:execute) - - subject.perform(application.name, application.id) - end - - it 'does not run CheckUpgradeProgressService when application is not found' do - expect(check_upgrade_progress_service).not_to receive(:execute) - - expect do - subject.perform("prometheus", -1) - end.to raise_error(ActiveRecord::RecordNotFound) - end -end diff --git a/spec/workers/container_registry/delete_container_repository_worker_spec.rb b/spec/workers/container_registry/delete_container_repository_worker_spec.rb new file mode 100644 index 00000000000..381e0cc164c --- /dev/null +++ b/spec/workers/container_registry/delete_container_repository_worker_spec.rb @@ -0,0 +1,146 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe ContainerRegistry::DeleteContainerRepositoryWorker, :aggregate_failures do + let_it_be_with_reload(:container_repository) { create(:container_repository) } + let_it_be(:second_container_repository) { create(:container_repository) } + + let(:worker) { described_class.new } + + describe '#perform_work' do + subject(:perform_work) { worker.perform_work } + + context 'with no work to do - no container repositories pending deletion' do + it 'will not delete any container repository' do + expect(::Projects::ContainerRepository::CleanupTagsService).not_to receive(:new) + + expect { perform_work }.to not_change { ContainerRepository.count } + end + end + + context 'with work to do' do + let(:tags_count) { 0 } + let(:cleanup_tags_service_response) { { status: :success, original_size: 100, deleted_size: 0 } } + let(:cleanup_tags_service_double) do + instance_double('Projects::ContainerRepository::CleanupTagsService', execute: cleanup_tags_service_response) + end + + before do + container_repository.delete_scheduled! + allow(Projects::ContainerRepository::CleanupTagsService) + .to receive(:new) + .with(container_repository: container_repository, params: described_class::CLEANUP_TAGS_SERVICE_PARAMS) + .and_return(cleanup_tags_service_double) + end + + it 'picks and destroys the delete scheduled container repository' do + expect_next_pending_destruction_container_repository do |repo| + expect_logs_on(repo, tags_size_before_delete: 100, deleted_tags_size: 0) + expect(repo).to receive(:destroy!).and_call_original + end + perform_work + expect(ContainerRepository.all).to contain_exactly(second_container_repository) + end + + context 'with an error during the tags cleanup' do + let(:cleanup_tags_service_response) { { status: :error, original_size: 100, deleted_size: 0 } } + + it 'does not delete the container repository' do + expect_next_pending_destruction_container_repository do |repo| + expect_logs_on(repo, tags_size_before_delete: 100, deleted_tags_size: 0) + expect(repo).to receive(:set_delete_scheduled_status).and_call_original + expect(repo).not_to receive(:destroy!) + end + expect { perform_work }.to not_change(ContainerRepository, :count) + .and not_change { container_repository.reload.status } + expect(container_repository.delete_started_at).to eq(nil) + end + end + + context 'with an error during the destroy' do + it 'does not delete the container repository' do + expect_next_pending_destruction_container_repository do |repo| + expect_logs_on(repo, tags_size_before_delete: 100, deleted_tags_size: 0) + expect(repo).to receive(:destroy!).and_raise('Error!') + expect(repo).to receive(:set_delete_scheduled_status).and_call_original + end + + expect(::Gitlab::ErrorTracking).to receive(:log_exception) + .with(instance_of(RuntimeError), class: described_class.name) + expect { perform_work }.to not_change(ContainerRepository, :count) + .and not_change { container_repository.reload.status } + expect(container_repository.delete_started_at).to eq(nil) + end + end + + context 'with tags left to destroy' do + let(:tags_count) { 10 } + + it 'does not delete the container repository' do + expect_next_pending_destruction_container_repository do |repo| + expect(repo).not_to receive(:destroy!) + expect(repo).to receive(:set_delete_scheduled_status).and_call_original + end + + expect { perform_work }.to not_change(ContainerRepository, :count) + .and not_change { container_repository.reload.status } + expect(container_repository.delete_started_at).to eq(nil) + end + end + + context 'with no tags on the container repository' do + let(:tags_count) { 0 } + let(:cleanup_tags_service_response) { { status: :success, original_size: 0, deleted_size: 0 } } + + it 'picks and destroys the delete scheduled container repository' do + expect_next_pending_destruction_container_repository do |repo| + expect_logs_on(repo, tags_size_before_delete: 0, deleted_tags_size: 0) + expect(repo).to receive(:destroy!).and_call_original + end + perform_work + expect(ContainerRepository.all).to contain_exactly(second_container_repository) + end + end + + def expect_next_pending_destruction_container_repository + original_method = ContainerRepository.method(:next_pending_destruction) + expect(ContainerRepository).to receive(:next_pending_destruction).with(order_by: nil) do + original_method.call(order_by: nil).tap do |repo| + allow(repo).to receive(:tags_count).and_return(tags_count) + expect(repo).to receive(:set_delete_ongoing_status).and_call_original + yield repo + end + end + end + + def expect_logs_on(container_repository, tags_size_before_delete:, deleted_tags_size:) + payload = { + project_id: container_repository.project.id, + container_repository_id: container_repository.id, + container_repository_path: container_repository.path, + tags_size_before_delete: tags_size_before_delete, + deleted_tags_size: deleted_tags_size + } + expect(worker.logger).to receive(:info).with(worker.structured_payload(payload)) + .and_call_original + end + end + end + + describe '#max_running_jobs' do + subject { worker.max_running_jobs } + + it { is_expected.to eq(described_class::MAX_CAPACITY) } + end + + describe '#remaining_work_count' do + let_it_be(:delete_scheduled_container_repositories) do + create_list(:container_repository, described_class::MAX_CAPACITY + 2, :status_delete_scheduled) + end + + subject { worker.remaining_work_count } + + it { is_expected.to eq(described_class::MAX_CAPACITY + 1) } + end +end diff --git a/spec/workers/database/batched_background_migration/execution_worker_spec.rb b/spec/workers/database/batched_background_migration/execution_worker_spec.rb new file mode 100644 index 00000000000..ae879feced9 --- /dev/null +++ b/spec/workers/database/batched_background_migration/execution_worker_spec.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Database::BatchedBackgroundMigration::ExecutionWorker, :clean_gitlab_redis_shared_state do + describe '#perform' do + let(:database_name) { Gitlab::Database::MAIN_DATABASE_NAME.to_sym } + + subject(:worker) { described_class.new } + + context 'when the feature flag is disabled' do + before do + stub_feature_flags(execute_batched_migrations_on_schedule: false) + end + + it 'does nothing' do + expect(worker).not_to receive(:run) + + worker.perform(database_name, 123) + end + end + + context 'when the feature flag is enabled' do + before do + stub_feature_flags(execute_batched_migrations_on_schedule: true) + end + + context 'when migration does not exist' do + it 'does nothing' do + expect(worker).not_to receive(:run) + + worker.perform(database_name, non_existing_record_id) + end + end + + context 'when migration exist' do + let(:base_model) { Gitlab::Database.database_base_models[database_name] } + let(:table_name) { :events } + let(:job_interval) { 5.minutes } + let(:interval_variance) { described_class::INTERVAL_VARIANCE } + let(:migration) do + create(:batched_background_migration, :active, interval: job_interval, table_name: table_name) + end + + before do + allow(Gitlab::Database::BackgroundMigration::BatchedMigration).to receive(:find_executable) + .with(migration.id, connection: base_model.connection) + .and_return(migration) + end + + context 'when the migration is no longer active' do + it 'does not run the migration' do + expect(Gitlab::Database::SharedModel).to receive(:using_connection).with(base_model.connection).and_yield + + expect(migration).to receive(:active?).and_return(false) + + expect(worker).not_to receive(:run) + + worker.perform(database_name, migration.id) + end + end + + context 'when the interval has not elapsed' do + it 'does not run the migration' do + expect(Gitlab::Database::SharedModel).to receive(:using_connection).with(base_model.connection).and_yield + + expect(migration).to receive(:interval_elapsed?).with(variance: interval_variance).and_return(false) + + expect(worker).not_to receive(:run) + + worker.perform(database_name, migration.id) + end + end + + context 'when the migration is still active and the interval has elapsed' do + it 'runs the migration' do + expect(Gitlab::Database::SharedModel).to receive(:using_connection).with(base_model.connection).and_yield + + expect_next_instance_of(Gitlab::Database::BackgroundMigration::BatchedMigrationRunner) do |instance| + expect(instance).to receive(:run_migration_job).with(migration) + end + + expect(worker).to receive(:run).and_call_original + + worker.perform(database_name, migration.id) + end + end + end + end + end +end diff --git a/spec/workers/every_sidekiq_worker_spec.rb b/spec/workers/every_sidekiq_worker_spec.rb index 322f516fbeb..40cb3346469 100644 --- a/spec/workers/every_sidekiq_worker_spec.rb +++ b/spec/workers/every_sidekiq_worker_spec.rb @@ -188,6 +188,7 @@ RSpec.describe 'Every Sidekiq worker' do 'Clusters::Cleanup::ProjectNamespaceWorker' => 3, 'Clusters::Cleanup::ServiceAccountWorker' => 3, 'ContainerExpirationPolicies::CleanupContainerRepositoryWorker' => 0, + 'ContainerRegistry::DeleteContainerRepositoryWorker' => 0, 'CreateCommitSignatureWorker' => 3, 'CreateGithubWebhookWorker' => 3, 'CreateNoteDiffFileWorker' => 3, |