diff --git a/.gitlab/CODEOWNERS b/.gitlab/CODEOWNERS index 008548859659a0700de3a8eaedd339fbc1314216..53d6e2a2cd2433450ccadede7bb4152c3f3e84c0 100644 --- a/.gitlab/CODEOWNERS +++ b/.gitlab/CODEOWNERS @@ -122,7 +122,6 @@ Dangerfile /spec/tooling/ /scripts/ /scripts/**/*.rb @gl-quality/eng-prod @gitlab-org/maintainers/rails-backend -/scripts/**/glfm/**/* @gl-quality/eng-prod @gitlab-org/plan-stage/backend-engineers /scripts/**/*.js @gl-quality/eng-prod @gitlab-org/maintainers/frontend /scripts/frontend/ @gl-quality/eng-prod @gitlab-org/maintainers/frontend /scripts/remote_development/ @gitlab-org/maintainers/workspaces/backend diff --git a/.rubocop_todo/layout/empty_line_after_magic_comment.yml b/.rubocop_todo/layout/empty_line_after_magic_comment.yml index 283ebe9a86a9ddf719e044d5a016452f9b4e5569..549ff44e0e3bb04994df16cdbef93717034124dd 100644 --- a/.rubocop_todo/layout/empty_line_after_magic_comment.yml +++ b/.rubocop_todo/layout/empty_line_after_magic_comment.yml @@ -380,9 +380,6 @@ Layout/EmptyLineAfterMagicComment: - 'rubocop/cop/group_public_or_visible_to_user.rb' - 'rubocop/cop/migration/add_reference.rb' - 'rubocop/cop/migration/prevent_index_creation.rb' - - 'scripts/lib/glfm/shared.rb' - - 'scripts/lib/glfm/update_example_snapshots.rb' - - 'scripts/lib/glfm/update_specification.rb' - 'spec/components/layouts/horizontal_section_component_spec.rb' - 'spec/components/pajamas/alert_component_spec.rb' - 'spec/components/pajamas/avatar_component_spec.rb' @@ -564,9 +561,6 @@ Layout/EmptyLineAfterMagicComment: - 'spec/requests/lfs_http_spec.rb' - 'spec/rubocop/cop/migration/complex_indexes_require_name_spec.rb' - 'spec/rubocop/cop/migration/refer_to_index_by_name_spec.rb' - - 'spec/scripts/lib/glfm/parse_examples_spec.rb' - - 'spec/scripts/lib/glfm/shared_spec.rb' - - 'spec/scripts/lib/glfm/update_example_snapshots_spec.rb' - 'spec/scripts/trigger-build_spec.rb' - 'spec/serializers/impersonation_access_token_entity_spec.rb' - 'spec/serializers/impersonation_access_token_serializer_spec.rb' diff --git a/.rubocop_todo/layout/line_end_string_concatenation_indentation.yml b/.rubocop_todo/layout/line_end_string_concatenation_indentation.yml index dcf2b67711c7ac4df5c46f50e99a9b7eb00dc825..5654e48bea5a382c9b0f714ce53bd6d92bb75a13 100644 --- a/.rubocop_todo/layout/line_end_string_concatenation_indentation.yml +++ b/.rubocop_todo/layout/line_end_string_concatenation_indentation.yml @@ -581,8 +581,6 @@ Layout/LineEndStringConcatenationIndentation: - 'scripts/generate_rspec_pipeline.rb' - 'scripts/internal_events/cli.rb' - 'scripts/internal_events/cli/event_definer.rb' - - 'scripts/lib/glfm/update_example_snapshots.rb' - - 'scripts/lib/glfm/update_specification.rb' - 'scripts/lint-docs-redirects.rb' - 'scripts/qa/testcases-check' - 'scripts/trigger-build.rb' @@ -719,7 +717,6 @@ Layout/LineEndStringConcatenationIndentation: - 'spec/rubocop/cop/migration/create_table_with_foreign_keys_spec.rb' - 'spec/rubocop/cop/rspec/avoid_test_prof_spec.rb' - 'spec/scripts/generate_rspec_pipeline_spec.rb' - - 'spec/scripts/lib/glfm/update_example_snapshots_spec.rb' - 'spec/serializers/integrations/field_entity_spec.rb' - 'spec/serializers/profile/event_entity_spec.rb' - 'spec/services/alert_management/alerts/update_service_spec.rb' diff --git a/.rubocop_todo/lint/assignment_in_condition.yml b/.rubocop_todo/lint/assignment_in_condition.yml index 49d42a5bfb4f92f80bc3afa65ecf3c1fd87ca006..80f49caa577b643195150a0c9a282289b90449ed 100644 --- a/.rubocop_todo/lint/assignment_in_condition.yml +++ b/.rubocop_todo/lint/assignment_in_condition.yml @@ -215,8 +215,6 @@ Lint/AssignmentInCondition: - 'rubocop/cop/migration/background_migration_missing_active_concern.rb' - 'rubocop/cop/prefer_class_methods_over_module.rb' - 'rubocop/cop/rspec/httparty_basic_auth.rb' - - 'scripts/lib/glfm/render_static_html.rb' - - 'scripts/lib/glfm/update_example_snapshots.rb' - 'scripts/lint-docs-blueprints.rb' - 'spec/factories/ci/processable.rb' - 'spec/lib/gitlab/background_migration/backfill_root_storage_statistics_fork_storage_sizes_spec.rb' @@ -226,5 +224,4 @@ Lint/AssignmentInCondition: - 'spec/services/members/invitation_reminder_email_service_spec.rb' - 'spec/support/helpers/graphql_helpers.rb' - 'spec/support/matchers/request_urgency_matcher.rb' - - 'spec/support/shared_contexts/glfm/api_markdown_snapshot_shared_context.rb' - 'tooling/danger/database.rb' diff --git a/.rubocop_todo/lint/empty_block.yml b/.rubocop_todo/lint/empty_block.yml index 9c21c5a613a2a92eb20f3e32249def4a6e321624..68be69a2dc6d7aca0438317b67e3827565b01cdd 100644 --- a/.rubocop_todo/lint/empty_block.yml +++ b/.rubocop_todo/lint/empty_block.yml @@ -47,8 +47,6 @@ Lint/EmptyBlock: - 'qa/spec/specs/helpers/context_selector_spec.rb' - 'qa/spec/specs/helpers/feature_flag_spec.rb' - 'qa/spec/specs/helpers/quarantine_spec.rb' - - 'scripts/lib/glfm/update_example_snapshots.rb' - - 'scripts/lib/glfm/update_specification.rb' - 'spec/controllers/application_controller_spec.rb' - 'spec/controllers/projects/artifacts_controller_spec.rb' - 'spec/controllers/projects/feature_flags_controller_spec.rb' diff --git a/.rubocop_todo/performance/regexp_match.yml b/.rubocop_todo/performance/regexp_match.yml index b3c8ae4129e5963fa428cb3d66b09c3dfd1afe38..72a7499c0e105eda8a3e80bae9a6c8c1d4733916 100644 --- a/.rubocop_todo/performance/regexp_match.yml +++ b/.rubocop_todo/performance/regexp_match.yml @@ -26,8 +26,6 @@ Performance/RegexpMatch: - 'qa/qa/service/cluster_provider/k3d.rb' - 'qa/qa/tools/ci/ff_changes.rb' - 'scripts/failed_tests.rb' - - 'scripts/lib/glfm/parse_examples.rb' - - 'scripts/lib/glfm/update_specification.rb' - 'scripts/lint-docs-blueprints.rb' - 'scripts/perf/query_limiting_report.rb' - 'scripts/qa/testcases-check' diff --git a/.rubocop_todo/rspec/feature_category.yml b/.rubocop_todo/rspec/feature_category.yml index 7ebe5912178c732dd4b8d20e1eda3cb2866cd1b0..8c2dc8f2ff1d8327c43450cda5848f24c2901567 100644 --- a/.rubocop_todo/rspec/feature_category.yml +++ b/.rubocop_todo/rspec/feature_category.yml @@ -4025,7 +4025,6 @@ RSpec/FeatureCategory: - 'spec/rubocop/qa_helpers_spec.rb' - 'spec/rubocop/todo_dir_spec.rb' - 'spec/scripts/failed_tests_spec.rb' - - 'spec/scripts/lib/glfm/parse_examples_spec.rb' - 'spec/serializers/access_token_entity_base_spec.rb' - 'spec/serializers/accessibility_error_entity_spec.rb' - 'spec/serializers/accessibility_reports_comparer_entity_spec.rb' diff --git a/.rubocop_todo/rspec/named_subject.yml b/.rubocop_todo/rspec/named_subject.yml index 06f90ee63a0818adc09028ce4994cc4d066adb0d..8be74f9c046711ea302a4f51d2d0af1f056baccf 100644 --- a/.rubocop_todo/rspec/named_subject.yml +++ b/.rubocop_todo/rspec/named_subject.yml @@ -2827,9 +2827,6 @@ RSpec/NamedSubject: - 'spec/scripts/failed_tests_spec.rb' - 'spec/scripts/generate_message_to_run_e2e_pipeline_spec.rb' - 'spec/scripts/generate_rspec_pipeline_spec.rb' - - 'spec/scripts/lib/glfm/parse_examples_spec.rb' - - 'spec/scripts/lib/glfm/update_example_snapshots_spec.rb' - - 'spec/scripts/lib/glfm/update_specification_spec.rb' - 'spec/scripts/pipeline/average_reports_spec.rb' - 'spec/scripts/pipeline_test_report_builder_spec.rb' - 'spec/scripts/review_apps/automated_cleanup_spec.rb' diff --git a/.rubocop_todo/style/inline_disable_annotation.yml b/.rubocop_todo/style/inline_disable_annotation.yml index 5cf87d433d5c0b10c0253815eaba2abed1822685..ce74fd1f4eb1da9c48a79d9c180f12fffce498e0 100644 --- a/.rubocop_todo/style/inline_disable_annotation.yml +++ b/.rubocop_todo/style/inline_disable_annotation.yml @@ -2467,8 +2467,6 @@ Style/InlineDisableAnnotation: - 'scripts/insert-rspec-profiling-data' - 'scripts/internal_events/monitor.rb' - 'scripts/lib/gitlab.rb' - - 'scripts/lib/glfm/parse_examples.rb' - - 'scripts/lib/glfm/update_example_snapshots.rb' - 'scripts/perf/gc/print_gc_stats.rb' - 'scripts/rubocop-parse' - 'scripts/security-harness' @@ -2729,8 +2727,6 @@ Style/InlineDisableAnnotation: - 'spec/scripts/api/create_merge_request_discussion_spec.rb' - 'spec/scripts/api/create_merge_request_note_spec.rb' - 'spec/scripts/generate_message_to_run_e2e_pipeline_spec.rb' - - 'spec/scripts/lib/glfm/update_example_snapshots_spec.rb' - - 'spec/scripts/lib/glfm/update_specification_spec.rb' - 'spec/scripts/pipeline/average_reports_spec.rb' - 'spec/scripts/review_apps/automated_cleanup_spec.rb' - 'spec/scripts/trigger-build_spec.rb' diff --git a/.rubocop_todo/style/mutable_constant.yml b/.rubocop_todo/style/mutable_constant.yml index 54bd6f66b4406498c5ec4422c95f23bf5f754953..c38c4357ec46e6b623a48b4293814a69029df4a1 100644 --- a/.rubocop_todo/style/mutable_constant.yml +++ b/.rubocop_todo/style/mutable_constant.yml @@ -33,7 +33,6 @@ Style/MutableConstant: - 'lib/gitlab/sidekiq_signals.rb' - 'lib/gitlab/web_hooks/recursion_detection/uuid.rb' - 'lib/tasks/gitlab/backup.rake' - - 'scripts/lib/glfm/constants.rb' - 'scripts/lint-docs-blueprints.rb' - 'scripts/perf/gc/collect_gc_stats.rb' - 'spec/support/helpers/jira_integration_helpers.rb' diff --git a/doc/development/gitlab_flavored_markdown/specification_guide/index.md b/doc/development/gitlab_flavored_markdown/specification_guide/index.md deleted file mode 100644 index a04b39fb7f23275ec7e26b509e9291d6567dc17e..0000000000000000000000000000000000000000 --- a/doc/development/gitlab_flavored_markdown/specification_guide/index.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -stage: Plan -group: Knowledge -info: Any user with at least the Maintainer role can merge updates to this content. For details, see https://docs.gitlab.com/ee/development/development_processes.html#development-guidelines-review. -description: "Specification guide for GitLab Flavored Markdown (GLFM)." -remove_date: '2024-11-14' -redirect_to: '../index.md' ---- - - -# GitLab Flavored Markdown (GLFM) Specification Guide (removed) - -This page was [removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/162743) in 17.4. diff --git a/glfm_specification/README.md b/glfm_specification/README.md deleted file mode 100644 index 7e824d59d76852129a7655d7114c10615b597599..0000000000000000000000000000000000000000 --- a/glfm_specification/README.md +++ /dev/null @@ -1,5 +0,0 @@ -This directory contains the GitLab Flavored Markdown (GLFM) development guidelines. - -See the GitLab Flavored Markdown (GLFM) development guidelines for more information: - -https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/ diff --git a/glfm_specification/input/github_flavored_markdown/ghfm_spec_v_0.29.md b/glfm_specification/input/github_flavored_markdown/ghfm_spec_v_0.29.md deleted file mode 100644 index 1702761563ec48c004d27abcacec5734ed1756f8..0000000000000000000000000000000000000000 --- a/glfm_specification/input/github_flavored_markdown/ghfm_spec_v_0.29.md +++ /dev/null @@ -1,10226 +0,0 @@ ---- -title: GitHub Flavored Markdown Spec -version: 0.29 -date: '2019-04-06' -license: '[CC-BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)' -... - -# Introduction - -## What is GitHub Flavored Markdown? - -GitHub Flavored Markdown, often shortened as GFM, is the dialect of Markdown -that is currently supported for user content on GitHub.com and GitHub -Enterprise. - -This formal specification, based on the CommonMark Spec, defines the syntax and -semantics of this dialect. - -GFM is a strict superset of CommonMark. All the features which are supported in -GitHub user content and that are not specified on the original CommonMark Spec -are hence known as **extensions**, and highlighted as such. - -While GFM supports a wide range of inputs, it's worth noting that GitHub.com -and GitHub Enterprise perform additional post-processing and sanitization after -GFM is converted to HTML to ensure security and consistency of the website. - -## What is Markdown? - -Markdown is a plain text format for writing structured documents, -based on conventions for indicating formatting in email -and usenet posts. It was developed by John Gruber (with -help from Aaron Swartz) and released in 2004 in the form of a -[syntax description](http://daringfireball.net/projects/markdown/syntax) -and a Perl script (`Markdown.pl`) for converting Markdown to -HTML. In the next decade, dozens of implementations were -developed in many languages. Some extended the original -Markdown syntax with conventions for footnotes, tables, and -other document elements. Some allowed Markdown documents to be -rendered in formats other than HTML. Websites like Reddit, -StackOverflow, and GitHub had millions of people using Markdown. -And Markdown started to be used beyond the web, to author books, -articles, slide shows, letters, and lecture notes. - -What distinguishes Markdown from many other lightweight markup -syntaxes, which are often easier to write, is its readability. -As Gruber writes: - -> The overriding design goal for Markdown's formatting syntax is -> to make it as readable as possible. The idea is that a -> Markdown-formatted document should be publishable as-is, as -> plain text, without looking like it's been marked up with tags -> or formatting instructions. -> (<http://daringfireball.net/projects/markdown/>) - -The point can be illustrated by comparing a sample of -[AsciiDoc](http://www.methods.co.nz/asciidoc/) with -an equivalent sample of Markdown. Here is a sample of -AsciiDoc from the AsciiDoc manual: - -``` -1. List item one. -+ -List item one continued with a second paragraph followed by an -Indented block. -+ -................. -$ ls *.sh -$ mv *.sh ~/tmp -................. -+ -List item continued with a third paragraph. - -2. List item two continued with an open block. -+ --- -This paragraph is part of the preceding list item. - -a. This list is nested and does not require explicit item -continuation. -+ -This paragraph is part of the preceding list item. - -b. List item b. - -This paragraph belongs to item two of the outer list. --- -``` - -And here is the equivalent in Markdown: -``` -1. List item one. - - List item one continued with a second paragraph followed by an - Indented block. - - $ ls *.sh - $ mv *.sh ~/tmp - - List item continued with a third paragraph. - -2. List item two continued with an open block. - - This paragraph is part of the preceding list item. - - 1. This list is nested and does not require explicit item continuation. - - This paragraph is part of the preceding list item. - - 2. List item b. - - This paragraph belongs to item two of the outer list. -``` - -The AsciiDoc version is, arguably, easier to write. You don't need -to worry about indentation. But the Markdown version is much easier -to read. The nesting of list items is apparent to the eye in the -source, not just in the processed document. - -## Why is a spec needed? - -John Gruber's [canonical description of Markdown's -syntax](http://daringfireball.net/projects/markdown/syntax) -does not specify the syntax unambiguously. Here are some examples of -questions it does not answer: - -1. How much indentation is needed for a sublist? The spec says that - continuation paragraphs need to be indented four spaces, but is - not fully explicit about sublists. It is natural to think that - they, too, must be indented four spaces, but `Markdown.pl` does - not require that. This is hardly a "corner case," and divergences - between implementations on this issue often lead to surprises for - users in real documents. (See [this comment by John - Gruber](http://article.gmane.org/gmane.text.markdown.general/1997).) - -2. Is a blank line needed before a block quote or heading? - Most implementations do not require the blank line. However, - this can lead to unexpected results in hard-wrapped text, and - also to ambiguities in parsing (note that some implementations - put the heading inside the blockquote, while others do not). - (John Gruber has also spoken [in favor of requiring the blank - lines](http://article.gmane.org/gmane.text.markdown.general/2146).) - -3. Is a blank line needed before an indented code block? - (`Markdown.pl` requires it, but this is not mentioned in the - documentation, and some implementations do not require it.) - - ``` markdown - paragraph - code? - ``` - -4. What is the exact rule for determining when list items get - wrapped in `<p>` tags? Can a list be partially "loose" and partially - "tight"? What should we do with a list like this? - - ``` markdown - 1. one - - 2. two - 3. three - ``` - - Or this? - - ``` markdown - 1. one - - a - - - b - 2. two - ``` - - (There are some relevant comments by John Gruber - [here](http://article.gmane.org/gmane.text.markdown.general/2554).) - -5. Can list markers be indented? Can ordered list markers be right-aligned? - - ``` markdown - 8. item 1 - 9. item 2 - 10. item 2a - ``` - -6. Is this one list with a thematic break in its second item, - or two lists separated by a thematic break? - - ``` markdown - * a - * * * * * - * b - ``` - -7. When list markers change from numbers to bullets, do we have - two lists or one? (The Markdown syntax description suggests two, - but the perl scripts and many other implementations produce one.) - - ``` markdown - 1. fee - 2. fie - - foe - - fum - ``` - -8. What are the precedence rules for the markers of inline structure? - For example, is the following a valid link, or does the code span - take precedence ? - - ``` markdown - [a backtick (`)](/url) and [another backtick (`)](/url). - ``` - -9. What are the precedence rules for markers of emphasis and strong - emphasis? For example, how should the following be parsed? - - ``` markdown - *foo *bar* baz* - ``` - -10. What are the precedence rules between block-level and inline-level - structure? For example, how should the following be parsed? - - ``` markdown - - `a long code span can contain a hyphen like this - - and it can screw things up` - ``` - -11. Can list items include section headings? (`Markdown.pl` does not - allow this, but does allow blockquotes to include headings.) - - ``` markdown - - # Heading - ``` - -12. Can list items be empty? - - ``` markdown - * a - * - * b - ``` - -13. Can link references be defined inside block quotes or list items? - - ``` markdown - > Blockquote [foo]. - > - > [foo]: /url - ``` - -14. If there are multiple definitions for the same reference, which takes - precedence? - - ``` markdown - [foo]: /url1 - [foo]: /url2 - - [foo][] - ``` - -In the absence of a spec, early implementers consulted `Markdown.pl` -to resolve these ambiguities. But `Markdown.pl` was quite buggy, and -gave manifestly bad results in many cases, so it was not a -satisfactory replacement for a spec. - -Because there is no unambiguous spec, implementations have diverged -considerably. As a result, users are often surprised to find that -a document that renders one way on one system (say, a GitHub wiki) -renders differently on another (say, converting to docbook using -pandoc). To make matters worse, because nothing in Markdown counts -as a "syntax error," the divergence often isn't discovered right away. - -## About this document - -This document attempts to specify Markdown syntax unambiguously. -It contains many examples with side-by-side Markdown and -HTML. These are intended to double as conformance tests. An -accompanying script `spec_tests.py` can be used to run the tests -against any Markdown program: - - python test/spec_tests.py --spec spec.txt --program PROGRAM - -Since this document describes how Markdown is to be parsed into -an abstract syntax tree, it would have made sense to use an abstract -representation of the syntax tree instead of HTML. But HTML is capable -of representing the structural distinctions we need to make, and the -choice of HTML for the tests makes it possible to run the tests against -an implementation without writing an abstract syntax tree renderer. - -This document is generated from a text file, `spec.txt`, written -in Markdown with a small extension for the side-by-side tests. -The script `tools/makespec.py` can be used to convert `spec.txt` into -HTML or CommonMark (which can then be converted into other formats). - -In the examples, the `→` character is used to represent tabs. - -# Preliminaries - -## Characters and lines - -Any sequence of [characters] is a valid CommonMark -document. - -A [character](@) is a Unicode code point. Although some -code points (for example, combining accents) do not correspond to -characters in an intuitive sense, all code points count as characters -for purposes of this spec. - -This spec does not specify an encoding; it thinks of lines as composed -of [characters] rather than bytes. A conforming parser may be limited -to a certain encoding. - -A [line](@) is a sequence of zero or more [characters] -other than newline (`U+000A`) or carriage return (`U+000D`), -followed by a [line ending] or by the end of file. - -A [line ending](@) is a newline (`U+000A`), a carriage return -(`U+000D`) not followed by a newline, or a carriage return and a -following newline. - -A line containing no characters, or a line containing only spaces -(`U+0020`) or tabs (`U+0009`), is called a [blank line](@). - -The following definitions of character classes will be used in this spec: - -A [whitespace character](@) is a space -(`U+0020`), tab (`U+0009`), newline (`U+000A`), line tabulation (`U+000B`), -form feed (`U+000C`), or carriage return (`U+000D`). - -[Whitespace](@) is a sequence of one or more [whitespace -characters]. - -A [Unicode whitespace character](@) is -any code point in the Unicode `Zs` general category, or a tab (`U+0009`), -carriage return (`U+000D`), newline (`U+000A`), or form feed -(`U+000C`). - -[Unicode whitespace](@) is a sequence of one -or more [Unicode whitespace characters]. - -A [space](@) is `U+0020`. - -A [non-whitespace character](@) is any character -that is not a [whitespace character]. - -An [ASCII punctuation character](@) -is `!`, `"`, `#`, `$`, `%`, `&`, `'`, `(`, `)`, -`*`, `+`, `,`, `-`, `.`, `/` (U+0021–2F), -`:`, `;`, `<`, `=`, `>`, `?`, `@` (U+003A–0040), -`[`, `\`, `]`, `^`, `_`, `` ` `` (U+005B–0060), -`{`, `|`, `}`, or `~` (U+007B–007E). - -A [punctuation character](@) is an [ASCII -punctuation character] or anything in -the general Unicode categories `Pc`, `Pd`, `Pe`, `Pf`, `Pi`, `Po`, or `Ps`. - -## Tabs - -Tabs in lines are not expanded to [spaces]. However, -in contexts where whitespace helps to define block structure, -tabs behave as if they were replaced by spaces with a tab stop -of 4 characters. - -Thus, for example, a tab can be used instead of four spaces -in an indented code block. (Note, however, that internal -tabs are passed through as literal tabs, not expanded to -spaces.) - -```````````````````````````````` example -→foo→baz→→bim -. -<pre><code>foo→baz→→bim -</code></pre> -```````````````````````````````` - -```````````````````````````````` example - →foo→baz→→bim -. -<pre><code>foo→baz→→bim -</code></pre> -```````````````````````````````` - -```````````````````````````````` example - a→a - á½â†’a -. -<pre><code>a→a -á½â†’a -</code></pre> -```````````````````````````````` - -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: - -```````````````````````````````` example - - foo - -→bar -. -<ul> -<li> -<p>foo</p> -<p>bar</p> -</li> -</ul> -```````````````````````````````` - -```````````````````````````````` example -- foo - -→→bar -. -<ul> -<li> -<p>foo</p> -<pre><code> bar -</code></pre> -</li> -</ul> -```````````````````````````````` - -Normally the `>` that begins a block quote may be followed -optionally by a space, which is not considered part of the -content. In the following case `>` is followed by a tab, -which is treated as if it were expanded into three spaces. -Since one of these spaces is considered part of the -delimiter, `foo` is considered to be indented six spaces -inside the block quote context, so we get an indented -code block starting with two spaces. - -```````````````````````````````` example ->→→foo -. -<blockquote> -<pre><code> foo -</code></pre> -</blockquote> -```````````````````````````````` - -```````````````````````````````` example --→→foo -. -<ul> -<li> -<pre><code> foo -</code></pre> -</li> -</ul> -```````````````````````````````` - - -```````````````````````````````` example - foo -→bar -. -<pre><code>foo -bar -</code></pre> -```````````````````````````````` - -```````````````````````````````` example - - foo - - bar -→ - baz -. -<ul> -<li>foo -<ul> -<li>bar -<ul> -<li>baz</li> -</ul> -</li> -</ul> -</li> -</ul> -```````````````````````````````` - -```````````````````````````````` example -#→Foo -. -<h1>Foo</h1> -```````````````````````````````` - -```````````````````````````````` example -*→*→*→ -. -<hr /> -```````````````````````````````` - - -## Insecure characters - -For security reasons, the Unicode character `U+0000` must be replaced -with the REPLACEMENT CHARACTER (`U+FFFD`). - -# Blocks and inlines - -We can think of a document as a sequence of -[blocks](@)---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 [inline](@) content---text, -links, emphasized text, images, code spans, and so on. - -## Precedence - -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: - -```````````````````````````````` example -- `one -- two` -. -<ul> -<li>`one</li> -<li>two`</li> -</ul> -```````````````````````````````` - - -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 -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. - -## Container blocks and leaf blocks - -We can divide blocks into two types: -[container blocks](@), -which can contain other blocks, and [leaf blocks](@), -which cannot. - -# Leaf blocks - -This section describes the different kinds of leaf block that make up a -Markdown document. - -## Thematic breaks - -A line consisting of 0-3 spaces of indentation, followed by a sequence -of three or more matching `-`, `_`, or `*` characters, each followed -optionally by any number of spaces or tabs, forms a -[thematic break](@). - -```````````````````````````````` example -*** ---- -___ -. -<hr /> -<hr /> -<hr /> -```````````````````````````````` - - -Wrong characters: - -```````````````````````````````` example -+++ -. -<p>+++</p> -```````````````````````````````` - - -```````````````````````````````` example -=== -. -<p>===</p> -```````````````````````````````` - - -Not enough characters: - -```````````````````````````````` example --- -** -__ -. -<p>-- -** -__</p> -```````````````````````````````` - - -One to three spaces indent are allowed: - -```````````````````````````````` example - *** - *** - *** -. -<hr /> -<hr /> -<hr /> -```````````````````````````````` - - -Four spaces is too many: - -```````````````````````````````` example - *** -. -<pre><code>*** -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example -Foo - *** -. -<p>Foo -***</p> -```````````````````````````````` - - -More than three characters may be used: - -```````````````````````````````` example -_____________________________________ -. -<hr /> -```````````````````````````````` - - -Spaces are allowed between the characters: - -```````````````````````````````` example - - - - -. -<hr /> -```````````````````````````````` - - -```````````````````````````````` example - ** * ** * ** * ** -. -<hr /> -```````````````````````````````` - - -```````````````````````````````` example -- - - - -. -<hr /> -```````````````````````````````` - - -Spaces are allowed at the end: - -```````````````````````````````` example -- - - - -. -<hr /> -```````````````````````````````` - - -However, no other characters may occur in the line: - -```````````````````````````````` example -_ _ _ _ a - -a------ - ----a--- -. -<p>_ _ _ _ a</p> -<p>a------</p> -<p>---a---</p> -```````````````````````````````` - - -It is required that all of the [non-whitespace characters] be the same. -So, this is not a thematic break: - -```````````````````````````````` example - *-* -. -<p><em>-</em></p> -```````````````````````````````` - - -Thematic breaks do not need blank lines before or after: - -```````````````````````````````` example -- foo -*** -- bar -. -<ul> -<li>foo</li> -</ul> -<hr /> -<ul> -<li>bar</li> -</ul> -```````````````````````````````` - - -Thematic breaks can interrupt a paragraph: - -```````````````````````````````` example -Foo -*** -bar -. -<p>Foo</p> -<hr /> -<p>bar</p> -```````````````````````````````` - - -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: - -```````````````````````````````` example -Foo ---- -bar -. -<h2>Foo</h2> -<p>bar</p> -```````````````````````````````` - - -When both a thematic break and a list item are possible -interpretations of a line, the thematic break takes precedence: - -```````````````````````````````` example -* Foo -* * * -* Bar -. -<ul> -<li>Foo</li> -</ul> -<hr /> -<ul> -<li>Bar</li> -</ul> -```````````````````````````````` - - -If you want a thematic break in a list item, use a different bullet: - -```````````````````````````````` example -- Foo -- * * * -. -<ul> -<li>Foo</li> -<li> -<hr /> -</li> -</ul> -```````````````````````````````` - - -## ATX headings - -An [ATX heading](@) -consists of a string of characters, parsed as inline content, between an -opening sequence of 1--6 unescaped `#` characters and an optional -closing sequence of any number of unescaped `#` characters. -The opening sequence of `#` characters must be followed by a -[space] or by the end of line. The optional closing sequence of `#`s must be -preceded by a [space] and may be followed by spaces only. The opening -`#` character may be indented 0-3 spaces. The raw contents of the -heading are stripped of leading and trailing spaces before being parsed -as inline content. The heading level is equal to the number of `#` -characters in the opening sequence. - -Simple headings: - -```````````````````````````````` example -# foo -## foo -### foo -#### foo -##### foo -###### foo -. -<h1>foo</h1> -<h2>foo</h2> -<h3>foo</h3> -<h4>foo</h4> -<h5>foo</h5> -<h6>foo</h6> -```````````````````````````````` - - -More than six `#` characters is not a heading: - -```````````````````````````````` example -####### foo -. -<p>####### foo</p> -```````````````````````````````` - - -At least one space is required between the `#` 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 -[original ATX implementation](http://www.aaronsw.com/2002/atx/atx.py), -and it helps prevent things like the following from being parsed as -headings: - -```````````````````````````````` example -#5 bolt - -#hashtag -. -<p>#5 bolt</p> -<p>#hashtag</p> -```````````````````````````````` - - -This is not a heading, because the first `#` is escaped: - -```````````````````````````````` example -\## foo -. -<p>## foo</p> -```````````````````````````````` - - -Contents are parsed as inlines: - -```````````````````````````````` example -# foo *bar* \*baz\* -. -<h1>foo <em>bar</em> *baz*</h1> -```````````````````````````````` - - -Leading and trailing [whitespace] is ignored in parsing inline content: - -```````````````````````````````` example -# foo -. -<h1>foo</h1> -```````````````````````````````` - - -One to three spaces indentation are allowed: - -```````````````````````````````` example - ### foo - ## foo - # foo -. -<h3>foo</h3> -<h2>foo</h2> -<h1>foo</h1> -```````````````````````````````` - - -Four spaces are too much: - -```````````````````````````````` example - # foo -. -<pre><code># foo -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example -foo - # bar -. -<p>foo -# bar</p> -```````````````````````````````` - - -A closing sequence of `#` characters is optional: - -```````````````````````````````` example -## foo ## - ### bar ### -. -<h2>foo</h2> -<h3>bar</h3> -```````````````````````````````` - - -It need not be the same length as the opening sequence: - -```````````````````````````````` example -# foo ################################## -##### foo ## -. -<h1>foo</h1> -<h5>foo</h5> -```````````````````````````````` - - -Spaces are allowed after the closing sequence: - -```````````````````````````````` example -### foo ### -. -<h3>foo</h3> -```````````````````````````````` - - -A sequence of `#` characters with anything but [spaces] following it -is not a closing sequence, but counts as part of the contents of the -heading: - -```````````````````````````````` example -### foo ### b -. -<h3>foo ### b</h3> -```````````````````````````````` - - -The closing sequence must be preceded by a space: - -```````````````````````````````` example -# foo# -. -<h1>foo#</h1> -```````````````````````````````` - - -Backslash-escaped `#` characters do not count as part -of the closing sequence: - -```````````````````````````````` example -### foo \### -## foo #\## -# foo \# -. -<h3>foo ###</h3> -<h2>foo ###</h2> -<h1>foo #</h1> -```````````````````````````````` - - -ATX headings need not be separated from surrounding content by blank -lines, and they can interrupt paragraphs: - -```````````````````````````````` example -**** -## foo -**** -. -<hr /> -<h2>foo</h2> -<hr /> -```````````````````````````````` - - -```````````````````````````````` example -Foo bar -# baz -Bar foo -. -<p>Foo bar</p> -<h1>baz</h1> -<p>Bar foo</p> -```````````````````````````````` - - -ATX headings can be empty: - -```````````````````````````````` example -## -# -### ### -. -<h2></h2> -<h1></h1> -<h3></h3> -```````````````````````````````` - - -## Setext headings - -A [setext heading](@) 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 -that, were they not followed by the setext heading underline, -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]. - -A [setext heading underline](@) is a sequence of -`=` characters or a sequence of `-` characters, with no more than 3 -spaces indentation and any number of trailing spaces. If a line -containing a single `-` can be interpreted as an -empty [list items], it should be interpreted this way -and not as a [setext heading underline]. - -The heading is a level 1 heading if `=` characters are used in -the [setext heading underline], and a level 2 heading if `-` -characters are used. The contents of the heading are the result -of parsing the preceding lines of text as CommonMark inline -content. - -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. - -Simple examples: - -```````````````````````````````` example -Foo *bar* -========= - -Foo *bar* ---------- -. -<h1>Foo <em>bar</em></h1> -<h2>Foo <em>bar</em></h2> -```````````````````````````````` - - -The content of the header may span more than one line: - -```````````````````````````````` example -Foo *bar -baz* -==== -. -<h1>Foo <em>bar -baz</em></h1> -```````````````````````````````` - -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]. - -```````````````````````````````` example - Foo *bar -baz*→ -==== -. -<h1>Foo <em>bar -baz</em></h1> -```````````````````````````````` - - -The underlining can be any length: - -```````````````````````````````` example -Foo -------------------------- - -Foo -= -. -<h2>Foo</h2> -<h1>Foo</h1> -```````````````````````````````` - - -The heading content can be indented up to three spaces, and need -not line up with the underlining: - -```````````````````````````````` example - Foo ---- - - Foo ------ - - Foo - === -. -<h2>Foo</h2> -<h2>Foo</h2> -<h1>Foo</h1> -```````````````````````````````` - - -Four spaces indent is too much: - -```````````````````````````````` example - Foo - --- - - Foo ---- -. -<pre><code>Foo ---- - -Foo -</code></pre> -<hr /> -```````````````````````````````` - - -The setext heading underline can be indented up to three spaces, and -may have trailing spaces: - -```````````````````````````````` example -Foo - ---- -. -<h2>Foo</h2> -```````````````````````````````` - - -Four spaces is too much: - -```````````````````````````````` example -Foo - --- -. -<p>Foo ----</p> -```````````````````````````````` - - -The setext heading underline cannot contain internal spaces: - -```````````````````````````````` example -Foo -= = - -Foo ---- - -. -<p>Foo -= =</p> -<p>Foo</p> -<hr /> -```````````````````````````````` - - -Trailing spaces in the content line do not cause a line break: - -```````````````````````````````` example -Foo ------ -. -<h2>Foo</h2> -```````````````````````````````` - - -Nor does a backslash at the end: - -```````````````````````````````` example -Foo\ ----- -. -<h2>Foo\</h2> -```````````````````````````````` - - -Since indicators of block structure take precedence over -indicators of inline structure, the following are setext headings: - -```````````````````````````````` example -`Foo ----- -` - -<a title="a lot ---- -of dashes"/> -. -<h2>`Foo</h2> -<p>`</p> -<h2><a title="a lot</h2> -<p>of dashes"/></p> -```````````````````````````````` - - -The setext heading underline cannot be a [lazy continuation -line] in a list item or block quote: - -```````````````````````````````` example -> Foo ---- -. -<blockquote> -<p>Foo</p> -</blockquote> -<hr /> -```````````````````````````````` - - -```````````````````````````````` example -> foo -bar -=== -. -<blockquote> -<p>foo -bar -===</p> -</blockquote> -```````````````````````````````` - - -```````````````````````````````` example -- Foo ---- -. -<ul> -<li>Foo</li> -</ul> -<hr /> -```````````````````````````````` - - -A blank line is needed between a paragraph and a following -setext heading, since otherwise the paragraph becomes part -of the heading's content: - -```````````````````````````````` example -Foo -Bar ---- -. -<h2>Foo -Bar</h2> -```````````````````````````````` - - -But in general a blank line is not required before or after -setext headings: - -```````````````````````````````` example ---- -Foo ---- -Bar ---- -Baz -. -<hr /> -<h2>Foo</h2> -<h2>Bar</h2> -<p>Baz</p> -```````````````````````````````` - - -Setext headings cannot be empty: - -```````````````````````````````` example - -==== -. -<p>====</p> -```````````````````````````````` - - -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: - -```````````````````````````````` example ---- ---- -. -<hr /> -<hr /> -```````````````````````````````` - - -```````````````````````````````` example -- foo ------ -. -<ul> -<li>foo</li> -</ul> -<hr /> -```````````````````````````````` - - -```````````````````````````````` example - foo ---- -. -<pre><code>foo -</code></pre> -<hr /> -```````````````````````````````` - - -```````````````````````````````` example -> foo ------ -. -<blockquote> -<p>foo</p> -</blockquote> -<hr /> -```````````````````````````````` - - -If you want a heading with `> foo` as its literal text, you can -use backslash escapes: - -```````````````````````````````` example -\> foo ------- -. -<h2>> foo</h2> -```````````````````````````````` - - -**Compatibility note:** 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 - -``` markdown -Foo -bar ---- -baz -``` - -One can find four different interpretations: - -1. paragraph "Foo", heading "bar", paragraph "baz" -2. paragraph "Foo bar", thematic break, paragraph "baz" -3. paragraph "Foo bar --- baz" -4. heading "Foo bar", paragraph "baz" - -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: - -```````````````````````````````` example -Foo - -bar ---- -baz -. -<p>Foo</p> -<h2>bar</h2> -<p>baz</p> -```````````````````````````````` - - -Authors who want interpretation 2 can put blank lines around -the thematic break, - -```````````````````````````````` example -Foo -bar - ---- - -baz -. -<p>Foo -bar</p> -<hr /> -<p>baz</p> -```````````````````````````````` - - -or use a thematic break that cannot count as a [setext heading -underline], such as - -```````````````````````````````` example -Foo -bar -* * * -baz -. -<p>Foo -bar</p> -<hr /> -<p>baz</p> -```````````````````````````````` - - -Authors who want interpretation 3 can use backslash escapes: - -```````````````````````````````` example -Foo -bar -\--- -baz -. -<p>Foo -bar ---- -baz</p> -```````````````````````````````` - - -## Indented code blocks - -An [indented code block](@) is composed of one or more -[indented chunks] separated by blank lines. -An [indented chunk](@) 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]. - -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.) - -```````````````````````````````` example - a simple - indented code block -. -<pre><code>a simple - indented code block -</code></pre> -```````````````````````````````` - - -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: - -```````````````````````````````` example - - foo - - bar -. -<ul> -<li> -<p>foo</p> -<p>bar</p> -</li> -</ul> -```````````````````````````````` - - -```````````````````````````````` example -1. foo - - - bar -. -<ol> -<li> -<p>foo</p> -<ul> -<li>bar</li> -</ul> -</li> -</ol> -```````````````````````````````` - - - -The contents of a code block are literal text, and do not get parsed -as Markdown: - -```````````````````````````````` example - <a/> - *hi* - - - one -. -<pre><code><a/> -*hi* - -- one -</code></pre> -```````````````````````````````` - - -Here we have three chunks separated by blank lines: - -```````````````````````````````` example - chunk1 - - chunk2 - - - - chunk3 -. -<pre><code>chunk1 - -chunk2 - - - -chunk3 -</code></pre> -```````````````````````````````` - - -Any initial spaces beyond four will be included in the content, even -in interior blank lines: - -```````````````````````````````` example - chunk1 - - chunk2 -. -<pre><code>chunk1 - - chunk2 -</code></pre> -```````````````````````````````` - - -An indented code block cannot interrupt a paragraph. (This -allows hanging indents and the like.) - -```````````````````````````````` example -Foo - bar - -. -<p>Foo -bar</p> -```````````````````````````````` - - -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: - -```````````````````````````````` example - foo -bar -. -<pre><code>foo -</code></pre> -<p>bar</p> -```````````````````````````````` - - -And indented code can occur immediately before and after other kinds of -blocks: - -```````````````````````````````` example -# Heading - foo -Heading ------- - foo ----- -. -<h1>Heading</h1> -<pre><code>foo -</code></pre> -<h2>Heading</h2> -<pre><code>foo -</code></pre> -<hr /> -```````````````````````````````` - - -The first line can be indented more than four spaces: - -```````````````````````````````` example - foo - bar -. -<pre><code> foo -bar -</code></pre> -```````````````````````````````` - - -Blank lines preceding or following an indented code block -are not included in it: - -```````````````````````````````` example - - - foo - - -. -<pre><code>foo -</code></pre> -```````````````````````````````` - - -Trailing spaces are included in the code block's content: - -```````````````````````````````` example - foo -. -<pre><code>foo -</code></pre> -```````````````````````````````` - - - -## Fenced code blocks - -A [code fence](@) is a sequence -of at least three consecutive backtick characters (`` ` ``) or -tildes (`~`). (Tildes and backticks cannot be mixed.) -A [fenced code block](@) -begins with a code fence, indented no more than three spaces. - -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 [info string](@). 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.) - -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 -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.) - -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 -opening code fence until the end of the containing block (or -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.) - -A fenced code block may interrupt a paragraph, and does not require -a blank line either before or after. - -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 `class` -attribute of the `code` tag. However, this spec does not mandate any -particular treatment of the [info string]. - -Here is a simple example with backticks: - -```````````````````````````````` example -``` -< - > -``` -. -<pre><code>< - > -</code></pre> -```````````````````````````````` - - -With tildes: - -```````````````````````````````` example -~~~ -< - > -~~~ -. -<pre><code>< - > -</code></pre> -```````````````````````````````` - -Fewer than three backticks is not enough: - -```````````````````````````````` example -`` -foo -`` -. -<p><code>foo</code></p> -```````````````````````````````` - -The closing code fence must use the same character as the opening -fence: - -```````````````````````````````` example -``` -aaa -~~~ -``` -. -<pre><code>aaa -~~~ -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example -~~~ -aaa -``` -~~~ -. -<pre><code>aaa -``` -</code></pre> -```````````````````````````````` - - -The closing code fence must be at least as long as the opening fence: - -```````````````````````````````` example -```` -aaa -``` -`````` -. -<pre><code>aaa -``` -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example -~~~~ -aaa -~~~ -~~~~ -. -<pre><code>aaa -~~~ -</code></pre> -```````````````````````````````` - - -Unclosed code blocks are closed by the end of the document -(or the enclosing [block quote][block quotes] or [list item][list items]): - -```````````````````````````````` example -``` -. -<pre><code></code></pre> -```````````````````````````````` - - -```````````````````````````````` example -````` - -``` -aaa -. -<pre><code> -``` -aaa -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example -> ``` -> aaa - -bbb -. -<blockquote> -<pre><code>aaa -</code></pre> -</blockquote> -<p>bbb</p> -```````````````````````````````` - - -A code block can have all empty lines as its content: - -```````````````````````````````` example -``` - - -``` -. -<pre><code> - -</code></pre> -```````````````````````````````` - - -A code block can be empty: - -```````````````````````````````` example -``` -``` -. -<pre><code></code></pre> -```````````````````````````````` - - -Fences can be indented. If the opening fence is indented, -content lines will have equivalent opening indentation removed, -if present: - -```````````````````````````````` example - ``` - aaa -aaa -``` -. -<pre><code>aaa -aaa -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example - ``` -aaa - aaa -aaa - ``` -. -<pre><code>aaa -aaa -aaa -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example - ``` - aaa - aaa - aaa - ``` -. -<pre><code>aaa - aaa -aaa -</code></pre> -```````````````````````````````` - - -Four spaces indentation produces an indented code block: - -```````````````````````````````` example - ``` - aaa - ``` -. -<pre><code>``` -aaa -``` -</code></pre> -```````````````````````````````` - - -Closing fences may be indented by 0-3 spaces, and their indentation -need not match that of the opening fence: - -```````````````````````````````` example -``` -aaa - ``` -. -<pre><code>aaa -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example - ``` -aaa - ``` -. -<pre><code>aaa -</code></pre> -```````````````````````````````` - - -This is not a closing fence, because it is indented 4 spaces: - -```````````````````````````````` example -``` -aaa - ``` -. -<pre><code>aaa - ``` -</code></pre> -```````````````````````````````` - - - -Code fences (opening and closing) cannot contain internal spaces: - -```````````````````````````````` example -``` ``` -aaa -. -<p><code> </code> -aaa</p> -```````````````````````````````` - - -```````````````````````````````` example -~~~~~~ -aaa -~~~ ~~ -. -<pre><code>aaa -~~~ ~~ -</code></pre> -```````````````````````````````` - - -Fenced code blocks can interrupt paragraphs, and can be followed -directly by paragraphs, without a blank line between: - -```````````````````````````````` example -foo -``` -bar -``` -baz -. -<p>foo</p> -<pre><code>bar -</code></pre> -<p>baz</p> -```````````````````````````````` - - -Other blocks can also occur before and after fenced code blocks -without an intervening blank line: - -```````````````````````````````` example -foo ---- -~~~ -bar -~~~ -# baz -. -<h2>foo</h2> -<pre><code>bar -</code></pre> -<h1>baz</h1> -```````````````````````````````` - - -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` element consisting -of `language-` followed by the language name. - -```````````````````````````````` example -```ruby -def foo(x) - return 3 -end -``` -. -<pre><code class="language-ruby">def foo(x) - return 3 -end -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example -~~~~ ruby startline=3 $%@#$ -def foo(x) - return 3 -end -~~~~~~~ -. -<pre><code class="language-ruby">def foo(x) - return 3 -end -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example -````; -```` -. -<pre><code class="language-;"></code></pre> -```````````````````````````````` - - -[Info strings] for backtick code blocks cannot contain backticks: - -```````````````````````````````` example -``` aa ``` -foo -. -<p><code>aa</code> -foo</p> -```````````````````````````````` - - -[Info strings] for tilde code blocks can contain backticks and tildes: - -```````````````````````````````` example -~~~ aa ``` ~~~ -foo -~~~ -. -<pre><code class="language-aa">foo -</code></pre> -```````````````````````````````` - - -Closing code fences cannot have [info strings]: - -```````````````````````````````` example -``` -``` aaa -``` -. -<pre><code>``` aaa -</code></pre> -```````````````````````````````` - - - -## HTML blocks - -An [HTML block](@) is a group of lines that is treated -as raw HTML (and will not be escaped in HTML output). - -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 -[start condition](@) (after up to three spaces optional indentation). -It ends with the first subsequent line that meets a matching [end -condition](@), or the last line of the document, or the last line of -the [container block](#container-blocks) 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. - -1. **Start condition:** line begins with the string `<script`, -`<pre`, or `<style` (case-insensitive), followed by whitespace, -the string `>`, or the end of the line.\ -**End condition:** line contains an end tag -`</script>`, `</pre>`, or `</style>` (case-insensitive; it -need not match the start tag). - -2. **Start condition:** line begins with the string `<!--`.\ -**End condition:** line contains the string `-->`. - -3. **Start condition:** line begins with the string `<?`.\ -**End condition:** line contains the string `?>`. - -4. **Start condition:** line begins with the string `<!` -followed by an uppercase ASCII letter.\ -**End condition:** line contains the character `>`. - -5. **Start condition:** line begins with the string -`<![CDATA[`.\ -**End condition:** line contains the string `]]>`. - -6. **Start condition:** line begins the string `<` or `</` -followed by one of the strings (case-insensitive) `address`, -`article`, `aside`, `base`, `basefont`, `blockquote`, `body`, -`caption`, `center`, `col`, `colgroup`, `dd`, `details`, `dialog`, -`dir`, `div`, `dl`, `dt`, `fieldset`, `figcaption`, `figure`, -`footer`, `form`, `frame`, `frameset`, -`h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `head`, `header`, `hr`, -`html`, `iframe`, `legend`, `li`, `link`, `main`, `menu`, `menuitem`, -`nav`, `noframes`, `ol`, `optgroup`, `option`, `p`, `param`, -`section`, `summary`, `table`, `tbody`, `td`, -`tfoot`, `th`, `thead`, `title`, `tr`, `track`, `ul`, followed -by [whitespace], the end of the line, the string `>`, or -the string `/>`.\ -**End condition:** line is followed by a [blank line]. - -7. **Start condition:** line begins with a complete [open tag] -(with any [tag name] other than `script`, -`style`, or `pre`) or a complete [closing tag], -followed only by [whitespace] or the end of the line.\ -**End condition:** line is followed by a [blank line]. - -HTML blocks continue until they are closed by their appropriate -[end condition], or the last line of the document or other [container -block](#container-blocks). This means any HTML **within an HTML -block** 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. - -For instance, `<pre>` within a HTML block started by `<table>` 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: - -```````````````````````````````` example -<table><tr><td> -<pre> -**Hello**, - -_world_. -</pre> -</td></tr></table> -. -<table><tr><td> -<pre> -**Hello**, -<p><em>world</em>. -</pre></p> -</td></tr></table> -```````````````````````````````` - -In this case, the HTML block is terminated by the newline — the `**Hello**` -text remains verbatim — and regular parsing resumes, with a paragraph, -emphasised `world` and inline and block HTML following. - -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.) - -Some simple examples follow. Here are some basic HTML blocks -of type 6: - -```````````````````````````````` example -<table> - <tr> - <td> - hi - </td> - </tr> -</table> - -okay. -. -<table> - <tr> - <td> - hi - </td> - </tr> -</table> -<p>okay.</p> -```````````````````````````````` - - -```````````````````````````````` example - <div> - *hello* - <foo><a> -. - <div> - *hello* - <foo><a> -```````````````````````````````` - - -A block can also start with a closing tag: - -```````````````````````````````` example -</div> -*foo* -. -</div> -*foo* -```````````````````````````````` - - -Here we have two HTML blocks with a Markdown paragraph between them: - -```````````````````````````````` example -<DIV CLASS="foo"> - -*Markdown* - -</DIV> -. -<DIV CLASS="foo"> -<p><em>Markdown</em></p> -</DIV> -```````````````````````````````` - - -The tag on the first line can be partial, as long -as it is split where there would be whitespace: - -```````````````````````````````` example -<div id="foo" - class="bar"> -</div> -. -<div id="foo" - class="bar"> -</div> -```````````````````````````````` - - -```````````````````````````````` example -<div id="foo" class="bar - baz"> -</div> -. -<div id="foo" class="bar - baz"> -</div> -```````````````````````````````` - - -An open tag need not be closed: -```````````````````````````````` example -<div> -*foo* - -*bar* -. -<div> -*foo* -<p><em>bar</em></p> -```````````````````````````````` - - - -A partial tag need not even be completed (garbage -in, garbage out): - -```````````````````````````````` example -<div id="foo" -*hi* -. -<div id="foo" -*hi* -```````````````````````````````` - - -```````````````````````````````` example -<div class -foo -. -<div class -foo -```````````````````````````````` - - -The initial tag doesn't even need to be a valid -tag, as long as it starts like one: - -```````````````````````````````` example -<div *???-&&&-<--- -*foo* -. -<div *???-&&&-<--- -*foo* -```````````````````````````````` - - -In type 6 blocks, the initial tag need not be on a line by -itself: - -```````````````````````````````` example -<div><a href="bar">*foo*</a></div> -. -<div><a href="bar">*foo*</a></div> -```````````````````````````````` - - -```````````````````````````````` example -<table><tr><td> -foo -</td></tr></table> -. -<table><tr><td> -foo -</td></tr></table> -```````````````````````````````` - - -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: - -```````````````````````````````` example -<div></div> -``` c -int x = 33; -``` -. -<div></div> -``` c -int x = 33; -``` -```````````````````````````````` - - -To start an [HTML block] with a tag that is *not* 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): - -```````````````````````````````` example -<a href="foo"> -*bar* -</a> -. -<a href="foo"> -*bar* -</a> -```````````````````````````````` - - -In type 7 blocks, the [tag name] can be anything: - -```````````````````````````````` example -<Warning> -*bar* -</Warning> -. -<Warning> -*bar* -</Warning> -```````````````````````````````` - - -```````````````````````````````` example -<i class="foo"> -*bar* -</i> -. -<i class="foo"> -*bar* -</i> -```````````````````````````````` - - -```````````````````````````````` example -</ins> -*bar* -. -</ins> -*bar* -```````````````````````````````` - - -These rules are designed to allow us to work with tags that -can function as either block-level or inline-level tags. -The `<del>` tag is a nice example. We can surround content with -`<del>` tags in three different ways. In this case, we get a raw -HTML block, because the `<del>` tag is on a line by itself: - -```````````````````````````````` example -<del> -*foo* -</del> -. -<del> -*foo* -</del> -```````````````````````````````` - - -In this case, we get a raw HTML block that just includes -the `<del>` tag (because it ends with the following blank -line). So the contents get interpreted as CommonMark: - -```````````````````````````````` example -<del> - -*foo* - -</del> -. -<del> -<p><em>foo</em></p> -</del> -```````````````````````````````` - - -Finally, in this case, the `<del>` tags are interpreted -as [raw HTML] *inside* the CommonMark paragraph. (Because -the tag is not on a line by itself, we get inline HTML -rather than an [HTML block].) - -```````````````````````````````` example -<del>*foo*</del> -. -<p><del><em>foo</em></del></p> -```````````````````````````````` - - -HTML tags designed to contain literal content -(`script`, `style`, `pre`), 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: - -A pre tag (type 1): - -```````````````````````````````` example -<pre language="haskell"><code> -import Text.HTML.TagSoup - -main :: IO () -main = print $ parseTags tags -</code></pre> -okay -. -<pre language="haskell"><code> -import Text.HTML.TagSoup - -main :: IO () -main = print $ parseTags tags -</code></pre> -<p>okay</p> -```````````````````````````````` - - -A script tag (type 1): - -```````````````````````````````` example -<script type="text/javascript"> -// JavaScript example - -document.getElementById("demo").innerHTML = "Hello JavaScript!"; -</script> -okay -. -<script type="text/javascript"> -// JavaScript example - -document.getElementById("demo").innerHTML = "Hello JavaScript!"; -</script> -<p>okay</p> -```````````````````````````````` - - -A style tag (type 1): - -```````````````````````````````` example -<style - type="text/css"> -h1 {color:red;} - -p {color:blue;} -</style> -okay -. -<style - type="text/css"> -h1 {color:red;} - -p {color:blue;} -</style> -<p>okay</p> -```````````````````````````````` - - -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]): - -```````````````````````````````` example -<style - type="text/css"> - -foo -. -<style - type="text/css"> - -foo -```````````````````````````````` - - -```````````````````````````````` example -> <div> -> foo - -bar -. -<blockquote> -<div> -foo -</blockquote> -<p>bar</p> -```````````````````````````````` - - -```````````````````````````````` example -- <div> -- foo -. -<ul> -<li> -<div> -</li> -<li>foo</li> -</ul> -```````````````````````````````` - - -The end tag can occur on the same line as the start tag: - -```````````````````````````````` example -<style>p{color:red;}</style> -*foo* -. -<style>p{color:red;}</style> -<p><em>foo</em></p> -```````````````````````````````` - - -```````````````````````````````` example -<!-- foo -->*bar* -*baz* -. -<!-- foo -->*bar* -<p><em>baz</em></p> -```````````````````````````````` - - -Note that anything on the last line after the -end tag will be included in the [HTML block]: - -```````````````````````````````` example -<script> -foo -</script>1. *bar* -. -<script> -foo -</script>1. *bar* -```````````````````````````````` - - -A comment (type 2): - -```````````````````````````````` example -<!-- Foo - -bar - baz --> -okay -. -<!-- Foo - -bar - baz --> -<p>okay</p> -```````````````````````````````` - - - -A processing instruction (type 3): - -```````````````````````````````` example -<?php - - echo '>'; - -?> -okay -. -<?php - - echo '>'; - -?> -<p>okay</p> -```````````````````````````````` - - -A declaration (type 4): - -```````````````````````````````` example -<!DOCTYPE html> -. -<!DOCTYPE html> -```````````````````````````````` - - -CDATA (type 5): - -```````````````````````````````` example -<![CDATA[ -function matchwo(a,b) -{ - if (a < b && a < 0) then { - return 1; - - } else { - - return 0; - } -} -]]> -okay -. -<![CDATA[ -function matchwo(a,b) -{ - if (a < b && a < 0) then { - return 1; - - } else { - - return 0; - } -} -]]> -<p>okay</p> -```````````````````````````````` - - -The opening tag can be indented 1-3 spaces, but not 4: - -```````````````````````````````` example - <!-- foo --> - - <!-- foo --> -. - <!-- foo --> -<pre><code><!-- foo --> -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example - <div> - - <div> -. - <div> -<pre><code><div> -</code></pre> -```````````````````````````````` - - -An HTML block of types 1--6 can interrupt a paragraph, and need not be -preceded by a blank line. - -```````````````````````````````` example -Foo -<div> -bar -</div> -. -<p>Foo</p> -<div> -bar -</div> -```````````````````````````````` - - -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]: - -```````````````````````````````` example -<div> -bar -</div> -*foo* -. -<div> -bar -</div> -*foo* -```````````````````````````````` - - -HTML blocks of type 7 cannot interrupt a paragraph: - -```````````````````````````````` example -Foo -<a href="bar"> -baz -. -<p>Foo -<a href="bar"> -baz</p> -```````````````````````````````` - - -This rule differs from John Gruber's original Markdown syntax -specification, which says: - -> The only restrictions are that block-level HTML elements — -> e.g. `<div>`, `<table>`, `<pre>`, `<p>`, 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. - -In some ways Gruber's rule is more restrictive than the one given -here: - -- It requires that an HTML block be preceded by a blank line. -- It does not allow the start tag to be indented. -- It requires a matching end tag, which it also does not allow to - be indented. - -Most Markdown implementations (including some of Gruber's own) do not -respect all of these restrictions. - -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 -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: - -Compare: - -```````````````````````````````` example -<div> - -*Emphasized* text. - -</div> -. -<div> -<p><em>Emphasized</em> text.</p> -</div> -```````````````````````````````` - - -```````````````````````````````` example -<div> -*Emphasized* text. -</div> -. -<div> -*Emphasized* text. -</div> -```````````````````````````````` - - -Some Markdown implementations have adopted a convention of -interpreting content inside tags as text if the open tag has -the attribute `markdown=1`. The rule given above seems a simpler and -more elegant way of achieving the same expressive power, which is also -much simpler to parse. - -The main potential drawback is that one can no longer paste HTML -blocks into Markdown documents with 100% reliability. However, -*in most cases* this will work fine, because the blank lines in -HTML are usually followed by HTML block tags. For example: - -```````````````````````````````` example -<table> - -<tr> - -<td> -Hi -</td> - -</tr> - -</table> -. -<table> -<tr> -<td> -Hi -</td> -</tr> -</table> -```````````````````````````````` - - -There are problems, however, if the inner tags are indented -*and* separated by spaces, as then they will be interpreted as -an indented code block: - -```````````````````````````````` example -<table> - - <tr> - - <td> - Hi - </td> - - </tr> - -</table> -. -<table> - <tr> -<pre><code><td> - Hi -</td> -</code></pre> - </tr> -</table> -```````````````````````````````` - - -Fortunately, blank lines are usually not necessary and can be -deleted. The exception is inside `<pre>` tags, but as described -[above][HTML blocks], raw HTML blocks starting with `<pre>` -*can* contain blank lines. - -## Link reference definitions - -A [link reference definition](@) -consists of a [link label], indented up to three spaces, followed -by a colon (`:`), optional [whitespace] (including up to one -[line ending]), a [link destination], -optional [whitespace] (including up to one -[line ending]), and an optional [link -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. - -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. - -```````````````````````````````` example -[foo]: /url "title" - -[foo] -. -<p><a href="/url" title="title">foo</a></p> -```````````````````````````````` - - -```````````````````````````````` example - [foo]: - /url - 'the title' - -[foo] -. -<p><a href="/url" title="the title">foo</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[Foo*bar\]]:my_(url) 'title (with parens)' - -[Foo*bar\]] -. -<p><a href="my_(url)" title="title (with parens)">Foo*bar]</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[Foo bar]: -<my url> -'title' - -[Foo bar] -. -<p><a href="my%20url" title="title">Foo bar</a></p> -```````````````````````````````` - - -The title may extend over multiple lines: - -```````````````````````````````` example -[foo]: /url ' -title -line1 -line2 -' - -[foo] -. -<p><a href="/url" title=" -title -line1 -line2 -">foo</a></p> -```````````````````````````````` - - -However, it may not contain a [blank line]: - -```````````````````````````````` example -[foo]: /url 'title - -with blank line' - -[foo] -. -<p>[foo]: /url 'title</p> -<p>with blank line'</p> -<p>[foo]</p> -```````````````````````````````` - - -The title may be omitted: - -```````````````````````````````` example -[foo]: -/url - -[foo] -. -<p><a href="/url">foo</a></p> -```````````````````````````````` - - -The link destination may not be omitted: - -```````````````````````````````` example -[foo]: - -[foo] -. -<p>[foo]:</p> -<p>[foo]</p> -```````````````````````````````` - - However, an empty link destination may be specified using - angle brackets: - -```````````````````````````````` example -[foo]: <> - -[foo] -. -<p><a href="">foo</a></p> -```````````````````````````````` - -The title must be separated from the link destination by -whitespace: - -```````````````````````````````` example -[foo]: <bar>(baz) - -[foo] -. -<p>[foo]: <bar>(baz)</p> -<p>[foo]</p> -```````````````````````````````` - - -Both title and destination can contain backslash escapes -and literal backslashes: - -```````````````````````````````` example -[foo]: /url\bar\*baz "foo\"bar\baz" - -[foo] -. -<p><a href="/url%5Cbar*baz" title="foo"bar\baz">foo</a></p> -```````````````````````````````` - - -A link can come before its corresponding definition: - -```````````````````````````````` example -[foo] - -[foo]: url -. -<p><a href="url">foo</a></p> -```````````````````````````````` - - -If there are several matching definitions, the first one takes -precedence: - -```````````````````````````````` example -[foo] - -[foo]: first -[foo]: second -. -<p><a href="first">foo</a></p> -```````````````````````````````` - - -As noted in the section on [Links], matching of labels is -case-insensitive (see [matches]). - -```````````````````````````````` example -[FOO]: /url - -[Foo] -. -<p><a href="/url">Foo</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[ΑΓΩ]: /φου - -[αγω] -. -<p><a href="/%CF%86%CE%BF%CF%85">αγω</a></p> -```````````````````````````````` - - -Here is a link reference definition with no corresponding link. -It contributes nothing to the document. - -```````````````````````````````` example -[foo]: /url -. -```````````````````````````````` - - -Here is another one: - -```````````````````````````````` example -[ -foo -]: /url -bar -. -<p>bar</p> -```````````````````````````````` - - -This is not a link reference definition, because there are -[non-whitespace characters] after the title: - -```````````````````````````````` example -[foo]: /url "title" ok -. -<p>[foo]: /url "title" ok</p> -```````````````````````````````` - - -This is a link reference definition, but it has no title: - -```````````````````````````````` example -[foo]: /url -"title" ok -. -<p>"title" ok</p> -```````````````````````````````` - - -This is not a link reference definition, because it is indented -four spaces: - -```````````````````````````````` example - [foo]: /url "title" - -[foo] -. -<pre><code>[foo]: /url "title" -</code></pre> -<p>[foo]</p> -```````````````````````````````` - - -This is not a link reference definition, because it occurs inside -a code block: - -```````````````````````````````` example -``` -[foo]: /url -``` - -[foo] -. -<pre><code>[foo]: /url -</code></pre> -<p>[foo]</p> -```````````````````````````````` - - -A [link reference definition] cannot interrupt a paragraph. - -```````````````````````````````` example -Foo -[bar]: /baz - -[bar] -. -<p>Foo -[bar]: /baz</p> -<p>[bar]</p> -```````````````````````````````` - - -However, it can directly follow other block elements, such as headings -and thematic breaks, and it need not be followed by a blank line. - -```````````````````````````````` example -# [Foo] -[foo]: /url -> bar -. -<h1><a href="/url">Foo</a></h1> -<blockquote> -<p>bar</p> -</blockquote> -```````````````````````````````` - -```````````````````````````````` example -[foo]: /url -bar -=== -[foo] -. -<h1>bar</h1> -<p><a href="/url">foo</a></p> -```````````````````````````````` - -```````````````````````````````` example -[foo]: /url -=== -[foo] -. -<p>=== -<a href="/url">foo</a></p> -```````````````````````````````` - - -Several [link reference definitions] -can occur one after another, without intervening blank lines. - -```````````````````````````````` example -[foo]: /foo-url "foo" -[bar]: /bar-url - "bar" -[baz]: /baz-url - -[foo], -[bar], -[baz] -. -<p><a href="/foo-url" title="foo">foo</a>, -<a href="/bar-url" title="bar">bar</a>, -<a href="/baz-url">baz</a></p> -```````````````````````````````` - - -[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: - -```````````````````````````````` example -[foo] - -> [foo]: /url -. -<p><a href="/url">foo</a></p> -<blockquote> -</blockquote> -```````````````````````````````` - - -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: - -```````````````````````````````` example -[foo]: /url -. -```````````````````````````````` - - -## Paragraphs - -A sequence of non-blank lines that cannot be interpreted as other -kinds of blocks forms a [paragraph](@). -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]. - -A simple example with two paragraphs: - -```````````````````````````````` example -aaa - -bbb -. -<p>aaa</p> -<p>bbb</p> -```````````````````````````````` - - -Paragraphs can contain multiple lines, but no blank lines: - -```````````````````````````````` example -aaa -bbb - -ccc -ddd -. -<p>aaa -bbb</p> -<p>ccc -ddd</p> -```````````````````````````````` - - -Multiple blank lines between paragraph have no effect: - -```````````````````````````````` example -aaa - - -bbb -. -<p>aaa</p> -<p>bbb</p> -```````````````````````````````` - - -Leading spaces are skipped: - -```````````````````````````````` example - aaa - bbb -. -<p>aaa -bbb</p> -```````````````````````````````` - - -Lines after the first may be indented any amount, since indented -code blocks cannot interrupt paragraphs. - -```````````````````````````````` example -aaa - bbb - ccc -. -<p>aaa -bbb -ccc</p> -```````````````````````````````` - - -However, the first line may be indented at most three spaces, -or an indented code block will be triggered: - -```````````````````````````````` example - aaa -bbb -. -<p>aaa -bbb</p> -```````````````````````````````` - - -```````````````````````````````` example - aaa -bbb -. -<pre><code>aaa -</code></pre> -<p>bbb</p> -```````````````````````````````` - - -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]: - -```````````````````````````````` example -aaa -bbb -. -<p>aaa<br /> -bbb</p> -```````````````````````````````` - - -## Blank lines - -[Blank lines] between block-level elements are ignored, -except for the role they play in determining whether a [list] -is [tight] or [loose]. - -Blank lines at the beginning and end of the document are also ignored. - -```````````````````````````````` example - - -aaa - - -# aaa - - -. -<p>aaa</p> -<h1>aaa</h1> -```````````````````````````````` - -<div class="extension"> - -## Tables (extension) - -GFM enables the `table` extension, where an additional leaf block type is -available. - -A [table](@) 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. - -Each row consists of cells containing arbitrary text, in which [inlines] are -parsed, separated by pipes (`|`). 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. - -The [delimiter row](@) consists of cells whose only content are hyphens (`-`), -and optionally, a leading or trailing colon (`:`), or both, to indicate left, -right, or center alignment respectively. - -```````````````````````````````` example table -| foo | bar | -| --- | --- | -| baz | bim | -. -<table> -<thead> -<tr> -<th>foo</th> -<th>bar</th> -</tr> -</thead> -<tbody> -<tr> -<td>baz</td> -<td>bim</td> -</tr> -</tbody> -</table> -```````````````````````````````` - -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: - -```````````````````````````````` example table -| abc | defghi | -:-: | -----------: -bar | baz -. -<table> -<thead> -<tr> -<th align="center">abc</th> -<th align="right">defghi</th> -</tr> -</thead> -<tbody> -<tr> -<td align="center">bar</td> -<td align="right">baz</td> -</tr> -</tbody> -</table> -```````````````````````````````` - -Include a pipe in a cell's content by escaping it, including inside other -inline spans: - -```````````````````````````````` example table -| f\|oo | -| ------ | -| b `\|` az | -| b **\|** im | -. -<table> -<thead> -<tr> -<th>f|oo</th> -</tr> -</thead> -<tbody> -<tr> -<td>b <code>|</code> az</td> -</tr> -<tr> -<td>b <strong>|</strong> im</td> -</tr> -</tbody> -</table> -```````````````````````````````` - -The table is broken at the first empty line, or beginning of another -block-level structure: - -```````````````````````````````` example table -| abc | def | -| --- | --- | -| bar | baz | -> bar -. -<table> -<thead> -<tr> -<th>abc</th> -<th>def</th> -</tr> -</thead> -<tbody> -<tr> -<td>bar</td> -<td>baz</td> -</tr> -</tbody> -</table> -<blockquote> -<p>bar</p> -</blockquote> -```````````````````````````````` - -```````````````````````````````` example table -| abc | def | -| --- | --- | -| bar | baz | -bar - -bar -. -<table> -<thead> -<tr> -<th>abc</th> -<th>def</th> -</tr> -</thead> -<tbody> -<tr> -<td>bar</td> -<td>baz</td> -</tr> -<tr> -<td>bar</td> -<td></td> -</tr> -</tbody> -</table> -<p>bar</p> -```````````````````````````````` - -The header row must match the [delimiter row] in the number of cells. If not, -a table will not be recognized: - -```````````````````````````````` example table -| abc | def | -| --- | -| bar | -. -<p>| abc | def | -| --- | -| bar |</p> -```````````````````````````````` - -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: - -```````````````````````````````` example table -| abc | def | -| --- | --- | -| bar | -| bar | baz | boo | -. -<table> -<thead> -<tr> -<th>abc</th> -<th>def</th> -</tr> -</thead> -<tbody> -<tr> -<td>bar</td> -<td></td> -</tr> -<tr> -<td>bar</td> -<td>baz</td> -</tr> -</tbody> -</table> -```````````````````````````````` - -If there are no rows in the body, no `<tbody>` is generated in HTML output: - -```````````````````````````````` example table -| abc | def | -| --- | --- | -. -<table> -<thead> -<tr> -<th>abc</th> -<th>def</th> -</tr> -</thead> -</table> -```````````````````````````````` - -</div> - -# Container blocks - -A [container block](#container-blocks) 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]. - -We define the syntax for container blocks recursively. The general -form of the definition is: - -> 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. - -So, we explain what counts as a block quote or list item by explaining -how these can be *generated* from their contents. This should suffice -to define the syntax, although it does not give a recipe for *parsing* -these constructions. (A recipe is provided below in the section entitled -[A parsing strategy](#appendix-a-parsing-strategy).) - -## Block quotes - -A [block quote marker](@) -consists of 0-3 spaces of initial indent, plus (a) the character `>` together -with a following space, or (b) a single character `>` not followed by a space. - -The following rules define [block quotes]: - -1. **Basic case.** If a string of lines *Ls* constitute a sequence - of blocks *Bs*, then the result of prepending a [block quote - marker] to the beginning of each line in *Ls* - is a [block quote](#block-quotes) containing *Bs*. - -2. **Laziness.** If a string of lines *Ls* constitute a [block - quote](#block-quotes) with contents *Bs*, 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 - quote marker] is [paragraph continuation - text] is a block quote with *Bs* as its content. - [Paragraph continuation text](@) is text - that will be parsed as part of the content of a paragraph, but does - not occur at the beginning of the paragraph. - -3. **Consecutiveness.** A document cannot contain two [block - quotes] in a row unless there is a [blank line] between them. - -Nothing else counts as a [block quote](#block-quotes). - -Here is a simple example: - -```````````````````````````````` example -> # Foo -> bar -> baz -. -<blockquote> -<h1>Foo</h1> -<p>bar -baz</p> -</blockquote> -```````````````````````````````` - - -The spaces after the `>` characters can be omitted: - -```````````````````````````````` example -># Foo ->bar -> baz -. -<blockquote> -<h1>Foo</h1> -<p>bar -baz</p> -</blockquote> -```````````````````````````````` - - -The `>` characters can be indented 1-3 spaces: - -```````````````````````````````` example - > # Foo - > bar - > baz -. -<blockquote> -<h1>Foo</h1> -<p>bar -baz</p> -</blockquote> -```````````````````````````````` - - -Four spaces gives us a code block: - -```````````````````````````````` example - > # Foo - > bar - > baz -. -<pre><code>> # Foo -> bar -> baz -</code></pre> -```````````````````````````````` - - -The Laziness clause allows us to omit the `>` before -[paragraph continuation text]: - -```````````````````````````````` example -> # Foo -> bar -baz -. -<blockquote> -<h1>Foo</h1> -<p>bar -baz</p> -</blockquote> -```````````````````````````````` - - -A block quote can contain some lazy and some non-lazy -continuation lines: - -```````````````````````````````` example -> bar -baz -> foo -. -<blockquote> -<p>bar -baz -foo</p> -</blockquote> -```````````````````````````````` - - -Laziness only applies to lines that would have been continuations of -paragraphs had they been prepended with [block quote markers]. -For example, the `> ` cannot be omitted in the second line of - -``` markdown -> foo -> --- -``` - -without changing the meaning: - -```````````````````````````````` example -> foo ---- -. -<blockquote> -<p>foo</p> -</blockquote> -<hr /> -```````````````````````````````` - - -Similarly, if we omit the `> ` in the second line of - -``` markdown -> - foo -> - bar -``` - -then the block quote ends after the first line: - -```````````````````````````````` example -> - foo -- bar -. -<blockquote> -<ul> -<li>foo</li> -</ul> -</blockquote> -<ul> -<li>bar</li> -</ul> -```````````````````````````````` - - -For the same reason, we can't omit the `> ` in front of -subsequent lines of an indented or fenced code block: - -```````````````````````````````` example -> foo - bar -. -<blockquote> -<pre><code>foo -</code></pre> -</blockquote> -<pre><code>bar -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example -> ``` -foo -``` -. -<blockquote> -<pre><code></code></pre> -</blockquote> -<p>foo</p> -<pre><code></code></pre> -```````````````````````````````` - - -Note that in the following case, we have a [lazy -continuation line]: - -```````````````````````````````` example -> foo - - bar -. -<blockquote> -<p>foo -- bar</p> -</blockquote> -```````````````````````````````` - - -To see why, note that in - -```markdown -> foo -> - bar -``` - -the `- bar` 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]. - -A block quote can be empty: - -```````````````````````````````` example -> -. -<blockquote> -</blockquote> -```````````````````````````````` - - -```````````````````````````````` example -> -> -> -. -<blockquote> -</blockquote> -```````````````````````````````` - - -A block quote can have initial or final blank lines: - -```````````````````````````````` example -> -> foo -> -. -<blockquote> -<p>foo</p> -</blockquote> -```````````````````````````````` - - -A blank line always separates block quotes: - -```````````````````````````````` example -> foo - -> bar -. -<blockquote> -<p>foo</p> -</blockquote> -<blockquote> -<p>bar</p> -</blockquote> -```````````````````````````````` - - -(Most current Markdown implementations, including John Gruber's -original `Markdown.pl`, 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.) - -Consecutiveness means that if we put these block quotes together, -we get a single block quote: - -```````````````````````````````` example -> foo -> bar -. -<blockquote> -<p>foo -bar</p> -</blockquote> -```````````````````````````````` - - -To get a block quote with two paragraphs, use: - -```````````````````````````````` example -> foo -> -> bar -. -<blockquote> -<p>foo</p> -<p>bar</p> -</blockquote> -```````````````````````````````` - - -Block quotes can interrupt paragraphs: - -```````````````````````````````` example -foo -> bar -. -<p>foo</p> -<blockquote> -<p>bar</p> -</blockquote> -```````````````````````````````` - - -In general, blank lines are not needed before or after block -quotes: - -```````````````````````````````` example -> aaa -*** -> bbb -. -<blockquote> -<p>aaa</p> -</blockquote> -<hr /> -<blockquote> -<p>bbb</p> -</blockquote> -```````````````````````````````` - - -However, because of laziness, a blank line is needed between -a block quote and a following paragraph: - -```````````````````````````````` example -> bar -baz -. -<blockquote> -<p>bar -baz</p> -</blockquote> -```````````````````````````````` - - -```````````````````````````````` example -> bar - -baz -. -<blockquote> -<p>bar</p> -</blockquote> -<p>baz</p> -```````````````````````````````` - - -```````````````````````````````` example -> bar -> -baz -. -<blockquote> -<p>bar</p> -</blockquote> -<p>baz</p> -```````````````````````````````` - - -It is a consequence of the Laziness rule that any number -of initial `>`s may be omitted on a continuation line of a -nested block quote: - -```````````````````````````````` example -> > > foo -bar -. -<blockquote> -<blockquote> -<blockquote> -<p>foo -bar</p> -</blockquote> -</blockquote> -</blockquote> -```````````````````````````````` - - -```````````````````````````````` example ->>> foo -> bar ->>baz -. -<blockquote> -<blockquote> -<blockquote> -<p>foo -bar -baz</p> -</blockquote> -</blockquote> -</blockquote> -```````````````````````````````` - - -When including an indented code block in a block quote, -remember that the [block quote marker] includes -both the `>` and a following space. So *five spaces* are needed after -the `>`: - -```````````````````````````````` example -> code - -> not code -. -<blockquote> -<pre><code>code -</code></pre> -</blockquote> -<blockquote> -<p>not code</p> -</blockquote> -```````````````````````````````` - - - -## List items - -A [list marker](@) is a -[bullet list marker] or an [ordered list marker]. - -A [bullet list marker](@) -is a `-`, `+`, or `*` character. - -An [ordered list marker](@) -is a sequence of 1--9 arabic digits (`0-9`), followed by either a -`.` character or a `)` character. (The reason for the length -limit is that with 10 digits we start seeing integer overflows -in some browsers.) - -The following rules define [list items]: - -1. **Basic case.** If a sequence of lines *Ls* constitute a sequence of - blocks *Bs* starting with a [non-whitespace character], and *M* is a - list marker of width *W* followed by 1 ≤ *N* ≤ 4 spaces, then the result - of prepending *M* and the following spaces to the first line of - *Ls*, and indenting subsequent lines of *Ls* by *W + N* spaces, is a - list item with *Bs* 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. - - Exceptions: - - 1. 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 *Ls* must not begin with a blank line, and (b) if - the list item is ordered, the start number must be 1. - 2. If any line is a [thematic break][thematic breaks] then - that line is not a list item. - -For example, let *Ls* be the lines - -```````````````````````````````` example -A paragraph -with two lines. - - indented code - -> A block quote. -. -<p>A paragraph -with two lines.</p> -<pre><code>indented code -</code></pre> -<blockquote> -<p>A block quote.</p> -</blockquote> -```````````````````````````````` - - -And let *M* be the marker `1.`, and *N* = 2. Then rule #1 says -that the following is an ordered list item with start number 1, -and the same contents as *Ls*: - -```````````````````````````````` example -1. A paragraph - with two lines. - - indented code - - > A block quote. -. -<ol> -<li> -<p>A paragraph -with two lines.</p> -<pre><code>indented code -</code></pre> -<blockquote> -<p>A block quote.</p> -</blockquote> -</li> -</ol> -```````````````````````````````` - - -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. - -Here are some examples showing how far content must be indented to be -put under the list item: - -```````````````````````````````` example -- one - - two -. -<ul> -<li>one</li> -</ul> -<p>two</p> -```````````````````````````````` - - -```````````````````````````````` example -- one - - two -. -<ul> -<li> -<p>one</p> -<p>two</p> -</li> -</ul> -```````````````````````````````` - - -```````````````````````````````` example - - one - - two -. -<ul> -<li>one</li> -</ul> -<pre><code> two -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example - - one - - two -. -<ul> -<li> -<p>one</p> -<p>two</p> -</li> -</ul> -```````````````````````````````` - - -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 -is needed. Which column this indentation reaches will depend on -how the list item is embedded in other constructions, as shown by -this example: - -```````````````````````````````` example - > > 1. one ->> ->> two -. -<blockquote> -<blockquote> -<ol> -<li> -<p>one</p> -<p>two</p> -</li> -</ol> -</blockquote> -</blockquote> -```````````````````````````````` - - -Here `two` occurs in the same column as the list marker `1.`, -but is actually contained in the list item, because there is -sufficient indentation after the last containing blockquote marker. - -The converse is also possible. In the following example, the word `two` -occurs far to the right of the initial text of the list item, `one`, but -it is not considered part of the list item, because it is not indented -far enough past the blockquote marker: - -```````````````````````````````` example ->>- one ->> - > > two -. -<blockquote> -<blockquote> -<ul> -<li>one</li> -</ul> -<p>two</p> -</blockquote> -</blockquote> -```````````````````````````````` - - -Note that at least one space is needed between the list marker and -any following content, so these are not list items: - -```````````````````````````````` example --one - -2.two -. -<p>-one</p> -<p>2.two</p> -```````````````````````````````` - - -A list item may contain blocks that are separated by more than -one blank line. - -```````````````````````````````` example -- foo - - - bar -. -<ul> -<li> -<p>foo</p> -<p>bar</p> -</li> -</ul> -```````````````````````````````` - - -A list item may contain any kind of block: - -```````````````````````````````` example -1. foo - - ``` - bar - ``` - - baz - - > bam -. -<ol> -<li> -<p>foo</p> -<pre><code>bar -</code></pre> -<p>baz</p> -<blockquote> -<p>bam</p> -</blockquote> -</li> -</ol> -```````````````````````````````` - - -A list item that contains an indented code block will preserve -empty lines within the code block verbatim. - -```````````````````````````````` example -- Foo - - bar - - - baz -. -<ul> -<li> -<p>Foo</p> -<pre><code>bar - - -baz -</code></pre> -</li> -</ul> -```````````````````````````````` - -Note that ordered list start numbers must be nine digits or less: - -```````````````````````````````` example -123456789. ok -. -<ol start="123456789"> -<li>ok</li> -</ol> -```````````````````````````````` - - -```````````````````````````````` example -1234567890. not ok -. -<p>1234567890. not ok</p> -```````````````````````````````` - - -A start number may begin with 0s: - -```````````````````````````````` example -0. ok -. -<ol start="0"> -<li>ok</li> -</ol> -```````````````````````````````` - - -```````````````````````````````` example -003. ok -. -<ol start="3"> -<li>ok</li> -</ol> -```````````````````````````````` - - -A start number may not be negative: - -```````````````````````````````` example --1. not ok -. -<p>-1. not ok</p> -```````````````````````````````` - - - -2. **Item starting with indented code.** If a sequence of lines *Ls* - constitute a sequence of blocks *Bs* starting with an indented code - block, and *M* is a list marker of width *W* followed by - one space, then the result of prepending *M* and the following - space to the first line of *Ls*, and indenting subsequent lines of - *Ls* by *W + 1* spaces, is a list item with *Bs* as its contents. - If a line is empty, then it need not be indented. 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. - -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: - -```````````````````````````````` example -- foo - - bar -. -<ul> -<li> -<p>foo</p> -<pre><code>bar -</code></pre> -</li> -</ul> -```````````````````````````````` - - -And in this case it is 11 spaces: - -```````````````````````````````` example - 10. foo - - bar -. -<ol start="10"> -<li> -<p>foo</p> -<pre><code>bar -</code></pre> -</li> -</ol> -```````````````````````````````` - - -If the *first* block in the list item is an indented code block, -then by rule #2, the contents must be indented *one* space after the -list marker: - -```````````````````````````````` example - indented code - -paragraph - - more code -. -<pre><code>indented code -</code></pre> -<p>paragraph</p> -<pre><code>more code -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example -1. indented code - - paragraph - - more code -. -<ol> -<li> -<pre><code>indented code -</code></pre> -<p>paragraph</p> -<pre><code>more code -</code></pre> -</li> -</ol> -```````````````````````````````` - - -Note that an additional space indent is interpreted as space -inside the code block: - -```````````````````````````````` example -1. indented code - - paragraph - - more code -. -<ol> -<li> -<pre><code> indented code -</code></pre> -<p>paragraph</p> -<pre><code>more code -</code></pre> -</li> -</ol> -```````````````````````````````` - - -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 -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: - -```````````````````````````````` example - foo - -bar -. -<p>foo</p> -<p>bar</p> -```````````````````````````````` - - -```````````````````````````````` example -- foo - - bar -. -<ul> -<li>foo</li> -</ul> -<p>bar</p> -```````````````````````````````` - - -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: - -```````````````````````````````` example -- foo - - bar -. -<ul> -<li> -<p>foo</p> -<p>bar</p> -</li> -</ul> -```````````````````````````````` - - -3. **Item starting with a blank line.** If a sequence of lines *Ls* - starting with a single [blank line] constitute a (possibly empty) - sequence of blocks *Bs*, not separated from each other by more than - one blank line, and *M* is a list marker of width *W*, - then the result of prepending *M* to the first line of *Ls*, and - indenting subsequent lines of *Ls* by *W + 1* spaces, is a list - item with *Bs* as its contents. - If a line is empty, then it need not be indented. 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. - -Here are some list items that start with a blank line but are not empty: - -```````````````````````````````` example -- - foo -- - ``` - bar - ``` -- - baz -. -<ul> -<li>foo</li> -<li> -<pre><code>bar -</code></pre> -</li> -<li> -<pre><code>baz -</code></pre> -</li> -</ul> -```````````````````````````````` - -When the list item starts with a blank line, the number of spaces -following the list marker doesn't change the required indentation: - -```````````````````````````````` example -- - foo -. -<ul> -<li>foo</li> -</ul> -```````````````````````````````` - - -A list item can begin with at most one blank line. -In the following example, `foo` is not part of the list -item: - -```````````````````````````````` example -- - - foo -. -<ul> -<li></li> -</ul> -<p>foo</p> -```````````````````````````````` - - -Here is an empty bullet list item: - -```````````````````````````````` example -- foo -- -- bar -. -<ul> -<li>foo</li> -<li></li> -<li>bar</li> -</ul> -```````````````````````````````` - - -It does not matter whether there are spaces following the [list marker]: - -```````````````````````````````` example -- foo -- -- bar -. -<ul> -<li>foo</li> -<li></li> -<li>bar</li> -</ul> -```````````````````````````````` - - -Here is an empty ordered list item: - -```````````````````````````````` example -1. foo -2. -3. bar -. -<ol> -<li>foo</li> -<li></li> -<li>bar</li> -</ol> -```````````````````````````````` - - -A list may start or end with an empty list item: - -```````````````````````````````` example -* -. -<ul> -<li></li> -</ul> -```````````````````````````````` - -However, an empty list item cannot interrupt a paragraph: - -```````````````````````````````` example -foo -* - -foo -1. -. -<p>foo -*</p> -<p>foo -1.</p> -```````````````````````````````` - - -4. **Indentation.** If a sequence of lines *Ls* constitutes a list item - according to rule #1, #2, or #3, then the result of indenting each line - of *Ls* 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. - -Indented one space: - -```````````````````````````````` example - 1. A paragraph - with two lines. - - indented code - - > A block quote. -. -<ol> -<li> -<p>A paragraph -with two lines.</p> -<pre><code>indented code -</code></pre> -<blockquote> -<p>A block quote.</p> -</blockquote> -</li> -</ol> -```````````````````````````````` - - -Indented two spaces: - -```````````````````````````````` example - 1. A paragraph - with two lines. - - indented code - - > A block quote. -. -<ol> -<li> -<p>A paragraph -with two lines.</p> -<pre><code>indented code -</code></pre> -<blockquote> -<p>A block quote.</p> -</blockquote> -</li> -</ol> -```````````````````````````````` - - -Indented three spaces: - -```````````````````````````````` example - 1. A paragraph - with two lines. - - indented code - - > A block quote. -. -<ol> -<li> -<p>A paragraph -with two lines.</p> -<pre><code>indented code -</code></pre> -<blockquote> -<p>A block quote.</p> -</blockquote> -</li> -</ol> -```````````````````````````````` - - -Four spaces indent gives a code block: - -```````````````````````````````` example - 1. A paragraph - with two lines. - - indented code - - > A block quote. -. -<pre><code>1. A paragraph - with two lines. - - indented code - - > A block quote. -</code></pre> -```````````````````````````````` - - - -5. **Laziness.** If a string of lines *Ls* constitute a [list - item](#list-items) with contents *Bs*, then the result of deleting - some or all of the indentation from one or more lines in which the - next [non-whitespace character] after the indentation is - [paragraph continuation text] is a - list item with the same contents and attributes. The unindented - lines are called - [lazy continuation line](@)s. - -Here is an example with [lazy continuation lines]: - -```````````````````````````````` example - 1. A paragraph -with two lines. - - indented code - - > A block quote. -. -<ol> -<li> -<p>A paragraph -with two lines.</p> -<pre><code>indented code -</code></pre> -<blockquote> -<p>A block quote.</p> -</blockquote> -</li> -</ol> -```````````````````````````````` - - -Indentation can be partially deleted: - -```````````````````````````````` example - 1. A paragraph - with two lines. -. -<ol> -<li>A paragraph -with two lines.</li> -</ol> -```````````````````````````````` - - -These examples show how laziness can work in nested structures: - -```````````````````````````````` example -> 1. > Blockquote -continued here. -. -<blockquote> -<ol> -<li> -<blockquote> -<p>Blockquote -continued here.</p> -</blockquote> -</li> -</ol> -</blockquote> -```````````````````````````````` - - -```````````````````````````````` example -> 1. > Blockquote -> continued here. -. -<blockquote> -<ol> -<li> -<blockquote> -<p>Blockquote -continued here.</p> -</blockquote> -</li> -</ol> -</blockquote> -```````````````````````````````` - - - -6. **That's all.** Nothing that is not counted as a list item by rules - #1--5 counts as a [list item](#list-items). - -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. - -So, in this case we need two spaces indent: - -```````````````````````````````` example -- foo - - bar - - baz - - boo -. -<ul> -<li>foo -<ul> -<li>bar -<ul> -<li>baz -<ul> -<li>boo</li> -</ul> -</li> -</ul> -</li> -</ul> -</li> -</ul> -```````````````````````````````` - - -One is not enough: - -```````````````````````````````` example -- foo - - bar - - baz - - boo -. -<ul> -<li>foo</li> -<li>bar</li> -<li>baz</li> -<li>boo</li> -</ul> -```````````````````````````````` - - -Here we need four, because the list marker is wider: - -```````````````````````````````` example -10) foo - - bar -. -<ol start="10"> -<li>foo -<ul> -<li>bar</li> -</ul> -</li> -</ol> -```````````````````````````````` - - -Three is not enough: - -```````````````````````````````` example -10) foo - - bar -. -<ol start="10"> -<li>foo</li> -</ol> -<ul> -<li>bar</li> -</ul> -```````````````````````````````` - - -A list may be the first block in a list item: - -```````````````````````````````` example -- - foo -. -<ul> -<li> -<ul> -<li>foo</li> -</ul> -</li> -</ul> -```````````````````````````````` - - -```````````````````````````````` example -1. - 2. foo -. -<ol> -<li> -<ul> -<li> -<ol start="2"> -<li>foo</li> -</ol> -</li> -</ul> -</li> -</ol> -```````````````````````````````` - - -A list item can contain a heading: - -```````````````````````````````` example -- # Foo -- Bar - --- - baz -. -<ul> -<li> -<h1>Foo</h1> -</li> -<li> -<h2>Bar</h2> -baz</li> -</ul> -```````````````````````````````` - - -### Motivation - -John Gruber's Markdown spec says the following about list items: - -1. "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." - -2. "To make lists look nice, you can wrap items with hanging indents.... - But if you don't want to, you don't have to." - -3. "List items may consist of multiple paragraphs. Each subsequent - paragraph in a list item must be indented by either 4 spaces or one - tab." - -4. "It looks nice if you indent every line of the subsequent paragraphs, - but here again, Markdown will allow you to be lazy." - -5. "To put a blockquote within a list item, the blockquote's `>` - delimiters need to be indented." - -6. "To put a code block within a list item, the code block needs to be - indented twice — 8 spaces or two tabs." - -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 -that a block quote must be indented, but not by how much; however, the -example given has four spaces indentation. Although nothing is said -about other kinds of block-level content, it is certainly reasonable to -infer that *all* block elements under a list item, including other -lists, must be indented four spaces. This principle has been called the -*four-space rule*. - -The four-space rule is clear and principled, and if the reference -implementation `Markdown.pl` had followed it, it probably would have -become the standard. However, `Markdown.pl` allowed paragraphs and -sublists to start with only two spaces indentation, at least on the -outer level. Worse, its behavior was inconsistent: a sublist of an -outer-level list needed two spaces indentation, but a sublist of this -sublist needed three spaces. It is not surprising, then, that different -implementations of Markdown have developed very different rules for -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 `Markdown.pl`'s behavior more closely.) - -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 `Markdown.pl` behavior, provided they are laid out -in a way that is natural for a human to read. - -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.) - -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 - -``` markdown -- foo - - bar - - - baz -``` - -should be parsed as two lists with an intervening paragraph, - -``` html -<ul> -<li>foo</li> -</ul> -<p>bar</p> -<ul> -<li>baz</li> -</ul> -``` - -as the four-space rule demands, rather than a single list, - -``` html -<ul> -<li> -<p>foo</p> -<p>bar</p> -<ul> -<li>baz</li> -</ul> -</li> -</ul> -``` - -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. - -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 *less than* the -original list marker to be included in the list item. For example, -`Markdown.pl` parses - -``` markdown - - one - - two -``` - -as a single list item, with `two` a continuation paragraph: - -``` html -<ul> -<li> -<p>one</p> -<p>two</p> -</li> -</ul> -``` - -and similarly - -``` markdown -> - one -> -> two -``` - -as - -``` html -<blockquote> -<ul> -<li> -<p>one</p> -<p>two</p> -</li> -</ul> -</blockquote> -``` - -This is extremely unintuitive. - -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 `bar` -is not indented as far as the first paragraph `foo`: - -``` markdown - 10. foo - - bar -``` - -Arguably this text does read like a list item with `bar` 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: - -``` markdown -1. foo - - indented code -``` - -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 `foo`. - -The one case that needs special treatment is a list item that *starts* -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 -(and then the normal four spaces for the indented code). This will match the -four-space rule in cases where the list marker plus its initial indentation -takes four spaces (a common case), but diverge in other cases. - -<div class="extension"> - -## Task list items (extension) - -GFM enables the `tasklist` extension, where an additional processing step is -performed on [list items]. - -A [task list item](@) 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. - -A [task list item marker](@) consists of an optional number of spaces, a left -bracket (`[`), either a whitespace character or the letter `x` in either -lowercase or uppercase, and then a right bracket (`]`). - -When rendered, the [task list item marker] is replaced with a semantic checkbox element; -in an HTML output, this would be an `<input type="checkbox">` element. - -If the character between the brackets is a whitespace character, the checkbox -is unchecked. Otherwise, the checkbox is checked. - -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. - -```````````````````````````````` example disabled -- [ ] foo -- [x] bar -. -<ul> -<li><input disabled="" type="checkbox"> foo</li> -<li><input checked="" disabled="" type="checkbox"> bar</li> -</ul> -```````````````````````````````` - -Task lists can be arbitrarily nested: - -```````````````````````````````` example disabled -- [x] foo - - [ ] bar - - [x] baz -- [ ] bim -. -<ul> -<li><input checked="" disabled="" type="checkbox"> foo -<ul> -<li><input disabled="" type="checkbox"> bar</li> -<li><input checked="" disabled="" type="checkbox"> baz</li> -</ul> -</li> -<li><input disabled="" type="checkbox"> bim</li> -</ul> -```````````````````````````````` - -</div> - -## Lists - -A [list](@) 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. - -Two list items are [of the same type](@) -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 -(`-`, `+`, or `*`) or (b) they are ordered list numbers with the same -delimiter (either `.` or `)`). - -A list is an [ordered list](@) -if its constituent list items begin with -[ordered list markers], and a -[bullet list](@) if its constituent list -items begin with [bullet list markers]. - -The [start number](@) -of an [ordered list] is determined by the list number of -its initial list item. The numbers of subsequent list items are -disregarded. - -A list is [loose](@) 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 [tight](@). -(The difference in HTML output is that paragraphs in a loose list are -wrapped in `<p>` tags, while paragraphs in a tight list are not.) - -Changing the bullet or ordered list delimiter starts a new list: - -```````````````````````````````` example -- foo -- bar -+ baz -. -<ul> -<li>foo</li> -<li>bar</li> -</ul> -<ul> -<li>baz</li> -</ul> -```````````````````````````````` - - -```````````````````````````````` example -1. foo -2. bar -3) baz -. -<ol> -<li>foo</li> -<li>bar</li> -</ol> -<ol start="3"> -<li>baz</li> -</ol> -```````````````````````````````` - - -In CommonMark, a list can interrupt a paragraph. That is, -no blank line is needed to separate a paragraph from a following -list: - -```````````````````````````````` example -Foo -- bar -- baz -. -<p>Foo</p> -<ul> -<li>bar</li> -<li>baz</li> -</ul> -```````````````````````````````` - -`Markdown.pl` does not allow this, through fear of triggering a list -via a numeral in a hard-wrapped line: - -``` markdown -The number of windows in my house is -14. The number of doors is 6. -``` - -Oddly, though, `Markdown.pl` *does* allow a blockquote to -interrupt a paragraph, even though the same considerations might -apply. - -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: - -``` markdown -I need to buy -- new shoes -- a coat -- a plane ticket -``` - -Second, we are attracted to a - -> [principle of uniformity](@): -> 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). - -(Indeed, the spec for [list items] and [block quotes] presupposes -this principle.) This principle implies that if - -``` markdown - * I need to buy - - new shoes - - a coat - - a plane ticket -``` - -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 `<p>` tags, since the list is "tight"), -then - -``` markdown -I need to buy -- new shoes -- a coat -- a plane ticket -``` - -by itself should be a paragraph followed by a nested sublist. - -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. ([reStructuredText](http://docutils.sourceforge.net/rst.html) -takes a different approach, requiring blank lines before lists -even inside other list items.) - -In order to solve of unwanted lists in paragraphs with -hard-wrapped numerals, we allow only lists starting with `1` to -interrupt paragraphs. Thus, - -```````````````````````````````` example -The number of windows in my house is -14. The number of doors is 6. -. -<p>The number of windows in my house is -14. The number of doors is 6.</p> -```````````````````````````````` - -We may still get an unintended result in cases like - -```````````````````````````````` example -The number of windows in my house is -1. The number of doors is 6. -. -<p>The number of windows in my house is</p> -<ol> -<li>The number of doors is 6.</li> -</ol> -```````````````````````````````` - -but this rule should prevent most spurious list captures. - -There can be any number of blank lines between items: - -```````````````````````````````` example -- foo - -- bar - - -- baz -. -<ul> -<li> -<p>foo</p> -</li> -<li> -<p>bar</p> -</li> -<li> -<p>baz</p> -</li> -</ul> -```````````````````````````````` - -```````````````````````````````` example -- foo - - bar - - baz - - - bim -. -<ul> -<li>foo -<ul> -<li>bar -<ul> -<li> -<p>baz</p> -<p>bim</p> -</li> -</ul> -</li> -</ul> -</li> -</ul> -```````````````````````````````` - - -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: - -```````````````````````````````` example -- foo -- bar - -<!-- --> - -- baz -- bim -. -<ul> -<li>foo</li> -<li>bar</li> -</ul> -<!-- --> -<ul> -<li>baz</li> -<li>bim</li> -</ul> -```````````````````````````````` - - -```````````````````````````````` example -- foo - - notcode - -- foo - -<!-- --> - - code -. -<ul> -<li> -<p>foo</p> -<p>notcode</p> -</li> -<li> -<p>foo</p> -</li> -</ul> -<!-- --> -<pre><code>code -</code></pre> -```````````````````````````````` - - -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: - -```````````````````````````````` example -- a - - b - - c - - d - - e - - f -- g -. -<ul> -<li>a</li> -<li>b</li> -<li>c</li> -<li>d</li> -<li>e</li> -<li>f</li> -<li>g</li> -</ul> -```````````````````````````````` - - -```````````````````````````````` example -1. a - - 2. b - - 3. c -. -<ol> -<li> -<p>a</p> -</li> -<li> -<p>b</p> -</li> -<li> -<p>c</p> -</li> -</ol> -```````````````````````````````` - -Note, however, that list items may not be indented more than -three spaces. Here `- e` is treated as a paragraph continuation -line, because it is indented more than three spaces: - -```````````````````````````````` example -- a - - b - - c - - d - - e -. -<ul> -<li>a</li> -<li>b</li> -<li>c</li> -<li>d -- e</li> -</ul> -```````````````````````````````` - -And here, `3. c` is treated as in indented code block, -because it is indented four spaces and preceded by a -blank line. - -```````````````````````````````` example -1. a - - 2. b - - 3. c -. -<ol> -<li> -<p>a</p> -</li> -<li> -<p>b</p> -</li> -</ol> -<pre><code>3. c -</code></pre> -```````````````````````````````` - - -This is a loose list, because there is a blank line between -two of the list items: - -```````````````````````````````` example -- a -- b - -- c -. -<ul> -<li> -<p>a</p> -</li> -<li> -<p>b</p> -</li> -<li> -<p>c</p> -</li> -</ul> -```````````````````````````````` - - -So is this, with a empty second item: - -```````````````````````````````` example -* a -* - -* c -. -<ul> -<li> -<p>a</p> -</li> -<li></li> -<li> -<p>c</p> -</li> -</ul> -```````````````````````````````` - - -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: - -```````````````````````````````` example -- a -- b - - c -- d -. -<ul> -<li> -<p>a</p> -</li> -<li> -<p>b</p> -<p>c</p> -</li> -<li> -<p>d</p> -</li> -</ul> -```````````````````````````````` - - -```````````````````````````````` example -- a -- b - - [ref]: /url -- d -. -<ul> -<li> -<p>a</p> -</li> -<li> -<p>b</p> -</li> -<li> -<p>d</p> -</li> -</ul> -```````````````````````````````` - - -This is a tight list, because the blank lines are in a code block: - -```````````````````````````````` example -- a -- ``` - b - - - ``` -- c -. -<ul> -<li>a</li> -<li> -<pre><code>b - - -</code></pre> -</li> -<li>c</li> -</ul> -```````````````````````````````` - - -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: - -```````````````````````````````` example -- a - - b - - c -- d -. -<ul> -<li>a -<ul> -<li> -<p>b</p> -<p>c</p> -</li> -</ul> -</li> -<li>d</li> -</ul> -```````````````````````````````` - - -This is a tight list, because the blank line is inside the -block quote: - -```````````````````````````````` example -* a - > b - > -* c -. -<ul> -<li>a -<blockquote> -<p>b</p> -</blockquote> -</li> -<li>c</li> -</ul> -```````````````````````````````` - - -This list is tight, because the consecutive block elements -are not separated by blank lines: - -```````````````````````````````` example -- a - > b - ``` - c - ``` -- d -. -<ul> -<li>a -<blockquote> -<p>b</p> -</blockquote> -<pre><code>c -</code></pre> -</li> -<li>d</li> -</ul> -```````````````````````````````` - - -A single-paragraph list is tight: - -```````````````````````````````` example -- a -. -<ul> -<li>a</li> -</ul> -```````````````````````````````` - - -```````````````````````````````` example -- a - - b -. -<ul> -<li>a -<ul> -<li>b</li> -</ul> -</li> -</ul> -```````````````````````````````` - - -This list is loose, because of the blank line between the -two block elements in the list item: - -```````````````````````````````` example -1. ``` - foo - ``` - - bar -. -<ol> -<li> -<pre><code>foo -</code></pre> -<p>bar</p> -</li> -</ol> -```````````````````````````````` - - -Here the outer list is loose, the inner list tight: - -```````````````````````````````` example -* foo - * bar - - baz -. -<ul> -<li> -<p>foo</p> -<ul> -<li>bar</li> -</ul> -<p>baz</p> -</li> -</ul> -```````````````````````````````` - - -```````````````````````````````` example -- a - - b - - c - -- d - - e - - f -. -<ul> -<li> -<p>a</p> -<ul> -<li>b</li> -<li>c</li> -</ul> -</li> -<li> -<p>d</p> -<ul> -<li>e</li> -<li>f</li> -</ul> -</li> -</ul> -```````````````````````````````` - - -# Inlines - -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 - -```````````````````````````````` example -`hi`lo` -. -<p><code>hi</code>lo`</p> -```````````````````````````````` - -`hi` is parsed as code, leaving the backtick at the end as a literal -backtick. - - -## Backslash escapes - -Any ASCII punctuation character may be backslash-escaped: - -```````````````````````````````` example -\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~ -. -<p>!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~</p> -```````````````````````````````` - - -Backslashes before other characters are treated as literal -backslashes: - -```````````````````````````````` example -\→\A\a\ \3\φ\« -. -<p>\→\A\a\ \3\φ\«</p> -```````````````````````````````` - - -Escaped characters are treated as regular characters and do -not have their usual Markdown meanings: - -```````````````````````````````` example -\*not emphasized* -\<br/> not a tag -\[not a link](/foo) -\`not code` -1\. not a list -\* not a list -\# not a heading -\[foo]: /url "not a reference" -\ö not a character entity -. -<p>*not emphasized* -<br/> not a tag -[not a link](/foo) -`not code` -1. not a list -* not a list -# not a heading -[foo]: /url "not a reference" -&ouml; not a character entity</p> -```````````````````````````````` - - -If a backslash is itself escaped, the following character is not: - -```````````````````````````````` example -\\*emphasis* -. -<p>\<em>emphasis</em></p> -```````````````````````````````` - - -A backslash at the end of the line is a [hard line break]: - -```````````````````````````````` example -foo\ -bar -. -<p>foo<br /> -bar</p> -```````````````````````````````` - - -Backslash escapes do not work in code blocks, code spans, autolinks, or -raw HTML: - -```````````````````````````````` example -`` \[\` `` -. -<p><code>\[\`</code></p> -```````````````````````````````` - - -```````````````````````````````` example - \[\] -. -<pre><code>\[\] -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example -~~~ -\[\] -~~~ -. -<pre><code>\[\] -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example -<http://example.com?find=\*> -. -<p><a href="http://example.com?find=%5C*">http://example.com?find=\*</a></p> -```````````````````````````````` - - -```````````````````````````````` example -<a href="/bar\/)"> -. -<a href="/bar\/)"> -```````````````````````````````` - - -But they work in all other contexts, including URLs and link titles, -link references, and [info strings] in [fenced code blocks]: - -```````````````````````````````` example -[foo](/bar\* "ti\*tle") -. -<p><a href="/bar*" title="ti*tle">foo</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[foo] - -[foo]: /bar\* "ti\*tle" -. -<p><a href="/bar*" title="ti*tle">foo</a></p> -```````````````````````````````` - - -```````````````````````````````` example -``` foo\+bar -foo -``` -. -<pre><code class="language-foo+bar">foo -</code></pre> -```````````````````````````````` - - - -## Entity and numeric character references - -Valid HTML entity references and numeric character references -can be used in place of the corresponding Unicode character, -with the following exceptions: - -- Entity and character references are not recognized in code - blocks and code spans. - -- Entity and character references cannot stand in place of - special characters that define structural elements in - CommonMark. For example, although `*` can be used - in place of a literal `*` character, `*` cannot replace - `*` in emphasis delimiters, bullet list markers, or thematic - breaks. - -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. - -[Entity references](@) consist of `&` + any of the valid -HTML5 entity names + `;`. The -document <https://html.spec.whatwg.org/multipage/entities.json> -is used as an authoritative source for the valid entity -references and their corresponding code points. - -```````````````````````````````` example - & © Æ Ď -¾ ℋ ⅆ -∲ ≧̸ -. -<p> & © Æ ÄŽ -¾ â„‹ â…† -∲ ≧̸</p> -```````````````````````````````` - - -[Decimal numeric character -references](@) -consist of `&#` + a string of 1--7 arabic digits + `;`. A -numeric character reference is parsed as the corresponding -Unicode character. Invalid Unicode code points will be replaced by -the REPLACEMENT CHARACTER (`U+FFFD`). For security reasons, -the code point `U+0000` will also be replaced by `U+FFFD`. - -```````````````````````````````` example -# Ӓ Ϡ � -. -<p># Ó’ Ï ï¿½</p> -```````````````````````````````` - - -[Hexadecimal numeric character -references](@) consist of `&#` + -either `X` or `x` + a string of 1-6 hexadecimal digits + `;`. -They too are parsed as the corresponding Unicode character (this -time specified with a hexadecimal numeral instead of decimal). - -```````````````````````````````` example -" ആ ಫ -. -<p>" à´† ಫ</p> -```````````````````````````````` - - -Here are some nonentities: - -```````````````````````````````` example -  &x; &#; &#x; -� -&#abcdef0; -&ThisIsNotDefined; &hi?; -. -<p>&nbsp &x; &#; &#x; -&#987654321; -&#abcdef0; -&ThisIsNotDefined; &hi?;</p> -```````````````````````````````` - - -Although HTML5 does accept some entity references -without a trailing semicolon (such as `©`), these are not -recognized here, because it makes the grammar too ambiguous: - -```````````````````````````````` example -© -. -<p>&copy</p> -```````````````````````````````` - - -Strings that are not on the list of HTML5 named entities are not -recognized as entity references either: - -```````````````````````````````` example -&MadeUpEntity; -. -<p>&MadeUpEntity;</p> -```````````````````````````````` - - -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]: - -```````````````````````````````` example -<a href="öö.html"> -. -<a href="öö.html"> -```````````````````````````````` - - -```````````````````````````````` example -[foo](/föö "föö") -. -<p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[foo] - -[foo]: /föö "föö" -. -<p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p> -```````````````````````````````` - - -```````````````````````````````` example -``` föö -foo -``` -. -<pre><code class="language-föö">foo -</code></pre> -```````````````````````````````` - - -Entity and numeric character references are treated as literal -text in code spans and code blocks: - -```````````````````````````````` example -`föö` -. -<p><code>f&ouml;&ouml;</code></p> -```````````````````````````````` - - -```````````````````````````````` example - föfö -. -<pre><code>f&ouml;f&ouml; -</code></pre> -```````````````````````````````` - - -Entity and numeric character references cannot be used -in place of symbols indicating structure in CommonMark -documents. - -```````````````````````````````` example -*foo* -*foo* -. -<p>*foo* -<em>foo</em></p> -```````````````````````````````` - -```````````````````````````````` example -* foo - -* foo -. -<p>* foo</p> -<ul> -<li>foo</li> -</ul> -```````````````````````````````` - -```````````````````````````````` example -foo bar -. -<p>foo - -bar</p> -```````````````````````````````` - -```````````````````````````````` example -	foo -. -<p>→foo</p> -```````````````````````````````` - - -```````````````````````````````` example -[a](url "tit") -. -<p>[a](url "tit")</p> -```````````````````````````````` - - -## Code spans - -A [backtick string](@) -is a string of one or more backtick characters (`` ` ``) that is neither -preceded nor followed by a backtick. - -A [code span](@) 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: - -- First, [line endings] are converted to [spaces]. -- If the resulting string both begins *and* 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. - -This is a simple code span: - -```````````````````````````````` example -`foo` -. -<p><code>foo</code></p> -```````````````````````````````` - - -Here two backticks are used, because the code contains a backtick. -This example also illustrates stripping of a single leading and -trailing space: - -```````````````````````````````` example -`` foo ` bar `` -. -<p><code>foo ` bar</code></p> -```````````````````````````````` - - -This example shows the motivation for stripping leading and trailing -spaces: - -```````````````````````````````` example -` `` ` -. -<p><code>``</code></p> -```````````````````````````````` - -Note that only *one* space is stripped: - -```````````````````````````````` example -` `` ` -. -<p><code> `` </code></p> -```````````````````````````````` - -The stripping only happens if the space is on both -sides of the string: - -```````````````````````````````` example -` a` -. -<p><code> a</code></p> -```````````````````````````````` - -Only [spaces], and not [unicode whitespace] in general, are -stripped in this way: - -```````````````````````````````` example -` b ` -. -<p><code> b </code></p> -```````````````````````````````` - -No stripping occurs if the code span contains only spaces: - -```````````````````````````````` example -` ` -` ` -. -<p><code> </code> -<code> </code></p> -```````````````````````````````` - - -[Line endings] are treated like spaces: - -```````````````````````````````` example -`` -foo -bar -baz -`` -. -<p><code>foo bar baz</code></p> -```````````````````````````````` - -```````````````````````````````` example -`` -foo -`` -. -<p><code>foo </code></p> -```````````````````````````````` - - -Interior spaces are not collapsed: - -```````````````````````````````` example -`foo bar -baz` -. -<p><code>foo bar baz</code></p> -```````````````````````````````` - -Note that browsers will typically collapse consecutive spaces -when rendering `<code>` elements, so it is recommended that -the following CSS be used: - - code{white-space: pre-wrap;} - - -Note that backslash escapes do not work in code spans. All backslashes -are treated literally: - -```````````````````````````````` example -`foo\`bar` -. -<p><code>foo\</code>bar`</p> -```````````````````````````````` - - -Backslash escapes are never needed, because one can always choose a -string of *n* backtick characters as delimiters, where the code does -not contain any strings of exactly *n* backtick characters. - -```````````````````````````````` example -``foo`bar`` -. -<p><code>foo`bar</code></p> -```````````````````````````````` - -```````````````````````````````` example -` foo `` bar ` -. -<p><code>foo `` bar</code></p> -```````````````````````````````` - - -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 `*` is part of a code -span: - -```````````````````````````````` example -*foo`*` -. -<p>*foo<code>*</code></p> -```````````````````````````````` - - -And this is not parsed as a link: - -```````````````````````````````` example -[not a `link](/foo`) -. -<p>[not a <code>link](/foo</code>)</p> -```````````````````````````````` - - -Code spans, HTML tags, and autolinks have the same precedence. -Thus, this is code: - -```````````````````````````````` example -`<a href="`">` -. -<p><code><a href="</code>">`</p> -```````````````````````````````` - - -But this is an HTML tag: - -```````````````````````````````` example -<a href="`">` -. -<p><a href="`">`</p> -```````````````````````````````` - - -And this is code: - -```````````````````````````````` example -`<http://foo.bar.`baz>` -. -<p><code><http://foo.bar.</code>baz>`</p> -```````````````````````````````` - - -But this is an autolink: - -```````````````````````````````` example -<http://foo.bar.`baz>` -. -<p><a href="http://foo.bar.%60baz">http://foo.bar.`baz</a>`</p> -```````````````````````````````` - - -When a backtick string is not closed by a matching backtick string, -we just have literal backticks: - -```````````````````````````````` example -```foo`` -. -<p>```foo``</p> -```````````````````````````````` - - -```````````````````````````````` example -`foo -. -<p>`foo</p> -```````````````````````````````` - -The following case also illustrates the need for opening and -closing backtick strings to be equal in length: - -```````````````````````````````` example -`foo``bar`` -. -<p>`foo<code>bar</code></p> -```````````````````````````````` - - -## Emphasis and strong emphasis - -John Gruber's original [Markdown syntax -description](http://daringfireball.net/projects/markdown/syntax#em) says: - -> Markdown treats asterisks (`*`) and underscores (`_`) as indicators of -> emphasis. Text wrapped with one `*` or `_` will be wrapped with an HTML -> `<em>` tag; double `*`'s or `_`'s will be wrapped with an HTML `<strong>` -> tag. - -This is enough for most users, but these rules leave much undecided, -especially when it comes to nested emphasis. The original -`Markdown.pl` test suite makes it clear that triple `***` and -`___` delimiters can be used for strong emphasis, and most -implementations have also allowed the following patterns: - -``` markdown -***strong emph*** -***strong** in emph* -***emph* in strong** -**in strong *emph*** -*in emph **strong*** -``` - -The following patterns are less widely supported, but the intent -is clear and they are useful (especially in contexts like bibliography -entries): - -``` markdown -*emph *with emph* in it* -**strong **with strong** in it** -``` - -Many implementations have also restricted intraword emphasis to -the `*` 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.) - -``` markdown -internal emphasis: foo*bar*baz -no emphasis: foo_bar_baz -``` - -The rules given below capture all of these patterns, while allowing -for efficient parsing strategies that do not backtrack. - -First, some definitions. A [delimiter run](@) is either -a sequence of one or more `*` characters that is not preceded or -followed by a non-backslash-escaped `*` character, or a sequence -of one or more `_` characters that is not preceded or followed by -a non-backslash-escaped `_` character. - -A [left-flanking delimiter run](@) 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. - -A [right-flanking delimiter run](@) 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. - -Here are some examples of delimiter runs. - - - left-flanking but not right-flanking: - - ``` - ***abc - _abc - **"abc" - _"abc" - ``` - - - right-flanking but not left-flanking: - - ``` - abc*** - abc_ - "abc"** - "abc"_ - ``` - - - Both left and right-flanking: - - ``` - abc***def - "abc"_"def" - ``` - - - Neither left nor right-flanking: - - ``` - abc *** def - a _ b - ``` - -(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 -[vfmd](http://www.vfmd.org/vfmd-spec/specification/#procedure-for-identifying-emphasis-tags). -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.) - -The following rules define emphasis and strong emphasis: - -1. A single `*` character [can open emphasis](@) - iff (if and only if) it is part of a [left-flanking delimiter run]. - -2. A single `_` 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. - -3. A single `*` character [can close emphasis](@) - iff it is part of a [right-flanking delimiter run]. - -4. A single `_` 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. - -5. A double `**` [can open strong emphasis](@) - iff it is part of a [left-flanking delimiter run]. - -6. A double `__` [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. - -7. A double `**` [can close strong emphasis](@) - iff it is part of a [right-flanking delimiter run]. - -8. A double `__` [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. - -9. Emphasis begins with a delimiter that [can open emphasis] and ends - with a delimiter that [can close emphasis], and that uses the same - character (`_` or `*`) as the opening delimiter. The - opening and closing delimiters must belong to separate - [delimiter runs]. If one of the delimiters can both - open and close emphasis, then the sum of the lengths of the - delimiter runs containing the opening and closing delimiters - must not be a multiple of 3 unless both lengths are - multiples of 3. - -10. 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 - (`_` or `*`) as the opening delimiter. The - opening and closing delimiters must belong to separate - [delimiter runs]. If one of the delimiters can both open - and close strong emphasis, then the sum of the lengths of - the delimiter runs containing the opening and closing - delimiters must not be a multiple of 3 unless both lengths - are multiples of 3. - -11. A literal `*` character cannot occur at the beginning or end of - `*`-delimited emphasis or `**`-delimited strong emphasis, unless it - is backslash-escaped. - -12. A literal `_` character cannot occur at the beginning or end of - `_`-delimited emphasis or `__`-delimited strong emphasis, unless it - is backslash-escaped. - -Where rules 1--12 above are compatible with multiple parsings, -the following principles resolve ambiguity: - -13. The number of nestings should be minimized. Thus, for example, - an interpretation `<strong>...</strong>` is always preferred to - `<em><em>...</em></em>`. - -14. An interpretation `<em><strong>...</strong></em>` is always - preferred to `<strong><em>...</em></strong>`. - -15. 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, - `*foo _bar* baz_` is parsed as `<em>foo _bar</em> baz_` rather - than `*foo <em>bar* baz</em>`. - -16. 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, - `**foo **bar baz**` is parsed as `**foo <strong>bar baz</strong>` - rather than `<strong>foo **bar baz</strong>`. - -17. 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, `*[foo*](bar)` is - parsed as `*<a href="bar">foo*</a>` rather than as - `<em>[foo</em>](bar)`. - -These rules can be illustrated through a series of examples. - -Rule 1: - -```````````````````````````````` example -*foo bar* -. -<p><em>foo bar</em></p> -```````````````````````````````` - - -This is not emphasis, because the opening `*` is followed by -whitespace, and hence not part of a [left-flanking delimiter run]: - -```````````````````````````````` example -a * foo bar* -. -<p>a * foo bar*</p> -```````````````````````````````` - - -This is not emphasis, because the opening `*` is preceded -by an alphanumeric and followed by punctuation, and hence -not part of a [left-flanking delimiter run]: - -```````````````````````````````` example -a*"foo"* -. -<p>a*"foo"*</p> -```````````````````````````````` - - -Unicode nonbreaking spaces count as whitespace, too: - -```````````````````````````````` example -* a * -. -<p>* a *</p> -```````````````````````````````` - - -Intraword emphasis with `*` is permitted: - -```````````````````````````````` example -foo*bar* -. -<p>foo<em>bar</em></p> -```````````````````````````````` - - -```````````````````````````````` example -5*6*78 -. -<p>5<em>6</em>78</p> -```````````````````````````````` - - -Rule 2: - -```````````````````````````````` example -_foo bar_ -. -<p><em>foo bar</em></p> -```````````````````````````````` - - -This is not emphasis, because the opening `_` is followed by -whitespace: - -```````````````````````````````` example -_ foo bar_ -. -<p>_ foo bar_</p> -```````````````````````````````` - - -This is not emphasis, because the opening `_` is preceded -by an alphanumeric and followed by punctuation: - -```````````````````````````````` example -a_"foo"_ -. -<p>a_"foo"_</p> -```````````````````````````````` - - -Emphasis with `_` is not allowed inside words: - -```````````````````````````````` example -foo_bar_ -. -<p>foo_bar_</p> -```````````````````````````````` - - -```````````````````````````````` example -5_6_78 -. -<p>5_6_78</p> -```````````````````````````````` - - -```````````````````````````````` example -приÑтанÑм_ÑтремÑÑ‚ÑÑ_ -. -<p>приÑтанÑм_ÑтремÑÑ‚ÑÑ_</p> -```````````````````````````````` - - -Here `_` does not generate emphasis, because the first delimiter run -is right-flanking and the second left-flanking: - -```````````````````````````````` example -aa_"bb"_cc -. -<p>aa_"bb"_cc</p> -```````````````````````````````` - - -This is emphasis, even though the opening delimiter is -both left- and right-flanking, because it is preceded by -punctuation: - -```````````````````````````````` example -foo-_(bar)_ -. -<p>foo-<em>(bar)</em></p> -```````````````````````````````` - - -Rule 3: - -This is not emphasis, because the closing delimiter does -not match the opening delimiter: - -```````````````````````````````` example -_foo* -. -<p>_foo*</p> -```````````````````````````````` - - -This is not emphasis, because the closing `*` is preceded by -whitespace: - -```````````````````````````````` example -*foo bar * -. -<p>*foo bar *</p> -```````````````````````````````` - - -A newline also counts as whitespace: - -```````````````````````````````` example -*foo bar -* -. -<p>*foo bar -*</p> -```````````````````````````````` - - -This is not emphasis, because the second `*` is -preceded by punctuation and followed by an alphanumeric -(hence it is not part of a [right-flanking delimiter run]: - -```````````````````````````````` example -*(*foo) -. -<p>*(*foo)</p> -```````````````````````````````` - - -The point of this restriction is more easily appreciated -with this example: - -```````````````````````````````` example -*(*foo*)* -. -<p><em>(<em>foo</em>)</em></p> -```````````````````````````````` - - -Intraword emphasis with `*` is allowed: - -```````````````````````````````` example -*foo*bar -. -<p><em>foo</em>bar</p> -```````````````````````````````` - - - -Rule 4: - -This is not emphasis, because the closing `_` is preceded by -whitespace: - -```````````````````````````````` example -_foo bar _ -. -<p>_foo bar _</p> -```````````````````````````````` - - -This is not emphasis, because the second `_` is -preceded by punctuation and followed by an alphanumeric: - -```````````````````````````````` example -_(_foo) -. -<p>_(_foo)</p> -```````````````````````````````` - - -This is emphasis within emphasis: - -```````````````````````````````` example -_(_foo_)_ -. -<p><em>(<em>foo</em>)</em></p> -```````````````````````````````` - - -Intraword emphasis is disallowed for `_`: - -```````````````````````````````` example -_foo_bar -. -<p>_foo_bar</p> -```````````````````````````````` - - -```````````````````````````````` example -_приÑтанÑм_ÑтремÑÑ‚ÑÑ -. -<p>_приÑтанÑм_ÑтремÑÑ‚ÑÑ</p> -```````````````````````````````` - - -```````````````````````````````` example -_foo_bar_baz_ -. -<p><em>foo_bar_baz</em></p> -```````````````````````````````` - - -This is emphasis, even though the closing delimiter is -both left- and right-flanking, because it is followed by -punctuation: - -```````````````````````````````` example -_(bar)_. -. -<p><em>(bar)</em>.</p> -```````````````````````````````` - - -Rule 5: - -```````````````````````````````` example -**foo bar** -. -<p><strong>foo bar</strong></p> -```````````````````````````````` - - -This is not strong emphasis, because the opening delimiter is -followed by whitespace: - -```````````````````````````````` example -** foo bar** -. -<p>** foo bar**</p> -```````````````````````````````` - - -This is not strong emphasis, because the opening `**` is preceded -by an alphanumeric and followed by punctuation, and hence -not part of a [left-flanking delimiter run]: - -```````````````````````````````` example -a**"foo"** -. -<p>a**"foo"**</p> -```````````````````````````````` - - -Intraword strong emphasis with `**` is permitted: - -```````````````````````````````` example -foo**bar** -. -<p>foo<strong>bar</strong></p> -```````````````````````````````` - - -Rule 6: - -```````````````````````````````` example -__foo bar__ -. -<p><strong>foo bar</strong></p> -```````````````````````````````` - - -This is not strong emphasis, because the opening delimiter is -followed by whitespace: - -```````````````````````````````` example -__ foo bar__ -. -<p>__ foo bar__</p> -```````````````````````````````` - - -A newline counts as whitespace: -```````````````````````````````` example -__ -foo bar__ -. -<p>__ -foo bar__</p> -```````````````````````````````` - - -This is not strong emphasis, because the opening `__` is preceded -by an alphanumeric and followed by punctuation: - -```````````````````````````````` example -a__"foo"__ -. -<p>a__"foo"__</p> -```````````````````````````````` - - -Intraword strong emphasis is forbidden with `__`: - -```````````````````````````````` example -foo__bar__ -. -<p>foo__bar__</p> -```````````````````````````````` - - -```````````````````````````````` example -5__6__78 -. -<p>5__6__78</p> -```````````````````````````````` - - -```````````````````````````````` example -приÑтанÑм__ÑтремÑÑ‚ÑÑ__ -. -<p>приÑтанÑм__ÑтремÑÑ‚ÑÑ__</p> -```````````````````````````````` - - -```````````````````````````````` example -__foo, __bar__, baz__ -. -<p><strong>foo, <strong>bar</strong>, baz</strong></p> -```````````````````````````````` - - -This is strong emphasis, even though the opening delimiter is -both left- and right-flanking, because it is preceded by -punctuation: - -```````````````````````````````` example -foo-__(bar)__ -. -<p>foo-<strong>(bar)</strong></p> -```````````````````````````````` - - - -Rule 7: - -This is not strong emphasis, because the closing delimiter is preceded -by whitespace: - -```````````````````````````````` example -**foo bar ** -. -<p>**foo bar **</p> -```````````````````````````````` - - -(Nor can it be interpreted as an emphasized `*foo bar *`, because of -Rule 11.) - -This is not strong emphasis, because the second `**` is -preceded by punctuation and followed by an alphanumeric: - -```````````````````````````````` example -**(**foo) -. -<p>**(**foo)</p> -```````````````````````````````` - - -The point of this restriction is more easily appreciated -with these examples: - -```````````````````````````````` example -*(**foo**)* -. -<p><em>(<strong>foo</strong>)</em></p> -```````````````````````````````` - - -```````````````````````````````` example -**Gomphocarpus (*Gomphocarpus physocarpus*, syn. -*Asclepias physocarpa*)** -. -<p><strong>Gomphocarpus (<em>Gomphocarpus physocarpus</em>, syn. -<em>Asclepias physocarpa</em>)</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -**foo "*bar*" foo** -. -<p><strong>foo "<em>bar</em>" foo</strong></p> -```````````````````````````````` - - -Intraword emphasis: - -```````````````````````````````` example -**foo**bar -. -<p><strong>foo</strong>bar</p> -```````````````````````````````` - - -Rule 8: - -This is not strong emphasis, because the closing delimiter is -preceded by whitespace: - -```````````````````````````````` example -__foo bar __ -. -<p>__foo bar __</p> -```````````````````````````````` - - -This is not strong emphasis, because the second `__` is -preceded by punctuation and followed by an alphanumeric: - -```````````````````````````````` example -__(__foo) -. -<p>__(__foo)</p> -```````````````````````````````` - - -The point of this restriction is more easily appreciated -with this example: - -```````````````````````````````` example -_(__foo__)_ -. -<p><em>(<strong>foo</strong>)</em></p> -```````````````````````````````` - - -Intraword strong emphasis is forbidden with `__`: - -```````````````````````````````` example -__foo__bar -. -<p>__foo__bar</p> -```````````````````````````````` - - -```````````````````````````````` example -__приÑтанÑм__ÑтремÑÑ‚ÑÑ -. -<p>__приÑтанÑм__ÑтремÑÑ‚ÑÑ</p> -```````````````````````````````` - - -```````````````````````````````` example -__foo__bar__baz__ -. -<p><strong>foo__bar__baz</strong></p> -```````````````````````````````` - - -This is strong emphasis, even though the closing delimiter is -both left- and right-flanking, because it is followed by -punctuation: - -```````````````````````````````` example -__(bar)__. -. -<p><strong>(bar)</strong>.</p> -```````````````````````````````` - - -Rule 9: - -Any nonempty sequence of inline elements can be the contents of an -emphasized span. - -```````````````````````````````` example -*foo [bar](/url)* -. -<p><em>foo <a href="/url">bar</a></em></p> -```````````````````````````````` - - -```````````````````````````````` example -*foo -bar* -. -<p><em>foo -bar</em></p> -```````````````````````````````` - - -In particular, emphasis and strong emphasis can be nested -inside emphasis: - -```````````````````````````````` example -_foo __bar__ baz_ -. -<p><em>foo <strong>bar</strong> baz</em></p> -```````````````````````````````` - - -```````````````````````````````` example -_foo _bar_ baz_ -. -<p><em>foo <em>bar</em> baz</em></p> -```````````````````````````````` - - -```````````````````````````````` example -__foo_ bar_ -. -<p><em><em>foo</em> bar</em></p> -```````````````````````````````` - - -```````````````````````````````` example -*foo *bar** -. -<p><em>foo <em>bar</em></em></p> -```````````````````````````````` - - -```````````````````````````````` example -*foo **bar** baz* -. -<p><em>foo <strong>bar</strong> baz</em></p> -```````````````````````````````` - -```````````````````````````````` example -*foo**bar**baz* -. -<p><em>foo<strong>bar</strong>baz</em></p> -```````````````````````````````` - -Note that in the preceding case, the interpretation - -``` markdown -<p><em>foo</em><em>bar<em></em>baz</em></p> -``` - - -is precluded by the condition that a delimiter that -can both open and close (like the `*` after `foo`) -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. - - -For the same reason, we don't get two consecutive -emphasis sections in this example: - -```````````````````````````````` example -*foo**bar* -. -<p><em>foo**bar</em></p> -```````````````````````````````` - - -The same condition ensures that the following -cases are all strong emphasis nested inside -emphasis, even when the interior spaces are -omitted: - - -```````````````````````````````` example -***foo** bar* -. -<p><em><strong>foo</strong> bar</em></p> -```````````````````````````````` - - -```````````````````````````````` example -*foo **bar*** -. -<p><em>foo <strong>bar</strong></em></p> -```````````````````````````````` - - -```````````````````````````````` example -*foo**bar*** -. -<p><em>foo<strong>bar</strong></em></p> -```````````````````````````````` - - -When the lengths of the interior closing and opening -delimiter runs are *both* multiples of 3, though, -they can match to create emphasis: - -```````````````````````````````` example -foo***bar***baz -. -<p>foo<em><strong>bar</strong></em>baz</p> -```````````````````````````````` - -```````````````````````````````` example -foo******bar*********baz -. -<p>foo<strong><strong><strong>bar</strong></strong></strong>***baz</p> -```````````````````````````````` - - -Indefinite levels of nesting are possible: - -```````````````````````````````` example -*foo **bar *baz* bim** bop* -. -<p><em>foo <strong>bar <em>baz</em> bim</strong> bop</em></p> -```````````````````````````````` - - -```````````````````````````````` example -*foo [*bar*](/url)* -. -<p><em>foo <a href="/url"><em>bar</em></a></em></p> -```````````````````````````````` - - -There can be no empty emphasis or strong emphasis: - -```````````````````````````````` example -** is not an empty emphasis -. -<p>** is not an empty emphasis</p> -```````````````````````````````` - - -```````````````````````````````` example -**** is not an empty strong emphasis -. -<p>**** is not an empty strong emphasis</p> -```````````````````````````````` - - - -Rule 10: - -Any nonempty sequence of inline elements can be the contents of an -strongly emphasized span. - -```````````````````````````````` example -**foo [bar](/url)** -. -<p><strong>foo <a href="/url">bar</a></strong></p> -```````````````````````````````` - - -```````````````````````````````` example -**foo -bar** -. -<p><strong>foo -bar</strong></p> -```````````````````````````````` - - -In particular, emphasis and strong emphasis can be nested -inside strong emphasis: - -```````````````````````````````` example -__foo _bar_ baz__ -. -<p><strong>foo <em>bar</em> baz</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -__foo __bar__ baz__ -. -<p><strong>foo <strong>bar</strong> baz</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -____foo__ bar__ -. -<p><strong><strong>foo</strong> bar</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -**foo **bar**** -. -<p><strong>foo <strong>bar</strong></strong></p> -```````````````````````````````` - - -```````````````````````````````` example -**foo *bar* baz** -. -<p><strong>foo <em>bar</em> baz</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -**foo*bar*baz** -. -<p><strong>foo<em>bar</em>baz</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -***foo* bar** -. -<p><strong><em>foo</em> bar</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -**foo *bar*** -. -<p><strong>foo <em>bar</em></strong></p> -```````````````````````````````` - - -Indefinite levels of nesting are possible: - -```````````````````````````````` example -**foo *bar **baz** -bim* bop** -. -<p><strong>foo <em>bar <strong>baz</strong> -bim</em> bop</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -**foo [*bar*](/url)** -. -<p><strong>foo <a href="/url"><em>bar</em></a></strong></p> -```````````````````````````````` - - -There can be no empty emphasis or strong emphasis: - -```````````````````````````````` example -__ is not an empty emphasis -. -<p>__ is not an empty emphasis</p> -```````````````````````````````` - - -```````````````````````````````` example -____ is not an empty strong emphasis -. -<p>____ is not an empty strong emphasis</p> -```````````````````````````````` - - - -Rule 11: - -```````````````````````````````` example -foo *** -. -<p>foo ***</p> -```````````````````````````````` - - -```````````````````````````````` example -foo *\** -. -<p>foo <em>*</em></p> -```````````````````````````````` - - -```````````````````````````````` example -foo *_* -. -<p>foo <em>_</em></p> -```````````````````````````````` - - -```````````````````````````````` example -foo ***** -. -<p>foo *****</p> -```````````````````````````````` - - -```````````````````````````````` example -foo **\*** -. -<p>foo <strong>*</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -foo **_** -. -<p>foo <strong>_</strong></p> -```````````````````````````````` - - -Note that when delimiters do not match evenly, Rule 11 determines -that the excess literal `*` characters will appear outside of the -emphasis, rather than inside it: - -```````````````````````````````` example -**foo* -. -<p>*<em>foo</em></p> -```````````````````````````````` - - -```````````````````````````````` example -*foo** -. -<p><em>foo</em>*</p> -```````````````````````````````` - - -```````````````````````````````` example -***foo** -. -<p>*<strong>foo</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -****foo* -. -<p>***<em>foo</em></p> -```````````````````````````````` - - -```````````````````````````````` example -**foo*** -. -<p><strong>foo</strong>*</p> -```````````````````````````````` - - -```````````````````````````````` example -*foo**** -. -<p><em>foo</em>***</p> -```````````````````````````````` - - - -Rule 12: - -```````````````````````````````` example -foo ___ -. -<p>foo ___</p> -```````````````````````````````` - - -```````````````````````````````` example -foo _\__ -. -<p>foo <em>_</em></p> -```````````````````````````````` - - -```````````````````````````````` example -foo _*_ -. -<p>foo <em>*</em></p> -```````````````````````````````` - - -```````````````````````````````` example -foo _____ -. -<p>foo _____</p> -```````````````````````````````` - - -```````````````````````````````` example -foo __\___ -. -<p>foo <strong>_</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -foo __*__ -. -<p>foo <strong>*</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -__foo_ -. -<p>_<em>foo</em></p> -```````````````````````````````` - - -Note that when delimiters do not match evenly, Rule 12 determines -that the excess literal `_` characters will appear outside of the -emphasis, rather than inside it: - -```````````````````````````````` example -_foo__ -. -<p><em>foo</em>_</p> -```````````````````````````````` - - -```````````````````````````````` example -___foo__ -. -<p>_<strong>foo</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -____foo_ -. -<p>___<em>foo</em></p> -```````````````````````````````` - - -```````````````````````````````` example -__foo___ -. -<p><strong>foo</strong>_</p> -```````````````````````````````` - - -```````````````````````````````` example -_foo____ -. -<p><em>foo</em>___</p> -```````````````````````````````` - - -Rule 13 implies that if you want emphasis nested directly inside -emphasis, you must use different delimiters: - -```````````````````````````````` example -**foo** -. -<p><strong>foo</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -*_foo_* -. -<p><em><em>foo</em></em></p> -```````````````````````````````` - - -```````````````````````````````` example -__foo__ -. -<p><strong>foo</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -_*foo*_ -. -<p><em><em>foo</em></em></p> -```````````````````````````````` - - -However, strong emphasis within strong emphasis is possible without -switching delimiters: - -```````````````````````````````` example -****foo**** -. -<p><strong><strong>foo</strong></strong></p> -```````````````````````````````` - - -```````````````````````````````` example -____foo____ -. -<p><strong><strong>foo</strong></strong></p> -```````````````````````````````` - - - -Rule 13 can be applied to arbitrarily long sequences of -delimiters: - -```````````````````````````````` example -******foo****** -. -<p><strong><strong><strong>foo</strong></strong></strong></p> -```````````````````````````````` - - -Rule 14: - -```````````````````````````````` example -***foo*** -. -<p><em><strong>foo</strong></em></p> -```````````````````````````````` - - -```````````````````````````````` example -_____foo_____ -. -<p><em><strong><strong>foo</strong></strong></em></p> -```````````````````````````````` - - -Rule 15: - -```````````````````````````````` example -*foo _bar* baz_ -. -<p><em>foo _bar</em> baz_</p> -```````````````````````````````` - - -```````````````````````````````` example -*foo __bar *baz bim__ bam* -. -<p><em>foo <strong>bar *baz bim</strong> bam</em></p> -```````````````````````````````` - - -Rule 16: - -```````````````````````````````` example -**foo **bar baz** -. -<p>**foo <strong>bar baz</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -*foo *bar baz* -. -<p>*foo <em>bar baz</em></p> -```````````````````````````````` - - -Rule 17: - -```````````````````````````````` example -*[bar*](/url) -. -<p>*<a href="/url">bar*</a></p> -```````````````````````````````` - - -```````````````````````````````` example -_foo [bar_](/url) -. -<p>_foo <a href="/url">bar_</a></p> -```````````````````````````````` - - -```````````````````````````````` example -*<img src="foo" title="*"/> -. -<p>*<img src="foo" title="*"/></p> -```````````````````````````````` - - -```````````````````````````````` example -**<a href="**"> -. -<p>**<a href="**"></p> -```````````````````````````````` - - -```````````````````````````````` example -__<a href="__"> -. -<p>__<a href="__"></p> -```````````````````````````````` - - -```````````````````````````````` example -*a `*`* -. -<p><em>a <code>*</code></em></p> -```````````````````````````````` - - -```````````````````````````````` example -_a `_`_ -. -<p><em>a <code>_</code></em></p> -```````````````````````````````` - - -```````````````````````````````` example -**a<http://foo.bar/?q=**> -. -<p>**a<a href="http://foo.bar/?q=**">http://foo.bar/?q=**</a></p> -```````````````````````````````` - - -```````````````````````````````` example -__a<http://foo.bar/?q=__> -. -<p>__a<a href="http://foo.bar/?q=__">http://foo.bar/?q=__</a></p> -```````````````````````````````` - - -<div class="extension"> - -## Strikethrough (extension) - -GFM enables the `strikethrough` extension, where an additional emphasis type is -available. - -Strikethrough text is any text wrapped in two tildes (`~`). - -```````````````````````````````` example strikethrough -~~Hi~~ Hello, world! -. -<p><del>Hi</del> Hello, world!</p> -```````````````````````````````` - -As with regular emphasis delimiters, a new paragraph will cause strikethrough -parsing to cease: - -```````````````````````````````` example strikethrough -This ~~has a - -new paragraph~~. -. -<p>This ~~has a</p> -<p>new paragraph~~.</p> -```````````````````````````````` - -</div> - -## Links - -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. - -A [link text](@) consists of a sequence of zero or more -inline elements enclosed by square brackets (`[` and `]`). The -following rules apply: - -- 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. - -- 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 `[`, a sequence of zero or more inlines, and - a close bracket `]`. - -- Backtick [code spans], [autolinks], and raw [HTML tags] bind more tightly - than the brackets in link text. Thus, for example, - `` [foo`]` `` could not be a link text, since the second `]` - is part of a code span. - -- The brackets in link text bind more tightly than markers for - [emphasis and strong emphasis]. Thus, for example, `*[foo*](url)` is a link. - -A [link destination](@) consists of either - -- a sequence of zero or more characters between an opening `<` and a - closing `>` that contains no line breaks or unescaped - `<` or `>` characters, or - -- a nonempty sequence of characters that does not start with - `<`, 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. - (Implementations may impose limits on parentheses nesting to - avoid performance issues, but at least three levels of nesting - should be supported.) - -A [link title](@) consists of either - -- a sequence of zero or more characters between straight double-quote - characters (`"`), including a `"` character only if it is - backslash-escaped, or - -- a sequence of zero or more characters between straight single-quote - characters (`'`), including a `'` character only if it is - backslash-escaped, or - -- a sequence of zero or more characters between matching parentheses - (`(...)`), including a `(` or `)` character only if it is - backslash-escaped. - -Although [link titles] may span multiple lines, they may not contain -a [blank line]. - -An [inline link](@) consists of a [link text] followed immediately -by a left parenthesis `(`, optional [whitespace], an optional -[link destination], an optional [link title] separated from the link -destination by [whitespace], optional [whitespace], and a right -parenthesis `)`. The link's text consists of the inlines contained -in the [link text] (excluding the enclosing square brackets). -The link's URI consists of the link destination, excluding enclosing -`<...>` if present, with backslash-escapes in effect as described -above. The link's title consists of the link title, excluding its -enclosing delimiters, with backslash-escapes in effect as described -above. - -Here is a simple inline link: - -```````````````````````````````` example -[link](/uri "title") -. -<p><a href="/uri" title="title">link</a></p> -```````````````````````````````` - - -The title may be omitted: - -```````````````````````````````` example -[link](/uri) -. -<p><a href="/uri">link</a></p> -```````````````````````````````` - - -Both the title and the destination may be omitted: - -```````````````````````````````` example -[link]() -. -<p><a href="">link</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[link](<>) -. -<p><a href="">link</a></p> -```````````````````````````````` - -The destination can only contain spaces if it is -enclosed in pointy brackets: - -```````````````````````````````` example -[link](/my uri) -. -<p>[link](/my uri)</p> -```````````````````````````````` - -```````````````````````````````` example -[link](</my uri>) -. -<p><a href="/my%20uri">link</a></p> -```````````````````````````````` - -The destination cannot contain line breaks, -even if enclosed in pointy brackets: - -```````````````````````````````` example -[link](foo -bar) -. -<p>[link](foo -bar)</p> -```````````````````````````````` - -```````````````````````````````` example -[link](<foo -bar>) -. -<p>[link](<foo -bar>)</p> -```````````````````````````````` - -The destination can contain `)` if it is enclosed -in pointy brackets: - -```````````````````````````````` example -[a](<b)c>) -. -<p><a href="b)c">a</a></p> -```````````````````````````````` - -Pointy brackets that enclose links must be unescaped: - -```````````````````````````````` example -[link](<foo\>) -. -<p>[link](<foo>)</p> -```````````````````````````````` - -These are not links, because the opening pointy bracket -is not matched properly: - -```````````````````````````````` example -[a](<b)c -[a](<b)c> -[a](<b>c) -. -<p>[a](<b)c -[a](<b)c> -[a](<b>c)</p> -```````````````````````````````` - -Parentheses inside the link destination may be escaped: - -```````````````````````````````` example -[link](\(foo\)) -. -<p><a href="(foo)">link</a></p> -```````````````````````````````` - -Any number of parentheses are allowed without escaping, as long as they are -balanced: - -```````````````````````````````` example -[link](foo(and(bar))) -. -<p><a href="foo(and(bar))">link</a></p> -```````````````````````````````` - -However, if you have unbalanced parentheses, you need to escape or use the -`<...>` form: - -```````````````````````````````` example -[link](foo\(and\(bar\)) -. -<p><a href="foo(and(bar)">link</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[link](<foo(and(bar)>) -. -<p><a href="foo(and(bar)">link</a></p> -```````````````````````````````` - - -Parentheses and other symbols can also be escaped, as usual -in Markdown: - -```````````````````````````````` example -[link](foo\)\:) -. -<p><a href="foo):">link</a></p> -```````````````````````````````` - - -A link can contain fragment identifiers and queries: - -```````````````````````````````` example -[link](#fragment) - -[link](http://example.com#fragment) - -[link](http://example.com?foo=3#frag) -. -<p><a href="#fragment">link</a></p> -<p><a href="http://example.com#fragment">link</a></p> -<p><a href="http://example.com?foo=3#frag">link</a></p> -```````````````````````````````` - - -Note that a backslash before a non-escapable character is -just a backslash: - -```````````````````````````````` example -[link](foo\bar) -. -<p><a href="foo%5Cbar">link</a></p> -```````````````````````````````` - - -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 -be optionally URL-escaped when written as HTML, but this spec -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. - -```````````````````````````````` example -[link](foo%20bä) -. -<p><a href="foo%20b%C3%A4">link</a></p> -```````````````````````````````` - - -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: - -```````````````````````````````` example -[link]("title") -. -<p><a href="%22title%22">link</a></p> -```````````````````````````````` - - -Titles may be in single quotes, double quotes, or parentheses: - -```````````````````````````````` example -[link](/url "title") -[link](/url 'title') -[link](/url (title)) -. -<p><a href="/url" title="title">link</a> -<a href="/url" title="title">link</a> -<a href="/url" title="title">link</a></p> -```````````````````````````````` - - -Backslash escapes and entity and numeric character references -may be used in titles: - -```````````````````````````````` example -[link](/url "title \""") -. -<p><a href="/url" title="title """>link</a></p> -```````````````````````````````` - - -Titles must be separated from the link using a [whitespace]. -Other [Unicode whitespace] like non-breaking space doesn't work. - -```````````````````````````````` example -[link](/url "title") -. -<p><a href="/url%C2%A0%22title%22">link</a></p> -```````````````````````````````` - - -Nested balanced quotes are not allowed without escaping: - -```````````````````````````````` example -[link](/url "title "and" title") -. -<p>[link](/url "title "and" title")</p> -```````````````````````````````` - - -But it is easy to work around this by using a different quote type: - -```````````````````````````````` example -[link](/url 'title "and" title') -. -<p><a href="/url" title="title "and" title">link</a></p> -```````````````````````````````` - - -(Note: `Markdown.pl` 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, -entity and numeric character references, or using a different -quote type for the enclosing title---to write titles containing -double quotes. `Markdown.pl`'s handling of titles has a number -of other strange features. For example, it allows single-quoted -titles in inline links, but not reference links. And, in -reference links but not inline links, it allows a title to begin -with `"` and end with `)`. `Markdown.pl` 1.0.1 even allows -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.) - -[Whitespace] is allowed around the destination and title: - -```````````````````````````````` example -[link]( /uri - "title" ) -. -<p><a href="/uri" title="title">link</a></p> -```````````````````````````````` - - -But it is not allowed between the link text and the -following parenthesis: - -```````````````````````````````` example -[link] (/uri) -. -<p>[link] (/uri)</p> -```````````````````````````````` - - -The link text may contain balanced brackets, but not unbalanced ones, -unless they are escaped: - -```````````````````````````````` example -[link [foo [bar]]](/uri) -. -<p><a href="/uri">link [foo [bar]]</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[link] bar](/uri) -. -<p>[link] bar](/uri)</p> -```````````````````````````````` - - -```````````````````````````````` example -[link [bar](/uri) -. -<p>[link <a href="/uri">bar</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[link \[bar](/uri) -. -<p><a href="/uri">link [bar</a></p> -```````````````````````````````` - - -The link text may contain inline content: - -```````````````````````````````` example -[link *foo **bar** `#`*](/uri) -. -<p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p> -```````````````````````````````` - - -```````````````````````````````` example -[](/uri) -. -<p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p> -```````````````````````````````` - - -However, links may not contain other links, at any level of nesting. - -```````````````````````````````` example -[foo [bar](/uri)](/uri) -. -<p>[foo <a href="/uri">bar</a>](/uri)</p> -```````````````````````````````` - - -```````````````````````````````` example -[foo *[bar [baz](/uri)](/uri)*](/uri) -. -<p>[foo <em>[bar <a href="/uri">baz</a>](/uri)</em>](/uri)</p> -```````````````````````````````` - - -```````````````````````````````` example -](uri2)](uri3) -. -<p><img src="uri3" alt="[foo](uri2)" /></p> -```````````````````````````````` - - -These cases illustrate the precedence of link text grouping over -emphasis grouping: - -```````````````````````````````` example -*[foo*](/uri) -. -<p>*<a href="/uri">foo*</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[foo *bar](baz*) -. -<p><a href="baz*">foo *bar</a></p> -```````````````````````````````` - - -Note that brackets that *aren't* part of links do not take -precedence: - -```````````````````````````````` example -*foo [bar* baz] -. -<p><em>foo [bar</em> baz]</p> -```````````````````````````````` - - -These cases illustrate the precedence of HTML tags, code spans, -and autolinks over link grouping: - -```````````````````````````````` example -[foo <bar attr="](baz)"> -. -<p>[foo <bar attr="](baz)"></p> -```````````````````````````````` - - -```````````````````````````````` example -[foo`](/uri)` -. -<p>[foo<code>](/uri)</code></p> -```````````````````````````````` - - -```````````````````````````````` example -[foo<http://example.com/?search=](uri)> -. -<p>[foo<a href="http://example.com/?search=%5D(uri)">http://example.com/?search=](uri)</a></p> -```````````````````````````````` - - -There are three kinds of [reference link](@)s: -[full](#full-reference-link), [collapsed](#collapsed-reference-link), -and [shortcut](#shortcut-reference-link). - -A [full reference link](@) -consists of a [link text] immediately followed by a [link label] -that [matches] a [link reference definition] elsewhere in the document. - -A [link label](@) begins with a left bracket (`[`) and ends -with the first right bracket (`]`) 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. - -One label [matches](@) -another just in case their normalized forms are equal. To normalize a -label, strip off the opening and closing brackets, -perform the *Unicode case fold*, strip leading and trailing -[whitespace] and collapse consecutive internal -[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.) - -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]. - -Here is a simple example: - -```````````````````````````````` example -[foo][bar] - -[bar]: /url "title" -. -<p><a href="/url" title="title">foo</a></p> -```````````````````````````````` - - -The rules for the [link text] are the same as with -[inline links]. Thus: - -The link text may contain balanced brackets, but not unbalanced ones, -unless they are escaped: - -```````````````````````````````` example -[link [foo [bar]]][ref] - -[ref]: /uri -. -<p><a href="/uri">link [foo [bar]]</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[link \[bar][ref] - -[ref]: /uri -. -<p><a href="/uri">link [bar</a></p> -```````````````````````````````` - - -The link text may contain inline content: - -```````````````````````````````` example -[link *foo **bar** `#`*][ref] - -[ref]: /uri -. -<p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p> -```````````````````````````````` - - -```````````````````````````````` example -[][ref] - -[ref]: /uri -. -<p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p> -```````````````````````````````` - - -However, links may not contain other links, at any level of nesting. - -```````````````````````````````` example -[foo [bar](/uri)][ref] - -[ref]: /uri -. -<p>[foo <a href="/uri">bar</a>]<a href="/uri">ref</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[foo *bar [baz][ref]*][ref] - -[ref]: /uri -. -<p>[foo <em>bar <a href="/uri">baz</a></em>]<a href="/uri">ref</a></p> -```````````````````````````````` - - -(In the examples above, we have two [shortcut reference links] -instead of one [full reference link].) - -The following cases illustrate the precedence of link text grouping over -emphasis grouping: - -```````````````````````````````` example -*[foo*][ref] - -[ref]: /uri -. -<p>*<a href="/uri">foo*</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[foo *bar][ref] - -[ref]: /uri -. -<p><a href="/uri">foo *bar</a></p> -```````````````````````````````` - - -These cases illustrate the precedence of HTML tags, code spans, -and autolinks over link grouping: - -```````````````````````````````` example -[foo <bar attr="][ref]"> - -[ref]: /uri -. -<p>[foo <bar attr="][ref]"></p> -```````````````````````````````` - - -```````````````````````````````` example -[foo`][ref]` - -[ref]: /uri -. -<p>[foo<code>][ref]</code></p> -```````````````````````````````` - - -```````````````````````````````` example -[foo<http://example.com/?search=][ref]> - -[ref]: /uri -. -<p>[foo<a href="http://example.com/?search=%5D%5Bref%5D">http://example.com/?search=][ref]</a></p> -```````````````````````````````` - - -Matching is case-insensitive: - -```````````````````````````````` example -[foo][BaR] - -[bar]: /url "title" -. -<p><a href="/url" title="title">foo</a></p> -```````````````````````````````` - - -Unicode case fold is used: - -```````````````````````````````` example -[Толпой][Толпой] is a Russian word. - -[ТОЛПОЙ]: /url -. -<p><a href="/url">Толпой</a> is a Russian word.</p> -```````````````````````````````` - - -Consecutive internal [whitespace] is treated as one space for -purposes of determining matching: - -```````````````````````````````` example -[Foo - bar]: /url - -[Baz][Foo bar] -. -<p><a href="/url">Baz</a></p> -```````````````````````````````` - - -No [whitespace] is allowed between the [link text] and the -[link label]: - -```````````````````````````````` example -[foo] [bar] - -[bar]: /url "title" -. -<p>[foo] <a href="/url" title="title">bar</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[foo] -[bar] - -[bar]: /url "title" -. -<p>[foo] -<a href="/url" title="title">bar</a></p> -```````````````````````````````` - - -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 -this spec) cannot have whitespace after the link text. More -importantly, it prevents inadvertent capture of consecutive -[shortcut reference links]. If whitespace is allowed between the -link text and the link label, then in the following we will have -a single reference link, not two shortcut reference links, as -intended: - -``` markdown -[foo] -[bar] - -[foo]: /url1 -[bar]: /url2 -``` - -(Note that [shortcut reference links] were introduced by Gruber -himself in a beta version of `Markdown.pl`, 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.) - -When there are multiple matching [link reference definitions], -the first is used: - -```````````````````````````````` example -[foo]: /url1 - -[foo]: /url2 - -[bar][foo] -. -<p><a href="/url1">bar</a></p> -```````````````````````````````` - - -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: - -```````````````````````````````` example -[bar][foo\!] - -[foo!]: /url -. -<p>[bar][foo!]</p> -```````````````````````````````` - - -[Link labels] cannot contain brackets, unless they are -backslash-escaped: - -```````````````````````````````` example -[foo][ref[] - -[ref[]: /uri -. -<p>[foo][ref[]</p> -<p>[ref[]: /uri</p> -```````````````````````````````` - - -```````````````````````````````` example -[foo][ref[bar]] - -[ref[bar]]: /uri -. -<p>[foo][ref[bar]]</p> -<p>[ref[bar]]: /uri</p> -```````````````````````````````` - - -```````````````````````````````` example -[[[foo]]] - -[[[foo]]]: /url -. -<p>[[[foo]]]</p> -<p>[[[foo]]]: /url</p> -```````````````````````````````` - - -```````````````````````````````` example -[foo][ref\[] - -[ref\[]: /uri -. -<p><a href="/uri">foo</a></p> -```````````````````````````````` - - -Note that in this example `]` is not backslash-escaped: - -```````````````````````````````` example -[bar\\]: /uri - -[bar\\] -. -<p><a href="/uri">bar\</a></p> -```````````````````````````````` - - -A [link label] must contain at least one [non-whitespace character]: - -```````````````````````````````` example -[] - -[]: /uri -. -<p>[]</p> -<p>[]: /uri</p> -```````````````````````````````` - - -```````````````````````````````` example -[ - ] - -[ - ]: /uri -. -<p>[ -]</p> -<p>[ -]: /uri</p> -```````````````````````````````` - - -A [collapsed reference link](@) -consists of a [link label] that [matches] a -[link reference definition] elsewhere in the -document, followed by the string `[]`. -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 reference link definition. Thus, -`[foo][]` is equivalent to `[foo][foo]`. - -```````````````````````````````` example -[foo][] - -[foo]: /url "title" -. -<p><a href="/url" title="title">foo</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[*foo* bar][] - -[*foo* bar]: /url "title" -. -<p><a href="/url" title="title"><em>foo</em> bar</a></p> -```````````````````````````````` - - -The link labels are case-insensitive: - -```````````````````````````````` example -[Foo][] - -[foo]: /url "title" -. -<p><a href="/url" title="title">Foo</a></p> -```````````````````````````````` - - - -As with full reference links, [whitespace] is not -allowed between the two sets of brackets: - -```````````````````````````````` example -[foo] -[] - -[foo]: /url "title" -. -<p><a href="/url" title="title">foo</a> -[]</p> -```````````````````````````````` - - -A [shortcut reference link](@) -consists of a [link label] that [matches] a -[link reference definition] elsewhere in the -document and is not followed by `[]` or a link label. -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. -Thus, `[foo]` is equivalent to `[foo][]`. - -```````````````````````````````` example -[foo] - -[foo]: /url "title" -. -<p><a href="/url" title="title">foo</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[*foo* bar] - -[*foo* bar]: /url "title" -. -<p><a href="/url" title="title"><em>foo</em> bar</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[[*foo* bar]] - -[*foo* bar]: /url "title" -. -<p>[<a href="/url" title="title"><em>foo</em> bar</a>]</p> -```````````````````````````````` - - -```````````````````````````````` example -[[bar [foo] - -[foo]: /url -. -<p>[[bar <a href="/url">foo</a></p> -```````````````````````````````` - - -The link labels are case-insensitive: - -```````````````````````````````` example -[Foo] - -[foo]: /url "title" -. -<p><a href="/url" title="title">Foo</a></p> -```````````````````````````````` - - -A space after the link text should be preserved: - -```````````````````````````````` example -[foo] bar - -[foo]: /url -. -<p><a href="/url">foo</a> bar</p> -```````````````````````````````` - - -If you just want bracketed text, you can backslash-escape the -opening bracket to avoid links: - -```````````````````````````````` example -\[foo] - -[foo]: /url "title" -. -<p>[foo]</p> -```````````````````````````````` - - -Note that this is a link, because a link label ends with the first -following closing bracket: - -```````````````````````````````` example -[foo*]: /url - -*[foo*] -. -<p>*<a href="/url">foo*</a></p> -```````````````````````````````` - - -Full and compact references take precedence over shortcut -references: - -```````````````````````````````` example -[foo][bar] - -[foo]: /url1 -[bar]: /url2 -. -<p><a href="/url2">foo</a></p> -```````````````````````````````` - -```````````````````````````````` example -[foo][] - -[foo]: /url1 -. -<p><a href="/url1">foo</a></p> -```````````````````````````````` - -Inline links also take precedence: - -```````````````````````````````` example -[foo]() - -[foo]: /url1 -. -<p><a href="">foo</a></p> -```````````````````````````````` - -```````````````````````````````` example -[foo](not a link) - -[foo]: /url1 -. -<p><a href="/url1">foo</a>(not a link)</p> -```````````````````````````````` - -In the following case `[bar][baz]` is parsed as a reference, -`[foo]` as normal text: - -```````````````````````````````` example -[foo][bar][baz] - -[baz]: /url -. -<p>[foo]<a href="/url">bar</a></p> -```````````````````````````````` - - -Here, though, `[foo][bar]` is parsed as a reference, since -`[bar]` is defined: - -```````````````````````````````` example -[foo][bar][baz] - -[baz]: /url1 -[bar]: /url2 -. -<p><a href="/url2">foo</a><a href="/url1">baz</a></p> -```````````````````````````````` - - -Here `[foo]` is not parsed as a shortcut reference, because it -is followed by a link label (even though `[bar]` is not defined): - -```````````````````````````````` example -[foo][bar][baz] - -[baz]: /url1 -[foo]: /url2 -. -<p>[foo]<a href="/url1">bar</a></p> -```````````````````````````````` - - - -## Images - -Syntax for images is like the syntax for links, with one -difference. Instead of [link text], we have an -[image description](@). The rules for this are the -same as for [link text], except that (a) an -image description starts with ` -. -<p><img src="/url" alt="foo" title="title" /></p> -```````````````````````````````` - - -```````````````````````````````` example -![foo *bar*] - -[foo *bar*]: train.jpg "train & tracks" -. -<p><img src="train.jpg" alt="foo bar" title="train & tracks" /></p> -```````````````````````````````` - - -```````````````````````````````` example -](/url2) -. -<p><img src="/url2" alt="foo bar" /></p> -```````````````````````````````` - - -```````````````````````````````` example -](/url2) -. -<p><img src="/url2" alt="foo bar" /></p> -```````````````````````````````` - - -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 `foo bar`, not `foo -[bar](/url)` or `foo <a href="/url">bar</a>`. Only the plain string -content is rendered, without formatting. - -```````````````````````````````` example -![foo *bar*][] - -[foo *bar*]: train.jpg "train & tracks" -. -<p><img src="train.jpg" alt="foo bar" title="train & tracks" /></p> -```````````````````````````````` - - -```````````````````````````````` example -![foo *bar*][foobar] - -[FOOBAR]: train.jpg "train & tracks" -. -<p><img src="train.jpg" alt="foo bar" title="train & tracks" /></p> -```````````````````````````````` - - -```````````````````````````````` example - -. -<p><img src="train.jpg" alt="foo" /></p> -```````````````````````````````` - - -```````````````````````````````` example -My  -. -<p>My <img src="/path/to/train.jpg" alt="foo bar" title="title" /></p> -```````````````````````````````` - - -```````````````````````````````` example - -. -<p><img src="url" alt="foo" /></p> -```````````````````````````````` - - -```````````````````````````````` example - -. -<p><img src="/url" alt="" /></p> -```````````````````````````````` - - -Reference-style: - -```````````````````````````````` example -![foo][bar] - -[bar]: /url -. -<p><img src="/url" alt="foo" /></p> -```````````````````````````````` - - -```````````````````````````````` example -![foo][bar] - -[BAR]: /url -. -<p><img src="/url" alt="foo" /></p> -```````````````````````````````` - - -Collapsed: - -```````````````````````````````` example -![foo][] - -[foo]: /url "title" -. -<p><img src="/url" alt="foo" title="title" /></p> -```````````````````````````````` - - -```````````````````````````````` example -![*foo* bar][] - -[*foo* bar]: /url "title" -. -<p><img src="/url" alt="foo bar" title="title" /></p> -```````````````````````````````` - - -The labels are case-insensitive: - -```````````````````````````````` example -![Foo][] - -[foo]: /url "title" -. -<p><img src="/url" alt="Foo" title="title" /></p> -```````````````````````````````` - - -As with reference links, [whitespace] is not allowed -between the two sets of brackets: - -```````````````````````````````` example -![foo] -[] - -[foo]: /url "title" -. -<p><img src="/url" alt="foo" title="title" /> -[]</p> -```````````````````````````````` - - -Shortcut: - -```````````````````````````````` example -![foo] - -[foo]: /url "title" -. -<p><img src="/url" alt="foo" title="title" /></p> -```````````````````````````````` - - -```````````````````````````````` example -![*foo* bar] - -[*foo* bar]: /url "title" -. -<p><img src="/url" alt="foo bar" title="title" /></p> -```````````````````````````````` - - -Note that link labels cannot contain unescaped brackets: - -```````````````````````````````` example -![[foo]] - -[[foo]]: /url "title" -. -<p>![[foo]]</p> -<p>[[foo]]: /url "title"</p> -```````````````````````````````` - - -The link labels are case-insensitive: - -```````````````````````````````` example -![Foo] - -[foo]: /url "title" -. -<p><img src="/url" alt="Foo" title="title" /></p> -```````````````````````````````` - - -If you just want a literal `!` followed by bracketed text, you can -backslash-escape the opening `[`: - -```````````````````````````````` example -!\[foo] - -[foo]: /url "title" -. -<p>![foo]</p> -```````````````````````````````` - - -If you want a link after a literal `!`, backslash-escape the -`!`: - -```````````````````````````````` example -\![foo] - -[foo]: /url "title" -. -<p>!<a href="/url" title="title">foo</a></p> -```````````````````````````````` - - -## Autolinks - -[Autolink](@)s are absolute URIs and email addresses inside -`<` and `>`. They are parsed as links, with the URL or email address -as the link label. - -A [URI autolink](@) consists of `<`, followed by an -[absolute URI] followed by `>`. It is parsed as -a link to the URI, with the URI as the link's label. - -An [absolute URI](@), -for these purposes, consists of a [scheme] followed by a colon (`:`) -followed by zero or more characters other than ASCII -[whitespace] and control characters, `<`, and `>`. If -the URI includes these characters, they must be percent-encoded -(e.g. `%20` for a space). - -For purposes of this spec, a [scheme](@) 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 ("-"). - -Here are some valid autolinks: - -```````````````````````````````` example -<http://foo.bar.baz> -. -<p><a href="http://foo.bar.baz">http://foo.bar.baz</a></p> -```````````````````````````````` - - -```````````````````````````````` example -<http://foo.bar.baz/test?q=hello&id=22&boolean> -. -<p><a href="http://foo.bar.baz/test?q=hello&id=22&boolean">http://foo.bar.baz/test?q=hello&id=22&boolean</a></p> -```````````````````````````````` - - -```````````````````````````````` example -<irc://foo.bar:2233/baz> -. -<p><a href="irc://foo.bar:2233/baz">irc://foo.bar:2233/baz</a></p> -```````````````````````````````` - - -Uppercase is also fine: - -```````````````````````````````` example -<MAILTO:FOO@BAR.BAZ> -. -<p><a href="MAILTO:FOO@BAR.BAZ">MAILTO:FOO@BAR.BAZ</a></p> -```````````````````````````````` - - -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: - -```````````````````````````````` example -<a+b+c:d> -. -<p><a href="a+b+c:d">a+b+c:d</a></p> -```````````````````````````````` - - -```````````````````````````````` example -<made-up-scheme://foo,bar> -. -<p><a href="made-up-scheme://foo,bar">made-up-scheme://foo,bar</a></p> -```````````````````````````````` - - -```````````````````````````````` example -<http://../> -. -<p><a href="http://../">http://../</a></p> -```````````````````````````````` - - -```````````````````````````````` example -<localhost:5001/foo> -. -<p><a href="localhost:5001/foo">localhost:5001/foo</a></p> -```````````````````````````````` - - -Spaces are not allowed in autolinks: - -```````````````````````````````` example -<http://foo.bar/baz bim> -. -<p><http://foo.bar/baz bim></p> -```````````````````````````````` - - -Backslash-escapes do not work inside autolinks: - -```````````````````````````````` example -<http://example.com/\[\> -. -<p><a href="http://example.com/%5C%5B%5C">http://example.com/\[\</a></p> -```````````````````````````````` - - -An [email autolink](@) -consists of `<`, followed by an [email address], -followed by `>`. The link's label is the email address, -and the URL is `mailto:` followed by the email address. - -An [email address](@), -for these purposes, is anything that matches -the [non-normative regex from the HTML5 -spec](https://html.spec.whatwg.org/multipage/forms.html#e-mail-state-(type=email)): - - /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])? - (?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/ - -Examples of email autolinks: - -```````````````````````````````` example -<foo@bar.example.com> -. -<p><a href="mailto:foo@bar.example.com">foo@bar.example.com</a></p> -```````````````````````````````` - - -```````````````````````````````` example -<foo+special@Bar.baz-bar0.com> -. -<p><a href="mailto:foo+special@Bar.baz-bar0.com">foo+special@Bar.baz-bar0.com</a></p> -```````````````````````````````` - - -Backslash-escapes do not work inside email autolinks: - -```````````````````````````````` example -<foo\+@bar.example.com> -. -<p><foo+@bar.example.com></p> -```````````````````````````````` - - -These are not autolinks: - -```````````````````````````````` example -<> -. -<p><></p> -```````````````````````````````` - - -```````````````````````````````` example -< http://foo.bar > -. -<p>< http://foo.bar ></p> -```````````````````````````````` - - -```````````````````````````````` example -<m:abc> -. -<p><m:abc></p> -```````````````````````````````` - - -```````````````````````````````` example -<foo.bar.baz> -. -<p><foo.bar.baz></p> -```````````````````````````````` - - -```````````````````````````````` example -http://example.com -. -<p>http://example.com</p> -```````````````````````````````` - - -```````````````````````````````` example -foo@bar.example.com -. -<p>foo@bar.example.com</p> -```````````````````````````````` - -<div class="extension"> - -## Autolinks (extension) - -GFM enables the `autolink` extension, where autolinks will be recognised in a -greater number of conditions. - -[Autolink]s can also be constructed without requiring the use of `<` and to `>` -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 `*`, `_`, `~`, -and `(`. - -An [extended www autolink](@) will be recognized -when the text `www.` is found followed by a [valid domain]. -A [valid domain](@) consists of segments -of alphanumeric characters, underscores (`_`) and hyphens (`-`) -separated by periods (`.`). -There must be at least one period, -and no underscores may be present in the last two segments of the domain. - -The scheme `http` will be inserted automatically: - -```````````````````````````````` example autolink -www.commonmark.org -. -<p><a href="http://www.commonmark.org">www.commonmark.org</a></p> -```````````````````````````````` - -After a [valid domain], zero or more non-space non-`<` characters may follow: - -```````````````````````````````` example autolink -Visit www.commonmark.org/help for more information. -. -<p>Visit <a href="http://www.commonmark.org/help">www.commonmark.org/help</a> for more information.</p> -```````````````````````````````` - -We then apply [extended autolink path validation](@) as follows: - -Trailing punctuation (specifically, `?`, `!`, `.`, `,`, `:`, `*`, `_`, and `~`) -will not be considered part of the autolink, though they may be included in the -interior of the link: - -```````````````````````````````` example autolink -Visit www.commonmark.org. - -Visit www.commonmark.org/a.b. -. -<p>Visit <a href="http://www.commonmark.org">www.commonmark.org</a>.</p> -<p>Visit <a href="http://www.commonmark.org/a.b">www.commonmark.org/a.b</a>.</p> -```````````````````````````````` - -When an autolink ends in `)`, 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: - -```````````````````````````````` example autolink -www.google.com/search?q=Markup+(business) - -www.google.com/search?q=Markup+(business))) - -(www.google.com/search?q=Markup+(business)) - -(www.google.com/search?q=Markup+(business) -. -<p><a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a></p> -<p><a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a>))</p> -<p>(<a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a>)</p> -<p>(<a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a></p> -```````````````````````````````` - -This check is only done when the link ends in a closing parentheses `)`, so if -the only parentheses are in the interior of the autolink, no special rules are -applied: - -```````````````````````````````` example autolink -www.google.com/search?q=(business))+ok -. -<p><a href="http://www.google.com/search?q=(business))+ok">www.google.com/search?q=(business))+ok</a></p> -```````````````````````````````` - -If an autolink ends in a semicolon (`;`), we check to see if it appears to -resemble an [entity reference][entity references]; if the preceding text is `&` -followed by one or more alphanumeric characters. If so, it is excluded from -the autolink: - -```````````````````````````````` example autolink -www.google.com/search?q=commonmark&hl=en - -www.google.com/search?q=commonmark&hl; -. -<p><a href="http://www.google.com/search?q=commonmark&hl=en">www.google.com/search?q=commonmark&hl=en</a></p> -<p><a href="http://www.google.com/search?q=commonmark">www.google.com/search?q=commonmark</a>&hl;</p> -```````````````````````````````` - -`<` immediately ends an autolink. - -```````````````````````````````` example autolink -www.commonmark.org/he<lp -. -<p><a href="http://www.commonmark.org/he">www.commonmark.org/he</a><lp</p> -```````````````````````````````` - -An [extended url autolink](@) will be recognised when one of the schemes -`http://`, `https://`, or `ftp://`, followed by a [valid domain], then zero or -more non-space non-`<` characters according to -[extended autolink path validation]: - -```````````````````````````````` example autolink -http://commonmark.org - -(Visit https://encrypted.google.com/search?q=Markup+(business)) - -Anonymous FTP is available at ftp://foo.bar.baz. -. -<p><a href="http://commonmark.org">http://commonmark.org</a></p> -<p>(Visit <a href="https://encrypted.google.com/search?q=Markup+(business)">https://encrypted.google.com/search?q=Markup+(business)</a>)</p> -<p>Anonymous FTP is available at <a href="ftp://foo.bar.baz">ftp://foo.bar.baz</a>.</p> -```````````````````````````````` - - -An [extended email autolink](@) will be recognised when an email address is -recognised within any text node. Email addresses are recognised according to -the following rules: - -* One ore more characters which are alphanumeric, or `.`, `-`, `_`, or `+`. -* An `@` symbol. -* One or more characters which are alphanumeric, or `-` or `_`, - separated by periods (`.`). - There must be at least one period. - The last character must not be one of `-` or `_`. - -The scheme `mailto:` will automatically be added to the generated link: - -```````````````````````````````` example autolink -foo@bar.baz -. -<p><a href="mailto:foo@bar.baz">foo@bar.baz</a></p> -```````````````````````````````` - -`+` can occur before the `@`, but not after. - -```````````````````````````````` example autolink -hello@mail+xyz.example isn't valid, but hello+xyz@mail.example is. -. -<p>hello@mail+xyz.example isn't valid, but <a href="mailto:hello+xyz@mail.example">hello+xyz@mail.example</a> is.</p> -```````````````````````````````` - -`.`, `-`, and `_` can occur on both sides of the `@`, but only `.` may occur at -the end of the email address, in which case it will not be considered part of -the address: - -```````````````````````````````` example autolink -a.b-c_d@a.b - -a.b-c_d@a.b. - -a.b-c_d@a.b- - -a.b-c_d@a.b_ -. -<p><a href="mailto:a.b-c_d@a.b">a.b-c_d@a.b</a></p> -<p><a href="mailto:a.b-c_d@a.b">a.b-c_d@a.b</a>.</p> -<p>a.b-c_d@a.b-</p> -<p>a.b-c_d@a.b_</p> -```````````````````````````````` - -</div> - -## Raw HTML - -Text between `<` and `>` 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. - -Here is the grammar for tags: - -A [tag name](@) consists of an ASCII letter -followed by zero or more ASCII letters, digits, or -hyphens (`-`). - -An [attribute](@) consists of [whitespace], -an [attribute name], and an optional -[attribute value specification]. - -An [attribute name](@) -consists of an ASCII letter, `_`, or `:`, followed by zero or more ASCII -letters, digits, `_`, `.`, `:`, or `-`. (Note: This is the XML -specification restricted to ASCII. HTML5 is laxer.) - -An [attribute value specification](@) -consists of optional [whitespace], -a `=` character, optional [whitespace], and an [attribute -value]. - -An [attribute value](@) -consists of an [unquoted attribute value], -a [single-quoted attribute value], or a [double-quoted attribute value]. - -An [unquoted attribute value](@) -is a nonempty string of characters not -including [whitespace], `"`, `'`, `=`, `<`, `>`, or `` ` ``. - -A [single-quoted attribute value](@) -consists of `'`, zero or more -characters not including `'`, and a final `'`. - -A [double-quoted attribute value](@) -consists of `"`, zero or more -characters not including `"`, and a final `"`. - -An [open tag](@) consists of a `<` character, a [tag name], -zero or more [attributes], optional [whitespace], an optional `/` -character, and a `>` character. - -A [closing tag](@) consists of the string `</`, a -[tag name], optional [whitespace], and the character `>`. - -An [HTML comment](@) consists of `<!--` + *text* + `-->`, -where *text* does not start with `>` or `->`, does not end with `-`, -and does not contain `--`. (See the -[HTML5 spec](http://www.w3.org/TR/html5/syntax.html#comments).) - -A [processing instruction](@) -consists of the string `<?`, a string -of characters not including the string `?>`, and the string -`?>`. - -A [declaration](@) consists of the -string `<!`, a name consisting of one or more uppercase ASCII letters, -[whitespace], a string of characters not including the -character `>`, and the character `>`. - -A [CDATA section](@) consists of -the string `<![CDATA[`, a string of characters not including the string -`]]>`, and the string `]]>`. - -An [HTML tag](@) consists of an [open tag], a [closing tag], -an [HTML comment], a [processing instruction], a [declaration], -or a [CDATA section]. - -Here are some simple open tags: - -```````````````````````````````` example -<a><bab><c2c> -. -<p><a><bab><c2c></p> -```````````````````````````````` - - -Empty elements: - -```````````````````````````````` example -<a/><b2/> -. -<p><a/><b2/></p> -```````````````````````````````` - - -[Whitespace] is allowed: - -```````````````````````````````` example -<a /><b2 -data="foo" > -. -<p><a /><b2 -data="foo" ></p> -```````````````````````````````` - - -With attributes: - -```````````````````````````````` example -<a foo="bar" bam = 'baz <em>"</em>' -_boolean zoop:33=zoop:33 /> -. -<p><a foo="bar" bam = 'baz <em>"</em>' -_boolean zoop:33=zoop:33 /></p> -```````````````````````````````` - - -Custom tag names can be used: - -```````````````````````````````` example -Foo <responsive-image src="foo.jpg" /> -. -<p>Foo <responsive-image src="foo.jpg" /></p> -```````````````````````````````` - - -Illegal tag names, not parsed as HTML: - -```````````````````````````````` example -<33> <__> -. -<p><33> <__></p> -```````````````````````````````` - - -Illegal attribute names: - -```````````````````````````````` example -<a h*#ref="hi"> -. -<p><a h*#ref="hi"></p> -```````````````````````````````` - - -Illegal attribute values: - -```````````````````````````````` example -<a href="hi'> <a href=hi'> -. -<p><a href="hi'> <a href=hi'></p> -```````````````````````````````` - - -Illegal [whitespace]: - -```````````````````````````````` example -< a>< -foo><bar/ > -<foo bar=baz -bim!bop /> -. -<p>< a>< -foo><bar/ > -<foo bar=baz -bim!bop /></p> -```````````````````````````````` - - -Missing [whitespace]: - -```````````````````````````````` example -<a href='bar'title=title> -. -<p><a href='bar'title=title></p> -```````````````````````````````` - - -Closing tags: - -```````````````````````````````` example -</a></foo > -. -<p></a></foo ></p> -```````````````````````````````` - - -Illegal attributes in closing tag: - -```````````````````````````````` example -</a href="foo"> -. -<p></a href="foo"></p> -```````````````````````````````` - - -Comments: - -```````````````````````````````` example -foo <!-- this is a -comment - with hyphen --> -. -<p>foo <!-- this is a -comment - with hyphen --></p> -```````````````````````````````` - - -```````````````````````````````` example -foo <!-- not a comment -- two hyphens --> -. -<p>foo <!-- not a comment -- two hyphens --></p> -```````````````````````````````` - - -Not comments: - -```````````````````````````````` example -foo <!--> foo --> - -foo <!-- foo---> -. -<p>foo <!--> foo --></p> -<p>foo <!-- foo---></p> -```````````````````````````````` - - -Processing instructions: - -```````````````````````````````` example -foo <?php echo $a; ?> -. -<p>foo <?php echo $a; ?></p> -```````````````````````````````` - - -Declarations: - -```````````````````````````````` example -foo <!ELEMENT br EMPTY> -. -<p>foo <!ELEMENT br EMPTY></p> -```````````````````````````````` - - -CDATA sections: - -```````````````````````````````` example -foo <![CDATA[>&<]]> -. -<p>foo <![CDATA[>&<]]></p> -```````````````````````````````` - - -Entity and numeric character references are preserved in HTML -attributes: - -```````````````````````````````` example -foo <a href="ö"> -. -<p>foo <a href="ö"></p> -```````````````````````````````` - - -Backslash escapes do not work in HTML attributes: - -```````````````````````````````` example -foo <a href="\*"> -. -<p>foo <a href="\*"></p> -```````````````````````````````` - - -```````````````````````````````` example -<a href="\""> -. -<p><a href="""></p> -```````````````````````````````` - - -<div class="extension"> - -## Disallowed Raw HTML (extension) - -GFM enables the `tagfilter` extension, where the following HTML tags will be -filtered when rendering HTML output: - -* `<title>` -* `<textarea>` -* `<style>` -* `<xmp>` -* `<iframe>` -* `<noembed>` -* `<noframes>` -* `<script>` -* `<plaintext>` - -Filtering is done by replacing the leading `<` with the entity `<`. 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. - -All other HTML tags are left untouched. - -```````````````````````````````` example tagfilter -<strong> <title> <style> <em> - -<blockquote> - <xmp> is disallowed. <XMP> is also disallowed. -</blockquote> -. -<p><strong> <title> <style> <em></p> -<blockquote> - <xmp> is disallowed. <XMP> is also disallowed. -</blockquote> -```````````````````````````````` - -</div> - -## Hard line breaks - -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 [hard line break](@) (rendered -in HTML as a `<br />` tag): - -```````````````````````````````` example -foo -baz -. -<p>foo<br /> -baz</p> -```````````````````````````````` - - -For a more visible alternative, a backslash before the -[line ending] may be used instead of two spaces: - -```````````````````````````````` example -foo\ -baz -. -<p>foo<br /> -baz</p> -```````````````````````````````` - - -More than two spaces can be used: - -```````````````````````````````` example -foo -baz -. -<p>foo<br /> -baz</p> -```````````````````````````````` - - -Leading spaces at the beginning of the next line are ignored: - -```````````````````````````````` example -foo - bar -. -<p>foo<br /> -bar</p> -```````````````````````````````` - - -```````````````````````````````` example -foo\ - bar -. -<p>foo<br /> -bar</p> -```````````````````````````````` - - -Line breaks can occur inside emphasis, links, and other constructs -that allow inline content: - -```````````````````````````````` example -*foo -bar* -. -<p><em>foo<br /> -bar</em></p> -```````````````````````````````` - - -```````````````````````````````` example -*foo\ -bar* -. -<p><em>foo<br /> -bar</em></p> -```````````````````````````````` - - -Line breaks do not occur inside code spans - -```````````````````````````````` example -`code -span` -. -<p><code>code span</code></p> -```````````````````````````````` - - -```````````````````````````````` example -`code\ -span` -. -<p><code>code\ span</code></p> -```````````````````````````````` - - -or HTML tags: - -```````````````````````````````` example -<a href="foo -bar"> -. -<p><a href="foo -bar"></p> -```````````````````````````````` - - -```````````````````````````````` example -<a href="foo\ -bar"> -. -<p><a href="foo\ -bar"></p> -```````````````````````````````` - - -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: - -```````````````````````````````` example -foo\ -. -<p>foo\</p> -```````````````````````````````` - - -```````````````````````````````` example -foo -. -<p>foo</p> -```````````````````````````````` - - -```````````````````````````````` example -### foo\ -. -<h3>foo\</h3> -```````````````````````````````` - - -```````````````````````````````` example -### foo -. -<h3>foo</h3> -```````````````````````````````` - - -## Soft line breaks - -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 -[softbreak](@). (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.) - -```````````````````````````````` example -foo -baz -. -<p>foo -baz</p> -```````````````````````````````` - - -Spaces at the end of the line and beginning of the next line are -removed: - -```````````````````````````````` example -foo - baz -. -<p>foo -baz</p> -```````````````````````````````` - - -A conforming parser may render a soft line break in HTML either as a -line break or as a space. - -A renderer may also provide an option to render soft line breaks -as hard line breaks. - -## Textual content - -Any characters not given an interpretation by the above rules will -be parsed as plain textual content. - -```````````````````````````````` example -hello $.;'there -. -<p>hello $.;'there</p> -```````````````````````````````` - - -```````````````````````````````` example -Foo χÏῆν -. -<p>Foo χÏῆν</p> -```````````````````````````````` - - -Internal spaces are preserved verbatim: - -```````````````````````````````` example -Multiple spaces -. -<p>Multiple spaces</p> -```````````````````````````````` - - -<!-- END TESTS --> - -# Appendix: A parsing strategy - -In this appendix we describe some features of the parsing strategy -used in the CommonMark reference implementations. - -## Overview - -Parsing has two phases: - -1. In the first phase, lines of input are consumed and the block -structure of the document---its division into paragraphs, block quotes, -list items, and so on---is constructed. Text is assigned to these -blocks but not parsed. Link reference definitions are parsed and a -map of links is constructed. - -2. In the second phase, the raw text contents of paragraphs and headings -are parsed into sequences of Markdown inline elements (strings, -code spans, links, emphasis, and so on), using the map of link -references constructed in phase 1. - -At each point in processing, the document is represented as a tree of -**blocks**. The root of the tree is a `document` block. The `document` -may have any number of other blocks as **children**. These children -may, in turn, have other blocks as children. The last child of a block -is normally considered **open**, meaning that subsequent lines of input -can alter its contents. (Blocks that are not open are **closed**.) -Here, for example, is a possible document tree, with the open blocks -marked by arrows: - -``` tree --> document - -> block_quote - paragraph - "Lorem ipsum dolor\nsit amet." - -> list (type=bullet tight=true bullet_char=-) - list_item - paragraph - "Qui *quodsi iracundia*" - -> list_item - -> paragraph - "aliquando id" -``` - -## Phase 1: block structure - -Each line that is processed has an effect on this tree. The line is -analyzed and, depending on its contents, the document may be altered -in one or more of the following ways: - -1. One or more open blocks may be closed. -2. One or more new blocks may be created as children of the - last open block. -3. Text may be added to the last (deepest) open block remaining - on the tree. - -Once a line has been incorporated into the tree in this way, -it can be discarded, so input can be read in a stream. - -For each line, we follow this procedure: - -1. First we iterate through the open blocks, starting with the -root document, and descending through last children down to the last -open block. Each block imposes a condition that the line must satisfy -if the block is to remain open. For example, a block quote requires a -`>` character. A paragraph requires a non-blank line. -In this phase we may match all or just some of the open -blocks. But we cannot close unmatched blocks yet, because we may have a -[lazy continuation line]. - -2. Next, after consuming the continuation markers for existing -blocks, we look for new block starts (e.g. `>` for a block quote). -If we encounter a new block start, we close any blocks unmatched -in step 1 before creating the new block as a child of the last -matched block. - -3. Finally, we look at the remainder of the line (after block -markers like `>`, list markers, and indentation have been consumed). -This is text that can be incorporated into the last open -block (a paragraph, code block, heading, or raw HTML). - -Setext headings are formed when we see a line of a paragraph -that is a [setext heading underline]. - -Reference link definitions are detected when a paragraph is closed; -the accumulated text lines are parsed to see if they begin with -one or more reference link definitions. Any remainder becomes a -normal paragraph. - -We can see how this works by considering how the tree above is -generated by four lines of Markdown: - -``` markdown -> Lorem ipsum dolor -sit amet. -> - Qui *quodsi iracundia* -> - aliquando id -``` - -At the outset, our document model is just - -``` tree --> document -``` - -The first line of our text, - -``` markdown -> Lorem ipsum dolor -``` - -causes a `block_quote` block to be created as a child of our -open `document` block, and a `paragraph` block as a child of -the `block_quote`. Then the text is added to the last open -block, the `paragraph`: - -``` tree --> document - -> block_quote - -> paragraph - "Lorem ipsum dolor" -``` - -The next line, - -``` markdown -sit amet. -``` - -is a "lazy continuation" of the open `paragraph`, so it gets added -to the paragraph's text: - -``` tree --> document - -> block_quote - -> paragraph - "Lorem ipsum dolor\nsit amet." -``` - -The third line, - -``` markdown -> - Qui *quodsi iracundia* -``` - -causes the `paragraph` block to be closed, and a new `list` block -opened as a child of the `block_quote`. A `list_item` is also -added as a child of the `list`, and a `paragraph` as a child of -the `list_item`. The text is then added to the new `paragraph`: - -``` tree --> document - -> block_quote - paragraph - "Lorem ipsum dolor\nsit amet." - -> list (type=bullet tight=true bullet_char=-) - -> list_item - -> paragraph - "Qui *quodsi iracundia*" -``` - -The fourth line, - -``` markdown -> - aliquando id -``` - -causes the `list_item` (and its child the `paragraph`) to be closed, -and a new `list_item` opened up as child of the `list`. A `paragraph` -is added as a child of the new `list_item`, to contain the text. -We thus obtain the final tree: - -``` tree --> document - -> block_quote - paragraph - "Lorem ipsum dolor\nsit amet." - -> list (type=bullet tight=true bullet_char=-) - list_item - paragraph - "Qui *quodsi iracundia*" - -> list_item - -> paragraph - "aliquando id" -``` - -## Phase 2: inline structure - -Once all of the input has been parsed, all open blocks are closed. - -We then "walk the tree," visiting every node, and parse raw -string contents of paragraphs and headings as inlines. At this -point we have seen all the link reference definitions, so we can -resolve reference links as we go. - -``` tree -document - block_quote - paragraph - str "Lorem ipsum dolor" - softbreak - str "sit amet." - list (type=bullet tight=true bullet_char=-) - list_item - paragraph - str "Qui " - emph - str "quodsi iracundia" - list_item - paragraph - str "aliquando id" -``` - -Notice how the [line ending] in the first paragraph has -been parsed as a `softbreak`, and the asterisks in the first list item -have become an `emph`. - -### An algorithm for parsing nested emphasis and links - -By far the trickiest part of inline parsing is handling emphasis, -strong emphasis, links, and images. This is done using the following -algorithm. - -When we're parsing inlines and we hit either - -- a run of `*` or `_` characters, or -- a `[` or `. - -The [delimiter stack] is a doubly linked list. Each -element contains a pointer to a text node, plus information about - -- the type of delimiter (`[`, `![`, `*`, `_`) -- the number of delimiters, -- whether the delimiter is "active" (all are active to start), and -- whether the delimiter is a potential opener, a potential closer, - or both (which depends on what sort of characters precede - and follow the delimiters). - -When we hit a `]` character, we call the *look for link or image* -procedure (see below). - -When we hit the end of the input, we call the *process emphasis* -procedure (see below), with `stack_bottom` = NULL. - -#### *look for link or image* - -Starting at the top of the delimiter stack, we look backwards -through the stack for an opening `[` or `![` delimiter. - -- If we don't find one, we return a literal text node `]`. - -- If we do find one, but it's not *active*, we remove the inactive - delimiter from the stack, and return a literal text node `]`. - -- If we find one and it's active, then we parse ahead to see if - we have an inline link/image, reference link/image, compact reference - link/image, or shortcut reference link/image. - - + If we don't, then we remove the opening delimiter from the - delimiter stack and return a literal text node `]`. - - + If we do, then - - * We return a link or image node whose children are the inlines - after the text node pointed to by the opening delimiter. - - * We run *process emphasis* on these inlines, with the `[` opener - as `stack_bottom`. - - * We remove the opening delimiter. - - * If we have a link (and not an image), we also set all - `[` delimiters before the opening delimiter to *inactive*. (This - will prevent us from getting links within links.) - -#### *process emphasis* - -Parameter `stack_bottom` sets a lower bound to how far we -descend in the [delimiter stack]. If it is NULL, we can -go all the way to the bottom. Otherwise, we stop before -visiting `stack_bottom`. - -Let `current_position` point to the element on the [delimiter stack] -just above `stack_bottom` (or the first element if `stack_bottom` -is NULL). - -We keep track of the `openers_bottom` for each delimiter -type (`*`, `_`) and each length of the closing delimiter run -(modulo 3). Initialize this to `stack_bottom`. - -Then we repeat the following until we run out of potential -closers: - -- Move `current_position` forward in the delimiter stack (if needed) - until we find the first potential closer with delimiter `*` or `_`. - (This will be the potential closer closest - to the beginning of the input -- the first one in parse order.) - -- Now, look back in the stack (staying above `stack_bottom` and - the `openers_bottom` for this delimiter type) for the - first matching potential opener ("matching" means same delimiter). - -- If one is found: - - + Figure out whether we have emphasis or strong emphasis: - if both closer and opener spans have length >= 2, we have - strong, otherwise regular. - - + Insert an emph or strong emph node accordingly, after - the text node corresponding to the opener. - - + Remove any delimiters between the opener and closer from - the delimiter stack. - - + Remove 1 (for regular emph) or 2 (for strong emph) delimiters - from the opening and closing text nodes. If they become empty - as a result, remove them and remove the corresponding element - of the delimiter stack. If the closing node is removed, reset - `current_position` to the next element in the stack. - -- If none is found: - - + Set `openers_bottom` to the element before `current_position`. - (We know that there are no openers for this kind of closer up to and - including this point, so this puts a lower bound on future searches.) - - + If the closer at `current_position` is not a potential opener, - remove it from the delimiter stack (since we know it can't - be a closer either). - - + Advance `current_position` to the next element in the stack. - -After we're done, we remove all delimiters above `stack_bottom` from the -delimiter stack. diff --git a/glfm_specification/input/gitlab_flavored_markdown/glfm_example_metadata.yml b/glfm_specification/input/gitlab_flavored_markdown/glfm_example_metadata.yml deleted file mode 100644 index efddf75f0e9092f2595e3625f32be512bda68abc..0000000000000000000000000000000000000000 --- a/glfm_specification/input/gitlab_flavored_markdown/glfm_example_metadata.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__001: - api_request_override_path: /groups/glfm_group/-/preview_markdown -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__002: - api_request_override_path: /glfm_group/glfm_project/-/preview_markdown -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__003: - api_request_override_path: /glfm_group/glfm_project/-/preview_markdown -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__004: - api_request_override_path: /-/snippets/preview_markdown -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__005: - api_request_override_path: /glfm_group/glfm_project/-/wikis/new_page/preview_markdown -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__006: - ee: true - api_request_override_path: /groups/glfm_group/-/wikis/new_page/preview_markdown -08_04_01__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_image_for_group__001: - api_request_override_path: /groups/glfm_group/-/preview_markdown -08_04_02__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_image_for_project__001: - api_request_override_path: /glfm_group/glfm_project/-/preview_markdown -08_04_03__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_image_for_project_wiki__001: - api_request_override_path: /glfm_group/glfm_project/-/wikis/new_page/preview_markdown -08_04_04__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_link_for_group__001: - api_request_override_path: /groups/glfm_group/-/preview_markdown -08_04_05__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_link_for_project__001: - api_request_override_path: /glfm_group/glfm_project/-/preview_markdown -08_04_06__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_link_for_project_wiki__001: - api_request_override_path: /glfm_group/glfm_project/-/wikis/new_page/preview_markdown -08_04_07__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_link_for_group_wiki__001: - ee: true - api_request_override_path: /groups/glfm_group/-/wikis/new_page/preview_markdown -08_04_46__gitlab_internal_extension_markdown__migrated_golden_master_examples__reference_for_project_wiki__001: - api_request_override_path: /glfm_group/glfm_project/-/wikis/new_page/preview_markdown diff --git a/glfm_specification/input/gitlab_flavored_markdown/glfm_example_normalizations.yml b/glfm_specification/input/gitlab_flavored_markdown/glfm_example_normalizations.yml deleted file mode 100644 index 06de4e687af47ee67e607367b6dcb2df84be7a2e..0000000000000000000000000000000000000000 --- a/glfm_specification/input/gitlab_flavored_markdown/glfm_example_normalizations.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -# See the following documentation for more info on normalization: -# -# - https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#normalization -# - https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#glfm_example_normalizationsyml -# -# NOTE: All YAML anchors which are shared across one or more entries are defined in the `00_shared` section. -# They must all start with `00_` in order to be skipped during example name validation. -00_shared: - 00_uri: &00_uri - - regex: '(href|data-src)(=")(.*?)(test-file\.(png|zip)")' - replacement: '\1\2URI_PREFIX\4' diff --git a/glfm_specification/input/gitlab_flavored_markdown/glfm_example_status.yml b/glfm_specification/input/gitlab_flavored_markdown/glfm_example_status.yml deleted file mode 100644 index 03d9a2aea335a44b46418e3bc9fc0000092e0320..0000000000000000000000000000000000000000 --- a/glfm_specification/input/gitlab_flavored_markdown/glfm_example_status.yml +++ /dev/null @@ -1,110 +0,0 @@ ---- -02_01_00__preliminaries__tabs__001: - # NOTE: False values are optional, they are only included here for reference. See - # https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#glfm_example_statusyml - # for more details. - skip_update_example_snapshots: false - skip_update_example_snapshot_html_static: false - skip_update_example_snapshot_html_wysiwyg: false - skip_update_example_snapshot_prosemirror_json: false - skip_running_conformance_static_tests: false # NOT YET SUPPORTED - skip_running_conformance_wysiwyg_tests: false # NOT YET SUPPORTED - skip_running_snapshot_static_html_tests: false # NOT YET SUPPORTED - skip_running_snapshot_wysiwyg_html_tests: false - skip_running_snapshot_prosemirror_json_tests: false -07_01_00__gitlab_official_specification_markdown__task_list_items__003: - skip_update_example_snapshot_html_wysiwyg: Inapplicable task list items not yet implemented for WYSYWIG - skip_update_example_snapshot_prosemirror_json: Inapplicable task list items not yet implemented for WYSYWIG - skip_running_conformance_wysiwyg_tests: Inapplicable task list items not yet implemented for WYSYWIG - skip_running_snapshot_wysiwyg_html_tests: Inapplicable task list items not yet implemented for WYSYWIG - skip_running_snapshot_prosemirror_json_tests: Inapplicable task list items not yet implemented for WYSYWIG -07_01_00__gitlab_official_specification_markdown__task_list_items__004: - skip_update_example_snapshot_html_wysiwyg: Inapplicable task list items not yet implemented for WYSYWIG - skip_update_example_snapshot_prosemirror_json: Inapplicable task list items not yet implemented for WYSYWIG - skip_running_conformance_wysiwyg_tests: Inapplicable task list items not yet implemented for WYSYWIG - skip_running_snapshot_wysiwyg_html_tests: Inapplicable task list items not yet implemented for WYSYWIG - skip_running_snapshot_prosemirror_json_tests: Inapplicable task list items not yet implemented for WYSYWIG -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__001: - skip_update_example_snapshot_html_wysiwyg: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_update_example_snapshot_prosemirror_json: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_running_conformance_wysiwyg_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_running_snapshot_wysiwyg_html_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_running_snapshot_prosemirror_json_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__002: - skip_update_example_snapshot_html_wysiwyg: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_update_example_snapshot_prosemirror_json: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_running_conformance_wysiwyg_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_running_snapshot_wysiwyg_html_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_running_snapshot_prosemirror_json_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__003: - skip_update_example_snapshot_html_wysiwyg: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_update_example_snapshot_prosemirror_json: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_running_conformance_wysiwyg_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_running_snapshot_wysiwyg_html_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_running_snapshot_prosemirror_json_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__004: - skip_update_example_snapshot_html_wysiwyg: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_update_example_snapshot_prosemirror_json: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_running_conformance_wysiwyg_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_running_snapshot_wysiwyg_html_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_running_snapshot_prosemirror_json_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__005: - skip_update_example_snapshot_html_wysiwyg: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_update_example_snapshot_prosemirror_json: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_running_conformance_wysiwyg_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_running_snapshot_wysiwyg_html_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_running_snapshot_prosemirror_json_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__006: - skip_update_example_snapshot_html_wysiwyg: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_update_example_snapshot_prosemirror_json: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_running_conformance_wysiwyg_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_running_snapshot_wysiwyg_html_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 - skip_running_snapshot_prosemirror_json_tests: Not yet implemented. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92507#note_1068159236 -08_04_06__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_link_for_project_wiki__001: - skip_update_example_snapshot_html_wysiwyg: The current frontend example doesn't include the path, need to look into why not - skip_update_example_snapshot_prosemirror_json: The current frontend example doesn't include the path, need to look into why not - skip_running_conformance_wysiwyg_tests: The current frontend example doesn't include the path, need to look into why not - skip_running_snapshot_wysiwyg_html_tests: The current frontend example doesn't include the path, need to look into why not - skip_running_snapshot_prosemirror_json_tests: The current frontend example doesn't include the path, need to look into why not -08_04_44__gitlab_internal_extension_markdown__migrated_golden_master_examples__ordered_task_list__001: - skip_update_example_snapshot_html_wysiwyg: Example currently fails. See https://gitlab.com/gitlab-org/gitlab/-/issues/383866 - skip_update_example_snapshot_prosemirror_json: Example currently fails. See https://gitlab.com/gitlab-org/gitlab/-/issues/383866 - skip_running_conformance_wysiwyg_tests: Example currently fails. See https://gitlab.com/gitlab-org/gitlab/-/issues/383866 - skip_running_snapshot_wysiwyg_html_tests: Example currently fails. See https://gitlab.com/gitlab-org/gitlab/-/issues/383866 - skip_running_snapshot_prosemirror_json_tests: Example currently fails. See https://gitlab.com/gitlab-org/gitlab/-/issues/383866 -08_04_50__gitlab_internal_extension_markdown__migrated_golden_master_examples__task_list__001: - skip_update_example_snapshot_html_wysiwyg: Example currently fails. See https://gitlab.com/gitlab-org/gitlab/-/issues/383866 - skip_update_example_snapshot_prosemirror_json: Example currently fails. See https://gitlab.com/gitlab-org/gitlab/-/issues/383866 - skip_running_conformance_wysiwyg_tests: Example currently fails. See https://gitlab.com/gitlab-org/gitlab/-/issues/383866 - skip_running_snapshot_wysiwyg_html_tests: Example currently fails. See https://gitlab.com/gitlab-org/gitlab/-/issues/383866 - skip_running_snapshot_prosemirror_json_tests: Example currently fails. See https://gitlab.com/gitlab-org/gitlab/-/issues/383866 -08_05_00__gitlab_internal_extension_markdown__image_attributes__001: - skip_update_example_snapshot_html_wysiwyg: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 - skip_update_example_snapshot_prosemirror_json: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 - skip_running_conformance_wysiwyg_tests: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 - skip_running_snapshot_wysiwyg_html_tests: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 - skip_running_snapshot_prosemirror_json_tests: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 -08_05_00__gitlab_internal_extension_markdown__image_attributes__002: - skip_update_example_snapshot_html_wysiwyg: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 - skip_update_example_snapshot_prosemirror_json: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 - skip_running_conformance_wysiwyg_tests: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 - skip_running_snapshot_wysiwyg_html_tests: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 - skip_running_snapshot_prosemirror_json_tests: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 -08_05_00__gitlab_internal_extension_markdown__image_attributes__003: - skip_update_example_snapshot_html_wysiwyg: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 - skip_update_example_snapshot_prosemirror_json: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 - skip_running_conformance_wysiwyg_tests: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 - skip_running_snapshot_wysiwyg_html_tests: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 - skip_running_snapshot_prosemirror_json_tests: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 -08_05_00__gitlab_internal_extension_markdown__image_attributes__004: - skip_update_example_snapshot_html_wysiwyg: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 - skip_update_example_snapshot_prosemirror_json: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 - skip_running_conformance_wysiwyg_tests: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 - skip_running_snapshot_wysiwyg_html_tests: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 - skip_running_snapshot_prosemirror_json_tests: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 -08_05_00__gitlab_internal_extension_markdown__image_attributes__005: - skip_update_example_snapshot_html_wysiwyg: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 - skip_update_example_snapshot_prosemirror_json: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 - skip_running_conformance_wysiwyg_tests: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 - skip_running_snapshot_wysiwyg_html_tests: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 - skip_running_snapshot_prosemirror_json_tests: WYSYWIG and prosemirror examples not generated correctly. See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106733#note_1206201340 diff --git a/glfm_specification/input/gitlab_flavored_markdown/glfm_internal_extensions.md b/glfm_specification/input/gitlab_flavored_markdown/glfm_internal_extensions.md deleted file mode 100644 index e7453d8c556d00808ed14a7f315906328189595e..0000000000000000000000000000000000000000 --- a/glfm_specification/input/gitlab_flavored_markdown/glfm_internal_extensions.md +++ /dev/null @@ -1,1008 +0,0 @@ -<!-- BEGIN TESTS --> -# GitLab Internal Extension Markdown - -## Audio - -See -[audio](https://docs.gitlab.com/ee/user/markdown.html#audio) in the GitLab Flavored Markdown documentation. - -GLFM renders image elements as an audio player as long as the resource’s file extension is -one of the following supported audio extensions `.mp3`, `.oga`, `.ogg`, `.spx`, and `.wav`. -Audio ignore the alternative text part of an image declaration. - -```````````````````````````````` example gitlab - -. -<p><audio src="audio.oga" title="audio title"></audio></p> -```````````````````````````````` - -Reference definitions work audio as well: - -```````````````````````````````` example gitlab -[audio]: audio.oga "audio title" - -![audio][audio] -. -<p><audio src="audio.oga" title="audio title"></audio></p> -```````````````````````````````` - -## Video - -See -[videos](https://docs.gitlab.com/ee/user/markdown.html#videos) in the GitLab Flavored Markdown documentation. - -GLFM renders image elements as a video player as long as the resource’s file extension is -one of the following supported video extensions `.mp4`, `.m4v`, `.mov`, `.webm`, and `.ogv`. -Videos ignore the alternative text part of an image declaration. - - -```````````````````````````````` example gitlab - -. -<p><video src="video.m4v" title="video title"></video></p> -```````````````````````````````` - -Reference definitions work video as well: - -```````````````````````````````` example gitlab -[video]: video.mov "video title" - -![video][video] -. -<p><video src="video.mov" title="video title"></video></p> -```````````````````````````````` - -## Markdown Preview API Request Overrides - -This section contains examples of all controllers which use `PreviewMarkdown` module -and use different `markdown_context_params`. They exercise the various `preview_markdown` -endpoints via `glfm_example_metadata.yml`. - - -`preview_markdown` exercising `groups` API endpoint and `UploadLinkFilter`: - -```````````````````````````````` example gitlab -[groups-test-file](/uploads/groups-test-file) -. -<p><a href="groups-test-file">groups-test-file</a></p> -```````````````````````````````` - -`preview_markdown` exercising `projects` API endpoint and `RepositoryLinkFilter`: - -```````````````````````````````` example gitlab -[projects-test-file](projects-test-file) -. -<p><a href="projects-test-file">projects-test-file</a></p> -```````````````````````````````` - -`preview_markdown` exercising `projects` API endpoint and `SnippetReferenceFilter`: - -```````````````````````````````` example gitlab -This project snippet ID reference IS filtered: $88888 -. -<p>This project snippet ID reference IS filtered: $88888</p> -```````````````````````````````` - -`preview_markdown` exercising personal (non-project) `snippets` 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 -`SnippetReferenceFilter`, even if the ID is valid. - -```````````````````````````````` example gitlab -This personal snippet ID reference is not filtered: $99999 -. -<p>This personal snippet ID reference is not filtered: $99999</p> -```````````````````````````````` - -`preview_markdown` exercising project `wikis` API endpoint and `WikiLinkFilter`: - -```````````````````````````````` example gitlab -[project-wikis-test-file](project-wikis-test-file) -. -<p><a href="project-wikis-test-file">project-wikis-test-file</a></p> -```````````````````````````````` - -`preview_markdown` exercising group `wikis` API endpoint and `WikiLinkFilter`. This example -also requires an EE license enabling the `group_wikis` feature: - -```````````````````````````````` example gitlab -[group-wikis-test-file](group-wikis-test-file) -. -<p><a href="group-wikis-test-file">group-wikis-test-file</a></p> -```````````````````````````````` - -## Migrated golden master examples - -### attachment_image_for_group - -```````````````````````````````` example gitlab - -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### attachment_image_for_project - -```````````````````````````````` example gitlab - -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### attachment_image_for_project_wiki - -```````````````````````````````` example gitlab - -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### attachment_link_for_group - -```````````````````````````````` example gitlab -[test-file](/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.zip) -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### attachment_link_for_project - -```````````````````````````````` example gitlab -[test-file](/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.zip) -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### attachment_link_for_project_wiki - -```````````````````````````````` example gitlab -[test-file](test-file.zip) -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### attachment_link_for_group_wiki - -```````````````````````````````` example gitlab -[test-file](test-file.zip) -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### audio - -```````````````````````````````` example gitlab - -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### audio_and_video_in_lists - -```````````````````````````````` example gitlab -*  -*  - -1.  -2.  - -* [x]  -* [x]  -* [x]  -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### blockquote - -```````````````````````````````` example gitlab -> This is a blockquote -> -> This is another one -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### bold - -```````````````````````````````` example gitlab -**bold** -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### bullet_list_style_1 - -```````````````````````````````` example gitlab -* list item 1 -* list item 2 - * embedded list item 3 -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### bullet_list_style_2 - -```````````````````````````````` example gitlab -- list item 1 -- list item 2 - * embedded list item 3 -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### bullet_list_style_3 - -```````````````````````````````` example gitlab -+ list item 1 -+ list item 2 - - embedded list item 3 -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### code_block_javascript - -```````````````````````````````` example gitlab -```javascript - console.log('hello world') -``` -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### code_block_plaintext - -```````````````````````````````` example gitlab -``` - plaintext -``` -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### code_block_unknown - -```````````````````````````````` example gitlab -```foobar - custom_language = >> this << -``` -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### color_chips - -```````````````````````````````` example gitlab -- `#F00` -- `#F00A` -- `#FF0000` -- `#FF0000AA` -- `RGB(0,255,0)` -- `RGB(0%,100%,0%)` -- `RGBA(0,255,0,0.3)` -- `HSL(540,70%,50%)` -- `HSLA(540,70%,50%,0.3)` -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### description_list - -```````````````````````````````` example gitlab -<dl> -<dt>Frog</dt> -<dd>Wet green thing</dd> -<dt>Rabbit</dt> -<dd>Warm fluffy thing</dd> -<dt>Punt</dt> -<dd>Kick a ball</dd> -<dd>Take a bet</dd> -<dt>Color</dt> -<dt>Colour</dt> -<dd> - -Any hue except _white_ or **black** - -</dd> -</dl> -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### details - -```````````````````````````````` example gitlab -<details> -<summary>This is the visible summary of the collapsible section</summary> - -1. collapsed markdown -2. more collapsed markdown - -</details> -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### diagram_kroki_nomnoml - -```````````````````````````````` example gitlab -```nomnoml - #stroke: #a86128 - [<frame>Decorator pattern| - [<abstract>Component||+ operation()] - [Client] depends --> [Component] - [Decorator|- next: Component] - [Decorator] decorates -- [ConcreteComponent] - [Component] <:- [Decorator] - [Component] <:- [ConcreteComponent] - ] -``` -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### diagram_plantuml - -```````````````````````````````` example gitlab -```plantuml - Alice -> Bob: Authentication Request - Bob --> Alice: Authentication Response - - Alice -> Bob: Another authentication Request - Alice <-- Bob: Another authentication Response -``` -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### diagram_plantuml_unicode - -```````````````````````````````` example gitlab -```plantuml -A -> B : Text with norwegian characters: æøå -``` -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### div - -```````````````````````````````` example gitlab -<div>plain text</div> -<div> - -just a plain ol' div, not much to _expect_! - -</div> -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### emoji - -```````````````````````````````` example gitlab -:sparkles: :heart: :100: -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### emphasis - -```````````````````````````````` example gitlab -_emphasized text_ -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### figure - -```````````````````````````````` example gitlab -<figure> - - - -<figcaption>An elephant at sunset</figcaption> -</figure> -<figure> - - - -<figcaption> - -A crocodile wearing _crocs_! - -</figcaption> -</figure> -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### footnotes - -```````````````````````````````` example gitlab -A footnote reference tag looks like this: [^1] - -This reference tag is a mix of letters and numbers. [^footnote] - -[^1]: This is the text inside a footnote. - -[^footnote]: This is another footnote. -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### frontmatter_json - -```````````````````````````````` example gitlab -;;; -{ - "title": "Page title" -} -;;; -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### frontmatter_toml - -```````````````````````````````` example gitlab -+++ -title = "Page title" -+++ -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### frontmatter_yaml - -```````````````````````````````` example gitlab ---- -title: Page title ---- -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### hard_break - -```````````````````````````````` example gitlab -This is a line after a\ -hard break -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### headings - -```````````````````````````````` example gitlab -# Heading 1 - -## Heading 2 - -### Heading 3 - -#### Heading 4 - -##### Heading 5 - -###### Heading 6 -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### horizontal_rule - -```````````````````````````````` example gitlab ---- -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### html_marks - -```````````````````````````````` example gitlab -* Content editor is ~~great~~<ins>amazing</ins>. -* If the changes <abbr title="Looks good to merge">LGTM</abbr>, please <abbr title="Merge when pipeline succeeds">MWPS</abbr>. -* The English song <q>Oh I do like to be beside the seaside</q> looks like this in Hebrew: <span dir="rtl">××”, ×× ×™ ×והב להיות ליד חוף ×”×™×</span>. In the computer's memory, this is stored as <bdo dir="ltr">××”, ×× ×™ ×והב להיות ליד חוף ×”×™×</bdo>. -* <cite>The Scream</cite> by Edvard Munch. Painted in 1893. -* <dfn>HTML</dfn> is the standard markup language for creating web pages. -* Do not forget to buy <mark>milk</mark> today. -* This is a paragraph and <small>smaller text goes here</small>. -* The concert starts at <time datetime="20:00">20:00</time> and you'll be able to enjoy the band for at least <time datetime="PT2H30M">2h 30m</time>. -* Press <kbd>Ctrl</kbd> + <kbd>C</kbd> to copy text (Windows). -* WWF's goal is to: <q>Build a future where people live in harmony with nature.</q> We hope they succeed. -* The error occurred was: <samp>Keyboard not found. Press F1 to continue.</samp> -* The area of a triangle is: 1/2 x <var>b</var> x <var>h</var>, where <var>b</var> is the base, and <var>h</var> is the vertical height. -* <ruby>æ¼¢<rt>ã„ㄢˋ</rt></ruby> -* C<sub>7</sub>H<sub>16</sub> + O<sub>2</sub> → CO<sub>2</sub> + H<sub>2</sub>O -* The **Pythagorean theorem** is often expressed as <var>a<sup>2</sup></var> + <var>b<sup>2</sup></var> = <var>c<sup>2</sup></var> -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### image - -```````````````````````````````` example gitlab - -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### inline_code - -```````````````````````````````` example gitlab -`code` -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### inline_diff - -```````````````````````````````` example gitlab -* {-deleted-} -* {+added+} -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### label - -```````````````````````````````` example gitlab -~bug -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### link - -```````````````````````````````` example gitlab -[GitLab](https://gitlab.com) -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### math - -```````````````````````````````` example gitlab -This math is inline $`a^2+b^2=c^2`$. - -This is on a separate line: - -```math -a^2+b^2=c^2 -``` -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### ordered_list - -```````````````````````````````` example gitlab -1. list item 1 -2. list item 2 -3. list item 3 -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### ordered_list_with_start_order - -```````````````````````````````` example gitlab -134. list item 1 -135. list item 2 -136. list item 3 -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### ordered_task_list - -```````````````````````````````` example gitlab -1. [x] hello -2. [x] world -3. [ ] example - 1. [ ] of nested - 1. [x] task list - 2. [ ] items -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### ordered_task_list_with_order - -```````````````````````````````` example gitlab -4893. [x] hello -4894. [x] world -4895. [ ] example -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### reference_for_project_wiki - -```````````````````````````````` example gitlab -Hi @gfm_user - thank you for reporting this ~"UX bug" (#1) we hope to fix it in %1.1 as part of !1 -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### strike - -```````````````````````````````` example gitlab -~~del~~ -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### table - -```````````````````````````````` example gitlab -| header | header | -|--------|--------| -| `code` | cell with **bold** | -| ~~strike~~ | cell with _italic_ | - -# content after table -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### table_of_contents - -```````````````````````````````` example gitlab -[[_TOC_]] - -# Lorem - -Well, that's just like... your opinion.. man. - -## Ipsum - -### Dolar - -# Sit amit - -### I don't know -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### task_list - -```````````````````````````````` example gitlab -* [x] hello -* [x] world -* [ ] example - * [ ] of nested - * [x] task list - * [ ] items -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### video - -```````````````````````````````` example gitlab - -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### word_break - -```````````````````````````````` example gitlab -Fernstraßen<wbr>bau<wbr>privat<wbr>finanzierungs<wbr>gesetz -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -## Image Attributes - -See -[Change the image dimensions](https://docs.gitlab.com/ee/user/markdown.html#change-the-image-dimensions) -in the GitLab Flavored Markdown documentation. - -The `width` and `height` attributes for an image can be specified directly after -the image markdown. - -General syntax conforms to the -[commonmark-hs attribute syntax](https://github.com/jgm/commonmark-hs/blob/master/commonmark-extensions/test/attributes.md) -where it makes sense. - -```````````````````````````````` example gitlab -{width="100" height="100"} -. -<p><img src="https://gitlab.com/logo.png" width="100" height="100"></p> -```````````````````````````````` - -`%` and `px` units may also be specified. - -```````````````````````````````` example gitlab -{width="100%"} -. -<p><img src="https://gitlab.com/logo.png" width="100%"></p> -```````````````````````````````` - -```````````````````````````````` example gitlab -{height="100px"} -. -<p><img src="https://gitlab.com/logo.png" height="100px"></p> -```````````````````````````````` - -Whitespace is tolerated around the delimiters: - -```````````````````````````````` example gitlab -{ width="100" height="100" } -. -<p><img src="https://gitlab.com/logo.png" width="100" height="100"></p> -```````````````````````````````` - -Attributes must immediately follow the image markdown. - -```````````````````````````````` example gitlab - {width="100" height="100"} -. -<p><img src="https://gitlab.com/logo.png"> {width="100" height="100"}</p> -```````````````````````````````` - -## Footnotes - -See -[the footnotes section of the user-facing documentation for GitLab Flavored Markdown](https://docs.gitlab.com/ee/user/markdown.html#footnotes). - -```````````````````````````````` example gitlab -footnote reference tag [^fortytwo] - -[^fortytwo]: footnote text -. -<p> -footnote reference tag -<sup> -<a href="#fn-fortytwo-42" id="fnref-fortytwo-42" data-footnote-ref> -1 -</a> -</sup> -</p> -<section data-footnotes> -<ol> -<li id="fn-fortytwo-42"> -<p> -footnote text -<a href="#fnref-fortytwo-42" data-footnote-backref> -</a> -</p> -</li> -</ol> -</section> -```````````````````````````````` - -# GFM undocumented extensions and more robust test - -This section contains tests borrowed from https://github.com/github/cmark-gfm/blob/master/test/extensions.txt. -It includes items not found in the official GFM specification, such as footnotes and additional tests for tables, -task lists, etc. - -## Footnotes - -```````````````````````````````` example -This is some text![^1]. Other text.[^footnote]. - -Here's a thing[^other-note]. - -And another thing[^codeblock-note]. - -This doesn't have a referent[^nope]. - - -[^other-note]: no code block here (spaces are stripped away) - -[^codeblock-note]: - this is now a code block (8 spaces indentation) - -[^1]: Some *bolded* footnote definition. - -Hi! - -[^footnote]: - > Blockquotes can be in a footnote. - - as well as code blocks - - or, naturally, simple paragraphs. - -[^unused]: This is unused. -. -<p>This is some text!<sup class="footnote-ref"><a href="#fn-1" id="fnref-1" data-footnote-ref>1</a></sup>. Other text.<sup class="footnote-ref"><a href="#fn-footnote" id="fnref-footnote" data-footnote-ref>2</a></sup>.</p> -<p>Here's a thing<sup class="footnote-ref"><a href="#fn-other-note" id="fnref-other-note" data-footnote-ref>3</a></sup>.</p> -<p>And another thing<sup class="footnote-ref"><a href="#fn-codeblock-note" id="fnref-codeblock-note" data-footnote-ref>4</a></sup>.</p> -<p>This doesn't have a referent[^nope].</p> -<p>Hi!</p> -<section class="footnotes" data-footnotes> -<ol> -<li id="fn-1"> -<p>Some <em>bolded</em> footnote definition. <a href="#fnref-1" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1">↩</a></p> -</li> -<li id="fn-footnote"> -<blockquote> -<p>Blockquotes can be in a footnote.</p> -</blockquote> -<pre><code>as well as code blocks -</code></pre> -<p>or, naturally, simple paragraphs. <a href="#fnref-footnote" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="2" aria-label="Back to reference 2">↩</a></p> -</li> -<li id="fn-other-note"> -<p>no code block here (spaces are stripped away) <a href="#fnref-other-note" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="3" aria-label="Back to reference 3">↩</a></p> -</li> -<li id="fn-codeblock-note"> -<pre><code>this is now a code block (8 spaces indentation) -</code></pre> -<a href="#fnref-codeblock-note" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="4" aria-label="Back to reference 4">↩</a> -</li> -</ol> -</section> -```````````````````````````````` - -## When a footnote is used multiple times, we insert multiple backrefs. - -```````````````````````````````` example -This is some text. It has a footnote[^a-footnote]. - -This footnote is referenced[^a-footnote] multiple times, in lots of different places.[^a-footnote] - -[^a-footnote]: This footnote definition should have three backrefs. -. -<p>This is some text. It has a footnote<sup class="footnote-ref"><a href="#fn-a-footnote" id="fnref-a-footnote" data-footnote-ref>1</a></sup>.</p> -<p>This footnote is referenced<sup class="footnote-ref"><a href="#fn-a-footnote" id="fnref-a-footnote-2" data-footnote-ref>1</a></sup> multiple times, in lots of different places.<sup class="footnote-ref"><a href="#fn-a-footnote" id="fnref-a-footnote-3" data-footnote-ref>1</a></sup></p> -<section class="footnotes" data-footnotes> -<ol> -<li id="fn-a-footnote"> -<p>This footnote definition should have three backrefs. <a href="#fnref-a-footnote" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1">↩</a> <a href="#fnref-a-footnote-2" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1-2" aria-label="Back to reference 1-2">↩<sup class="footnote-ref">2</sup></a> <a href="#fnref-a-footnote-3" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1-3" aria-label="Back to reference 1-3">↩<sup class="footnote-ref">3</sup></a></p> -</li> -</ol> -</section> -```````````````````````````````` - -## Footnote reference labels are href escaped - -```````````````````````````````` example -Hello[^"><script>alert(1)</script>] - -[^"><script>alert(1)</script>]: pwned -. -<p>Hello<sup class="footnote-ref"><a href="#fn-%22%3E%3Cscript%3Ealert(1)%3C/script%3E" id="fnref-%22%3E%3Cscript%3Ealert(1)%3C/script%3E" data-footnote-ref>1</a></sup></p> -<section class="footnotes" data-footnotes> -<ol> -<li id="fn-%22%3E%3Cscript%3Ealert(1)%3C/script%3E"> -<p>pwned <a href="#fnref-%22%3E%3Cscript%3Ealert(1)%3C/script%3E" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1">↩</a></p> -</li> -</ol> -</section> -```````````````````````````````` - -## Interop - -Autolink and strikethrough. - -```````````````````````````````` example -~~www.google.com~~ - -~~http://google.com~~ -. -<p><del><a href="http://www.google.com">www.google.com</a></del></p> -<p><del><a href="http://google.com">http://google.com</a></del></p> -```````````````````````````````` - -Autolink and tables. - -```````````````````````````````` example -| a | b | -| --- | --- | -| https://github.com www.github.com | http://pokemon.com | -. -<table> -<thead> -<tr> -<th>a</th> -<th>b</th> -</tr> -</thead> -<tbody> -<tr> -<td><a href="https://github.com">https://github.com</a> <a href="http://www.github.com">www.github.com</a></td> -<td><a href="http://pokemon.com">http://pokemon.com</a></td> -</tr> -</tbody> -</table> -```````````````````````````````` - -## Task lists - -```````````````````````````````` example -- [ ] foo -- [x] bar -. -<ul> -<li><input type="checkbox" disabled="" /> foo</li> -<li><input type="checkbox" checked="" disabled="" /> bar</li> -</ul> -```````````````````````````````` - -Show that a task list and a regular list get processed the same in -the way that sublists are created. If something works in a list -item, then it should work the same way with a task. The only -difference should be the tasklist marker. So, if we use something -other than a space or x, it won't be recognized as a task item, and -so will be treated as a regular item. - -```````````````````````````````` example -- [x] foo - - [ ] bar - - [x] baz -- [ ] bim - -Show a regular (non task) list to show that it has the same structure -- [@] foo - - [@] bar - - [@] baz -- [@] bim -. -<ul> -<li><input type="checkbox" checked="" disabled="" /> foo -<ul> -<li><input type="checkbox" disabled="" /> bar</li> -<li><input type="checkbox" checked="" disabled="" /> baz</li> -</ul> -</li> -<li><input type="checkbox" disabled="" /> bim</li> -</ul> -<p>Show a regular (non task) list to show that it has the same structure</p> -<ul> -<li>[@] foo -<ul> -<li>[@] bar</li> -<li>[@] baz</li> -</ul> -</li> -<li>[@] bim</li> -</ul> -```````````````````````````````` -Use a larger indent -- a task list and a regular list should produce -the same structure. - -```````````````````````````````` example -- [x] foo - - [ ] bar - - [x] baz -- [ ] bim - -Show a regular (non task) list to show that it has the same structure -- [@] foo - - [@] bar - - [@] baz -- [@] bim -. -<ul> -<li><input type="checkbox" checked="" disabled="" /> foo -<ul> -<li><input type="checkbox" disabled="" /> bar</li> -<li><input type="checkbox" checked="" disabled="" /> baz</li> -</ul> -</li> -<li><input type="checkbox" disabled="" /> bim</li> -</ul> -<p>Show a regular (non task) list to show that it has the same structure</p> -<ul> -<li>[@] foo -<ul> -<li>[@] bar</li> -<li>[@] baz</li> -</ul> -</li> -<li>[@] bim</li> -</ul> -```````````````````````````````` - -<!-- end of the "GFM undocumented extensions and more robust test" section --> - -<!-- END TESTS --> diff --git a/glfm_specification/input/gitlab_flavored_markdown/glfm_official_specification.md b/glfm_specification/input/gitlab_flavored_markdown/glfm_official_specification.md deleted file mode 100644 index 03abace19a45278e0c8e264f5ef388a1dedfc3f3..0000000000000000000000000000000000000000 --- a/glfm_specification/input/gitlab_flavored_markdown/glfm_official_specification.md +++ /dev/null @@ -1,276 +0,0 @@ ---- -title: GitLab Flavored Markdown (GLFM) Spec -version: alpha -... - -# Introduction - -GitLab Flavored Markdown (GLFM) extends the [CommonMark specification](https://spec.commonmark.org/current/) and is considered a strict superset of CommonMark. It also incorporates the extensions defined by the [GitHub Flavored Markdown specification](https://github.github.com/gfm/). - -This specification will define the various official extensions that comprise GLFM. These extensions are GitLab independent - they do not require a GitLab server for parsing or interaction. The intent is to provide a specification that can be implemented in standard markdown editors. This includes many of the features listed in [user-facing documentation for GitLab Flavored Markdown](https://docs.gitlab.com/ee/user/markdown.html). - -The CommonMark and GitHub specifications will not be duplicated here. - -NOTE: The example numbering in this document does not start at "1", because this official specification -only contains a subset of all the examples which are supported by GitLab Flavored Markdown. See -[`snapshot_spec.html`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/glfm_specification/output_example_snapshots/snapshot_spec.html) -for a complete list of all examples, which are a superset of examples from: - -- CommonMark -- GitHub Flavored Markdown -- GitLab Flavored Markdown Official Specification (the same ones from this specifiation) -- GitLab Flavored Markdown Internal Extensions. - -<!-- BEGIN TESTS --> -# GitLab Official Specification Markdown - -Note: This specification is a work in progress. Only some of the official GLFM extensions -are defined. We will continue to add any additional ones found in the -[user-facing documentation for GitLab Flavored Markdown](https://docs.gitlab.com/ee/user/markdown.html). - -There is currently only this single top-level heading, but the -examples may be split into multiple top-level headings in the future. - -## Task list items - -See -[Task lists](https://docs.gitlab.com/ee/user/markdown.html#task-lists) in the GitLab Flavored Markdown documentation. - -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. - -Some of the behavior of task list items is implemented as client-side JavaScript/CSS. - -The following are some basic examples; more examples may be added in the future. - -Incomplete task: - -```````````````````````````````` example gitlab -- [ ] incomplete -. -<ul> -<li> -<task-button/> -<input type="checkbox" disabled/> -incomplete -</li> -</ul> -```````````````````````````````` - -Completed task: - -```````````````````````````````` example gitlab -- [x] completed -. -<ul> -<li> -<task-button/> -<input type="checkbox" checked disabled/> -completed -</li> -</ul> -```````````````````````````````` - -Inapplicable task: - -```````````````````````````````` example gitlab -- [~] inapplicable -. -<ul> -<li> -<task-button/> -<input type="checkbox" data-inapplicable disabled> -<s> -inapplicable -</s> -</li> -</ul> -```````````````````````````````` - -Inapplicable task in a "loose" list. Note that the `<del>` tag is not applied to the -loose text; it has strikethrough applied with CSS. - -```````````````````````````````` example gitlab -- [~] inapplicable - - text in loose list -. -<ul> -<li> -<p> -<task-button/> -<input type="checkbox" data-inapplicable disabled> -<s> -inapplicable -</s> -</p> -<p> -text in loose list -</p> -</li> -</ul> -```````````````````````````````` - -## Front matter - -See -[Front matter](https://docs.gitlab.com/ee/user/markdown.html#front-matter) in the GitLab Flavored Markdown documentation. - -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. - -YAML front matter: - -```````````````````````````````` example gitlab ---- -title: YAML front matter ---- -. -<pre> -<code> -title: YAML front matter -</code> -</pre> -```````````````````````````````` - -TOML front matter: - -```````````````````````````````` example gitlab -+++ -title: TOML front matter -+++ -. -<pre> -<code> -title: TOML front matter -</code> -</pre> -```````````````````````````````` - -JSON front matter: - -```````````````````````````````` example gitlab -;;; -{ - "title": "JSON front matter" -} -;;; -. -<pre> -<code> -{ - "title": "JSON front matter" -} -</code> -</pre> -```````````````````````````````` - -Front matter blocks should be inserted at the top of the document: - -```````````````````````````````` example gitlab -text - ---- -title: YAML front matter ---- -. -<p>text</p> -<hr> -<h2>title: YAML front matter</h2> -```````````````````````````````` - -Front matter block delimiters shouldn’t be preceded by space characters: - -```````````````````````````````` example gitlab - --- -title: YAML front matter ---- -. -<hr> -<h2>title: YAML front matter</h2> -```````````````````````````````` - -## Table of contents - -See -[table of contents](https://docs.gitlab.com/ee/user/markdown.html#table-of-contents) -in the GitLab Flavored Markdown documentation. - -NOTE: Because of this bug (https://gitlab.com/gitlab-org/gitlab/-/issues/359077), -we cannot actually include the `TOC` tag with single brackets in backticks -in this Markdown document, otherwise it would render a table of contents inline -right here. So, it's been switched to `[` + `TOC` + `]` instead. This can be reverted -once that bug is fixed. - -A table of contents is an unordered list that links to subheadings in the document. -Add either the `[[_TOC_]]` tag or the `[` + `TOC` + `]` tag on its own line. - -```````````````````````````````` example gitlab -[TOC] - -# Heading 1 - -## Heading 2 -. -<nav> - <ul> - <li><a href="#heading-1">Heading 1</a></li> - <ul> - <li><a href="#heading-2">Heading 2</a></li> - </ul> - </ul> -</nav> -<h1>Heading 1</h1> -<h2>Heading 2</h2> -```````````````````````````````` - -```````````````````````````````` example gitlab -[[_TOC_]] - -# Heading 1 - -## Heading 2 -. -<nav> - <ul> - <li><a href="#heading-1">Heading 1</a></li> - <ul> - <li><a href="#heading-2">Heading 2</a></li> - </ul> - </ul> -</nav> -<h1>Heading 1</h1> -<h2>Heading 2</h2> -```````````````````````````````` - -A table of contents is a block element. It should preceded and followed by a blank -line. - -```````````````````````````````` example gitlab -[[_TOC_]] -text - -text -[TOC] -. -<p>[[<em>TOC</em>]]text</p> -<p>text[TOC]</p> -```````````````````````````````` - -A table of contents can be indented with up to three spaces. - -```````````````````````````````` example gitlab - [[_TOC_]] - -# Heading 1 -. -<nav> - <ul> - <li><a href="#heading-1">Heading 1</a></li> - </ul> -</nav> -<h1>Heading 1</h1> -```````````````````````````````` -<!-- END TESTS --> diff --git a/glfm_specification/output_example_snapshots/examples_index.yml b/glfm_specification/output_example_snapshots/examples_index.yml deleted file mode 100644 index f55ad43eb4881f8713bfc27b4b1492501cde8829..0000000000000000000000000000000000000000 --- a/glfm_specification/output_example_snapshots/examples_index.yml +++ /dev/null @@ -1,2281 +0,0 @@ ---- -02_01_00__preliminaries__tabs__001: - spec_example_position: 1 - source_specification: commonmark -02_01_00__preliminaries__tabs__002: - spec_example_position: 2 - source_specification: commonmark -02_01_00__preliminaries__tabs__003: - spec_example_position: 3 - source_specification: commonmark -02_01_00__preliminaries__tabs__004: - spec_example_position: 4 - source_specification: commonmark -02_01_00__preliminaries__tabs__005: - spec_example_position: 5 - source_specification: commonmark -02_01_00__preliminaries__tabs__006: - spec_example_position: 6 - source_specification: commonmark -02_01_00__preliminaries__tabs__007: - spec_example_position: 7 - source_specification: commonmark -02_01_00__preliminaries__tabs__008: - spec_example_position: 8 - source_specification: commonmark -02_01_00__preliminaries__tabs__009: - spec_example_position: 9 - source_specification: commonmark -02_01_00__preliminaries__tabs__010: - spec_example_position: 10 - source_specification: commonmark -02_01_00__preliminaries__tabs__011: - spec_example_position: 11 - source_specification: commonmark -03_01_00__blocks_and_inlines__precedence__001: - spec_example_position: 12 - source_specification: commonmark -04_01_00__leaf_blocks__thematic_breaks__001: - spec_example_position: 13 - source_specification: commonmark -04_01_00__leaf_blocks__thematic_breaks__002: - spec_example_position: 14 - source_specification: commonmark -04_01_00__leaf_blocks__thematic_breaks__003: - spec_example_position: 15 - source_specification: commonmark -04_01_00__leaf_blocks__thematic_breaks__004: - spec_example_position: 16 - source_specification: commonmark -04_01_00__leaf_blocks__thematic_breaks__005: - spec_example_position: 17 - source_specification: commonmark -04_01_00__leaf_blocks__thematic_breaks__006: - spec_example_position: 18 - source_specification: commonmark -04_01_00__leaf_blocks__thematic_breaks__007: - spec_example_position: 19 - source_specification: commonmark -04_01_00__leaf_blocks__thematic_breaks__008: - spec_example_position: 20 - source_specification: commonmark -04_01_00__leaf_blocks__thematic_breaks__009: - spec_example_position: 21 - source_specification: commonmark -04_01_00__leaf_blocks__thematic_breaks__010: - spec_example_position: 22 - source_specification: commonmark -04_01_00__leaf_blocks__thematic_breaks__011: - spec_example_position: 23 - source_specification: commonmark -04_01_00__leaf_blocks__thematic_breaks__012: - spec_example_position: 24 - source_specification: commonmark -04_01_00__leaf_blocks__thematic_breaks__013: - spec_example_position: 25 - source_specification: commonmark -04_01_00__leaf_blocks__thematic_breaks__014: - spec_example_position: 26 - source_specification: commonmark -04_01_00__leaf_blocks__thematic_breaks__015: - spec_example_position: 27 - source_specification: commonmark -04_01_00__leaf_blocks__thematic_breaks__016: - spec_example_position: 28 - source_specification: commonmark -04_01_00__leaf_blocks__thematic_breaks__017: - spec_example_position: 29 - source_specification: commonmark -04_01_00__leaf_blocks__thematic_breaks__018: - spec_example_position: 30 - source_specification: commonmark -04_01_00__leaf_blocks__thematic_breaks__019: - spec_example_position: 31 - source_specification: commonmark -04_02_00__leaf_blocks__atx_headings__001: - spec_example_position: 32 - source_specification: commonmark -04_02_00__leaf_blocks__atx_headings__002: - spec_example_position: 33 - source_specification: commonmark -04_02_00__leaf_blocks__atx_headings__003: - spec_example_position: 34 - source_specification: commonmark -04_02_00__leaf_blocks__atx_headings__004: - spec_example_position: 35 - source_specification: commonmark -04_02_00__leaf_blocks__atx_headings__005: - spec_example_position: 36 - source_specification: commonmark -04_02_00__leaf_blocks__atx_headings__006: - spec_example_position: 37 - source_specification: commonmark -04_02_00__leaf_blocks__atx_headings__007: - spec_example_position: 38 - source_specification: commonmark -04_02_00__leaf_blocks__atx_headings__008: - spec_example_position: 39 - source_specification: commonmark -04_02_00__leaf_blocks__atx_headings__009: - spec_example_position: 40 - source_specification: commonmark -04_02_00__leaf_blocks__atx_headings__010: - spec_example_position: 41 - source_specification: commonmark -04_02_00__leaf_blocks__atx_headings__011: - spec_example_position: 42 - source_specification: commonmark -04_02_00__leaf_blocks__atx_headings__012: - spec_example_position: 43 - source_specification: commonmark -04_02_00__leaf_blocks__atx_headings__013: - spec_example_position: 44 - source_specification: commonmark -04_02_00__leaf_blocks__atx_headings__014: - spec_example_position: 45 - source_specification: commonmark -04_02_00__leaf_blocks__atx_headings__015: - spec_example_position: 46 - source_specification: commonmark -04_02_00__leaf_blocks__atx_headings__016: - spec_example_position: 47 - source_specification: commonmark -04_02_00__leaf_blocks__atx_headings__017: - spec_example_position: 48 - source_specification: commonmark -04_02_00__leaf_blocks__atx_headings__018: - spec_example_position: 49 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__001: - spec_example_position: 50 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__002: - spec_example_position: 51 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__003: - spec_example_position: 52 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__004: - spec_example_position: 53 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__005: - spec_example_position: 54 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__006: - spec_example_position: 55 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__007: - spec_example_position: 56 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__008: - spec_example_position: 57 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__009: - spec_example_position: 58 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__010: - spec_example_position: 59 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__011: - spec_example_position: 60 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__012: - spec_example_position: 61 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__013: - spec_example_position: 62 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__014: - spec_example_position: 63 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__015: - spec_example_position: 64 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__016: - spec_example_position: 65 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__017: - spec_example_position: 66 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__018: - spec_example_position: 67 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__019: - spec_example_position: 68 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__020: - spec_example_position: 69 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__021: - spec_example_position: 70 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__022: - spec_example_position: 71 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__023: - spec_example_position: 72 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__024: - spec_example_position: 73 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__025: - spec_example_position: 74 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__026: - spec_example_position: 75 - source_specification: commonmark -04_03_00__leaf_blocks__setext_headings__027: - spec_example_position: 76 - source_specification: commonmark -04_04_00__leaf_blocks__indented_code_blocks__001: - spec_example_position: 77 - source_specification: commonmark -04_04_00__leaf_blocks__indented_code_blocks__002: - spec_example_position: 78 - source_specification: commonmark -04_04_00__leaf_blocks__indented_code_blocks__003: - spec_example_position: 79 - source_specification: commonmark -04_04_00__leaf_blocks__indented_code_blocks__004: - spec_example_position: 80 - source_specification: commonmark -04_04_00__leaf_blocks__indented_code_blocks__005: - spec_example_position: 81 - source_specification: commonmark -04_04_00__leaf_blocks__indented_code_blocks__006: - spec_example_position: 82 - source_specification: commonmark -04_04_00__leaf_blocks__indented_code_blocks__007: - spec_example_position: 83 - source_specification: commonmark -04_04_00__leaf_blocks__indented_code_blocks__008: - spec_example_position: 84 - source_specification: commonmark -04_04_00__leaf_blocks__indented_code_blocks__009: - spec_example_position: 85 - source_specification: commonmark -04_04_00__leaf_blocks__indented_code_blocks__010: - spec_example_position: 86 - source_specification: commonmark -04_04_00__leaf_blocks__indented_code_blocks__011: - spec_example_position: 87 - source_specification: commonmark -04_04_00__leaf_blocks__indented_code_blocks__012: - spec_example_position: 88 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__001: - spec_example_position: 89 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__002: - spec_example_position: 90 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__003: - spec_example_position: 91 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__004: - spec_example_position: 92 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__005: - spec_example_position: 93 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__006: - spec_example_position: 94 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__007: - spec_example_position: 95 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__008: - spec_example_position: 96 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__009: - spec_example_position: 97 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__010: - spec_example_position: 98 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__011: - spec_example_position: 99 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__012: - spec_example_position: 100 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__013: - spec_example_position: 101 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__014: - spec_example_position: 102 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__015: - spec_example_position: 103 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__016: - spec_example_position: 104 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__017: - spec_example_position: 105 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__018: - spec_example_position: 106 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__019: - spec_example_position: 107 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__020: - spec_example_position: 108 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__021: - spec_example_position: 109 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__022: - spec_example_position: 110 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__023: - spec_example_position: 111 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__024: - spec_example_position: 112 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__025: - spec_example_position: 113 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__026: - spec_example_position: 114 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__027: - spec_example_position: 115 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__028: - spec_example_position: 116 - source_specification: commonmark -04_05_00__leaf_blocks__fenced_code_blocks__029: - spec_example_position: 117 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__001: - spec_example_position: 118 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__002: - spec_example_position: 119 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__003: - spec_example_position: 120 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__004: - spec_example_position: 121 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__005: - spec_example_position: 122 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__006: - spec_example_position: 123 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__007: - spec_example_position: 124 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__008: - spec_example_position: 125 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__009: - spec_example_position: 126 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__010: - spec_example_position: 127 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__011: - spec_example_position: 128 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__012: - spec_example_position: 129 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__013: - spec_example_position: 130 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__014: - spec_example_position: 131 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__015: - spec_example_position: 132 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__016: - spec_example_position: 133 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__017: - spec_example_position: 134 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__018: - spec_example_position: 135 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__019: - spec_example_position: 136 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__020: - spec_example_position: 137 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__021: - spec_example_position: 138 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__022: - spec_example_position: 139 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__023: - spec_example_position: 140 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__024: - spec_example_position: 141 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__025: - spec_example_position: 142 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__026: - spec_example_position: 143 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__027: - spec_example_position: 144 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__028: - spec_example_position: 145 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__029: - spec_example_position: 146 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__030: - spec_example_position: 147 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__031: - spec_example_position: 148 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__032: - spec_example_position: 149 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__033: - spec_example_position: 150 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__034: - spec_example_position: 151 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__035: - spec_example_position: 152 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__036: - spec_example_position: 153 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__037: - spec_example_position: 154 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__038: - spec_example_position: 155 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__039: - spec_example_position: 156 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__040: - spec_example_position: 157 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__041: - spec_example_position: 158 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__042: - spec_example_position: 159 - source_specification: commonmark -04_06_00__leaf_blocks__html_blocks__043: - spec_example_position: 160 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__001: - spec_example_position: 161 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__002: - spec_example_position: 162 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__003: - spec_example_position: 163 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__004: - spec_example_position: 164 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__005: - spec_example_position: 165 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__006: - spec_example_position: 166 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__007: - spec_example_position: 167 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__008: - spec_example_position: 168 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__009: - spec_example_position: 169 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__010: - spec_example_position: 170 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__011: - spec_example_position: 171 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__012: - spec_example_position: 172 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__013: - spec_example_position: 173 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__014: - spec_example_position: 174 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__015: - spec_example_position: 175 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__016: - spec_example_position: 176 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__017: - spec_example_position: 177 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__018: - spec_example_position: 178 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__019: - spec_example_position: 179 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__020: - spec_example_position: 180 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__021: - spec_example_position: 181 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__022: - spec_example_position: 182 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__023: - spec_example_position: 183 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__024: - spec_example_position: 184 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__025: - spec_example_position: 185 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__026: - spec_example_position: 186 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__027: - spec_example_position: 187 - source_specification: commonmark -04_07_00__leaf_blocks__link_reference_definitions__028: - spec_example_position: 188 - source_specification: commonmark -04_08_00__leaf_blocks__paragraphs__001: - spec_example_position: 189 - source_specification: commonmark -04_08_00__leaf_blocks__paragraphs__002: - spec_example_position: 190 - source_specification: commonmark -04_08_00__leaf_blocks__paragraphs__003: - spec_example_position: 191 - source_specification: commonmark -04_08_00__leaf_blocks__paragraphs__004: - spec_example_position: 192 - source_specification: commonmark -04_08_00__leaf_blocks__paragraphs__005: - spec_example_position: 193 - source_specification: commonmark -04_08_00__leaf_blocks__paragraphs__006: - spec_example_position: 194 - source_specification: commonmark -04_08_00__leaf_blocks__paragraphs__007: - spec_example_position: 195 - source_specification: commonmark -04_08_00__leaf_blocks__paragraphs__008: - spec_example_position: 196 - source_specification: commonmark -04_09_00__leaf_blocks__blank_lines__001: - spec_example_position: 197 - source_specification: commonmark -04_10_00__leaf_blocks__tables_extension__001: - spec_example_position: 198 - source_specification: github -04_10_00__leaf_blocks__tables_extension__002: - spec_example_position: 199 - source_specification: github -04_10_00__leaf_blocks__tables_extension__003: - spec_example_position: 200 - source_specification: github -04_10_00__leaf_blocks__tables_extension__004: - spec_example_position: 201 - source_specification: github -04_10_00__leaf_blocks__tables_extension__005: - spec_example_position: 202 - source_specification: github -04_10_00__leaf_blocks__tables_extension__006: - spec_example_position: 203 - source_specification: github -04_10_00__leaf_blocks__tables_extension__007: - spec_example_position: 204 - source_specification: github -04_10_00__leaf_blocks__tables_extension__008: - spec_example_position: 205 - source_specification: github -05_01_00__container_blocks__block_quotes__001: - spec_example_position: 206 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__002: - spec_example_position: 207 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__003: - spec_example_position: 208 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__004: - spec_example_position: 209 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__005: - spec_example_position: 210 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__006: - spec_example_position: 211 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__007: - spec_example_position: 212 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__008: - spec_example_position: 213 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__009: - spec_example_position: 214 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__010: - spec_example_position: 215 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__011: - spec_example_position: 216 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__012: - spec_example_position: 217 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__013: - spec_example_position: 218 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__014: - spec_example_position: 219 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__015: - spec_example_position: 220 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__016: - spec_example_position: 221 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__017: - spec_example_position: 222 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__018: - spec_example_position: 223 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__019: - spec_example_position: 224 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__020: - spec_example_position: 225 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__021: - spec_example_position: 226 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__022: - spec_example_position: 227 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__023: - spec_example_position: 228 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__024: - spec_example_position: 229 - source_specification: commonmark -05_01_00__container_blocks__block_quotes__025: - spec_example_position: 230 - source_specification: commonmark -05_02_00__container_blocks__list_items__001: - spec_example_position: 231 - source_specification: commonmark -05_02_00__container_blocks__list_items__002: - spec_example_position: 232 - source_specification: commonmark -05_02_00__container_blocks__list_items__003: - spec_example_position: 233 - source_specification: commonmark -05_02_00__container_blocks__list_items__004: - spec_example_position: 234 - source_specification: commonmark -05_02_00__container_blocks__list_items__005: - spec_example_position: 235 - source_specification: commonmark -05_02_00__container_blocks__list_items__006: - spec_example_position: 236 - source_specification: commonmark -05_02_00__container_blocks__list_items__007: - spec_example_position: 237 - source_specification: commonmark -05_02_00__container_blocks__list_items__008: - spec_example_position: 238 - source_specification: commonmark -05_02_00__container_blocks__list_items__009: - spec_example_position: 239 - source_specification: commonmark -05_02_00__container_blocks__list_items__010: - spec_example_position: 240 - source_specification: commonmark -05_02_00__container_blocks__list_items__011: - spec_example_position: 241 - source_specification: commonmark -05_02_00__container_blocks__list_items__012: - spec_example_position: 242 - source_specification: commonmark -05_02_00__container_blocks__list_items__013: - spec_example_position: 243 - source_specification: commonmark -05_02_00__container_blocks__list_items__014: - spec_example_position: 244 - source_specification: commonmark -05_02_00__container_blocks__list_items__015: - spec_example_position: 245 - source_specification: commonmark -05_02_00__container_blocks__list_items__016: - spec_example_position: 246 - source_specification: commonmark -05_02_00__container_blocks__list_items__017: - spec_example_position: 247 - source_specification: commonmark -05_02_00__container_blocks__list_items__018: - spec_example_position: 248 - source_specification: commonmark -05_02_00__container_blocks__list_items__019: - spec_example_position: 249 - source_specification: commonmark -05_02_00__container_blocks__list_items__020: - spec_example_position: 250 - source_specification: commonmark -05_02_00__container_blocks__list_items__021: - spec_example_position: 251 - source_specification: commonmark -05_02_00__container_blocks__list_items__022: - spec_example_position: 252 - source_specification: commonmark -05_02_00__container_blocks__list_items__023: - spec_example_position: 253 - source_specification: commonmark -05_02_00__container_blocks__list_items__024: - spec_example_position: 254 - source_specification: commonmark -05_02_00__container_blocks__list_items__025: - spec_example_position: 255 - source_specification: commonmark -05_02_00__container_blocks__list_items__026: - spec_example_position: 256 - source_specification: commonmark -05_02_00__container_blocks__list_items__027: - spec_example_position: 257 - source_specification: commonmark -05_02_00__container_blocks__list_items__028: - spec_example_position: 258 - source_specification: commonmark -05_02_00__container_blocks__list_items__029: - spec_example_position: 259 - source_specification: commonmark -05_02_00__container_blocks__list_items__030: - spec_example_position: 260 - source_specification: commonmark -05_02_00__container_blocks__list_items__031: - spec_example_position: 261 - source_specification: commonmark -05_02_00__container_blocks__list_items__032: - spec_example_position: 262 - source_specification: commonmark -05_02_00__container_blocks__list_items__033: - spec_example_position: 263 - source_specification: commonmark -05_02_00__container_blocks__list_items__034: - spec_example_position: 264 - source_specification: commonmark -05_02_00__container_blocks__list_items__035: - spec_example_position: 265 - source_specification: commonmark -05_02_00__container_blocks__list_items__036: - spec_example_position: 266 - source_specification: commonmark -05_02_00__container_blocks__list_items__037: - spec_example_position: 267 - source_specification: commonmark -05_02_00__container_blocks__list_items__038: - spec_example_position: 268 - source_specification: commonmark -05_02_00__container_blocks__list_items__039: - spec_example_position: 269 - source_specification: commonmark -05_02_00__container_blocks__list_items__040: - spec_example_position: 270 - source_specification: commonmark -05_02_00__container_blocks__list_items__041: - spec_example_position: 271 - source_specification: commonmark -05_02_00__container_blocks__list_items__042: - spec_example_position: 272 - source_specification: commonmark -05_02_00__container_blocks__list_items__043: - spec_example_position: 273 - source_specification: commonmark -05_02_00__container_blocks__list_items__044: - spec_example_position: 274 - source_specification: commonmark -05_02_00__container_blocks__list_items__045: - spec_example_position: 275 - source_specification: commonmark -05_02_00__container_blocks__list_items__046: - spec_example_position: 276 - source_specification: commonmark -05_02_00__container_blocks__list_items__047: - spec_example_position: 277 - source_specification: commonmark -05_02_00__container_blocks__list_items__048: - spec_example_position: 278 - source_specification: commonmark -05_04_00__container_blocks__lists__001: - spec_example_position: 281 - source_specification: commonmark -05_04_00__container_blocks__lists__002: - spec_example_position: 282 - source_specification: commonmark -05_04_00__container_blocks__lists__003: - spec_example_position: 283 - source_specification: commonmark -05_04_00__container_blocks__lists__004: - spec_example_position: 284 - source_specification: commonmark -05_04_00__container_blocks__lists__005: - spec_example_position: 285 - source_specification: commonmark -05_04_00__container_blocks__lists__006: - spec_example_position: 286 - source_specification: commonmark -05_04_00__container_blocks__lists__007: - spec_example_position: 287 - source_specification: commonmark -05_04_00__container_blocks__lists__008: - spec_example_position: 288 - source_specification: commonmark -05_04_00__container_blocks__lists__009: - spec_example_position: 289 - source_specification: commonmark -05_04_00__container_blocks__lists__010: - spec_example_position: 290 - source_specification: commonmark -05_04_00__container_blocks__lists__011: - spec_example_position: 291 - source_specification: commonmark -05_04_00__container_blocks__lists__012: - spec_example_position: 292 - source_specification: commonmark -05_04_00__container_blocks__lists__013: - spec_example_position: 293 - source_specification: commonmark -05_04_00__container_blocks__lists__014: - spec_example_position: 294 - source_specification: commonmark -05_04_00__container_blocks__lists__015: - spec_example_position: 295 - source_specification: commonmark -05_04_00__container_blocks__lists__016: - spec_example_position: 296 - source_specification: commonmark -05_04_00__container_blocks__lists__017: - spec_example_position: 297 - source_specification: commonmark -05_04_00__container_blocks__lists__018: - spec_example_position: 298 - source_specification: commonmark -05_04_00__container_blocks__lists__019: - spec_example_position: 299 - source_specification: commonmark -05_04_00__container_blocks__lists__020: - spec_example_position: 300 - source_specification: commonmark -05_04_00__container_blocks__lists__021: - spec_example_position: 301 - source_specification: commonmark -05_04_00__container_blocks__lists__022: - spec_example_position: 302 - source_specification: commonmark -05_04_00__container_blocks__lists__023: - spec_example_position: 303 - source_specification: commonmark -05_04_00__container_blocks__lists__024: - spec_example_position: 304 - source_specification: commonmark -05_04_00__container_blocks__lists__025: - spec_example_position: 305 - source_specification: commonmark -05_04_00__container_blocks__lists__026: - spec_example_position: 306 - source_specification: commonmark -06_01_00__inlines__001: - spec_example_position: 307 - source_specification: commonmark -06_02_00__inlines__backslash_escapes__001: - spec_example_position: 308 - source_specification: commonmark -06_02_00__inlines__backslash_escapes__002: - spec_example_position: 309 - source_specification: commonmark -06_02_00__inlines__backslash_escapes__003: - spec_example_position: 310 - source_specification: commonmark -06_02_00__inlines__backslash_escapes__004: - spec_example_position: 311 - source_specification: commonmark -06_02_00__inlines__backslash_escapes__005: - spec_example_position: 312 - source_specification: commonmark -06_02_00__inlines__backslash_escapes__006: - spec_example_position: 313 - source_specification: commonmark -06_02_00__inlines__backslash_escapes__007: - spec_example_position: 314 - source_specification: commonmark -06_02_00__inlines__backslash_escapes__008: - spec_example_position: 315 - source_specification: commonmark -06_02_00__inlines__backslash_escapes__009: - spec_example_position: 316 - source_specification: commonmark -06_02_00__inlines__backslash_escapes__010: - spec_example_position: 317 - source_specification: commonmark -06_02_00__inlines__backslash_escapes__011: - spec_example_position: 318 - source_specification: commonmark -06_02_00__inlines__backslash_escapes__012: - spec_example_position: 319 - source_specification: commonmark -06_02_00__inlines__backslash_escapes__013: - spec_example_position: 320 - source_specification: commonmark -06_03_00__inlines__entity_and_numeric_character_references__001: - spec_example_position: 321 - source_specification: commonmark -06_03_00__inlines__entity_and_numeric_character_references__002: - spec_example_position: 322 - source_specification: commonmark -06_03_00__inlines__entity_and_numeric_character_references__003: - spec_example_position: 323 - source_specification: commonmark -06_03_00__inlines__entity_and_numeric_character_references__004: - spec_example_position: 324 - source_specification: commonmark -06_03_00__inlines__entity_and_numeric_character_references__005: - spec_example_position: 325 - source_specification: commonmark -06_03_00__inlines__entity_and_numeric_character_references__006: - spec_example_position: 326 - source_specification: commonmark -06_03_00__inlines__entity_and_numeric_character_references__007: - spec_example_position: 327 - source_specification: commonmark -06_03_00__inlines__entity_and_numeric_character_references__008: - spec_example_position: 328 - source_specification: commonmark -06_03_00__inlines__entity_and_numeric_character_references__009: - spec_example_position: 329 - source_specification: commonmark -06_03_00__inlines__entity_and_numeric_character_references__010: - spec_example_position: 330 - source_specification: commonmark -06_03_00__inlines__entity_and_numeric_character_references__011: - spec_example_position: 331 - source_specification: commonmark -06_03_00__inlines__entity_and_numeric_character_references__012: - spec_example_position: 332 - source_specification: commonmark -06_03_00__inlines__entity_and_numeric_character_references__013: - spec_example_position: 333 - source_specification: commonmark -06_03_00__inlines__entity_and_numeric_character_references__014: - spec_example_position: 334 - source_specification: commonmark -06_03_00__inlines__entity_and_numeric_character_references__015: - spec_example_position: 335 - source_specification: commonmark -06_03_00__inlines__entity_and_numeric_character_references__016: - spec_example_position: 336 - source_specification: commonmark -06_03_00__inlines__entity_and_numeric_character_references__017: - spec_example_position: 337 - source_specification: commonmark -06_04_00__inlines__code_spans__001: - spec_example_position: 338 - source_specification: commonmark -06_04_00__inlines__code_spans__002: - spec_example_position: 339 - source_specification: commonmark -06_04_00__inlines__code_spans__003: - spec_example_position: 340 - source_specification: commonmark -06_04_00__inlines__code_spans__004: - spec_example_position: 341 - source_specification: commonmark -06_04_00__inlines__code_spans__005: - spec_example_position: 342 - source_specification: commonmark -06_04_00__inlines__code_spans__006: - spec_example_position: 343 - source_specification: commonmark -06_04_00__inlines__code_spans__007: - spec_example_position: 344 - source_specification: commonmark -06_04_00__inlines__code_spans__008: - spec_example_position: 345 - source_specification: commonmark -06_04_00__inlines__code_spans__009: - spec_example_position: 346 - source_specification: commonmark -06_04_00__inlines__code_spans__010: - spec_example_position: 347 - source_specification: commonmark -06_04_00__inlines__code_spans__011: - spec_example_position: 348 - source_specification: commonmark -06_04_00__inlines__code_spans__012: - spec_example_position: 349 - source_specification: commonmark -06_04_00__inlines__code_spans__013: - spec_example_position: 350 - source_specification: commonmark -06_04_00__inlines__code_spans__014: - spec_example_position: 351 - source_specification: commonmark -06_04_00__inlines__code_spans__015: - spec_example_position: 352 - source_specification: commonmark -06_04_00__inlines__code_spans__016: - spec_example_position: 353 - source_specification: commonmark -06_04_00__inlines__code_spans__017: - spec_example_position: 354 - source_specification: commonmark -06_04_00__inlines__code_spans__018: - spec_example_position: 355 - source_specification: commonmark -06_04_00__inlines__code_spans__019: - spec_example_position: 356 - source_specification: commonmark -06_04_00__inlines__code_spans__020: - spec_example_position: 357 - source_specification: commonmark -06_04_00__inlines__code_spans__021: - spec_example_position: 358 - source_specification: commonmark -06_04_00__inlines__code_spans__022: - spec_example_position: 359 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__001: - spec_example_position: 360 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__002: - spec_example_position: 361 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__003: - spec_example_position: 362 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__004: - spec_example_position: 363 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__005: - spec_example_position: 364 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__006: - spec_example_position: 365 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__007: - spec_example_position: 366 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__008: - spec_example_position: 367 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__009: - spec_example_position: 368 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__010: - spec_example_position: 369 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__011: - spec_example_position: 370 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__012: - spec_example_position: 371 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__013: - spec_example_position: 372 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__014: - spec_example_position: 373 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__015: - spec_example_position: 374 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__016: - spec_example_position: 375 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__017: - spec_example_position: 376 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__018: - spec_example_position: 377 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__019: - spec_example_position: 378 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__020: - spec_example_position: 379 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__021: - spec_example_position: 380 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__022: - spec_example_position: 381 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__023: - spec_example_position: 382 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__024: - spec_example_position: 383 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__025: - spec_example_position: 384 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__026: - spec_example_position: 385 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__027: - spec_example_position: 386 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__028: - spec_example_position: 387 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__029: - spec_example_position: 388 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__030: - spec_example_position: 389 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__031: - spec_example_position: 390 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__032: - spec_example_position: 391 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__033: - spec_example_position: 392 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__034: - spec_example_position: 393 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__035: - spec_example_position: 394 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__036: - spec_example_position: 395 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__037: - spec_example_position: 396 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__038: - spec_example_position: 397 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__039: - spec_example_position: 398 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__040: - spec_example_position: 399 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__041: - spec_example_position: 400 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__042: - spec_example_position: 401 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__043: - spec_example_position: 402 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__044: - spec_example_position: 403 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__045: - spec_example_position: 404 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__046: - spec_example_position: 405 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__047: - spec_example_position: 406 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__048: - spec_example_position: 407 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__049: - spec_example_position: 408 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__050: - spec_example_position: 409 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__051: - spec_example_position: 410 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__052: - spec_example_position: 411 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__053: - spec_example_position: 412 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__054: - spec_example_position: 413 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__055: - spec_example_position: 414 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__056: - spec_example_position: 415 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__057: - spec_example_position: 416 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__058: - spec_example_position: 417 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__059: - spec_example_position: 418 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__060: - spec_example_position: 419 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__061: - spec_example_position: 420 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__062: - spec_example_position: 421 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__063: - spec_example_position: 422 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__064: - spec_example_position: 423 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__065: - spec_example_position: 424 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__066: - spec_example_position: 425 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__067: - spec_example_position: 426 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__068: - spec_example_position: 427 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__069: - spec_example_position: 428 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__070: - spec_example_position: 429 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__071: - spec_example_position: 430 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__072: - spec_example_position: 431 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__073: - spec_example_position: 432 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__074: - spec_example_position: 433 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__075: - spec_example_position: 434 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__076: - spec_example_position: 435 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__077: - spec_example_position: 436 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__078: - spec_example_position: 437 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__079: - spec_example_position: 438 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__080: - spec_example_position: 439 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__081: - spec_example_position: 440 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__082: - spec_example_position: 441 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__083: - spec_example_position: 442 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__084: - spec_example_position: 443 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__085: - spec_example_position: 444 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__086: - spec_example_position: 445 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__087: - spec_example_position: 446 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__088: - spec_example_position: 447 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__089: - spec_example_position: 448 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__090: - spec_example_position: 449 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__091: - spec_example_position: 450 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__092: - spec_example_position: 451 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__093: - spec_example_position: 452 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__094: - spec_example_position: 453 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__095: - spec_example_position: 454 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__096: - spec_example_position: 455 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__097: - spec_example_position: 456 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__098: - spec_example_position: 457 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__099: - spec_example_position: 458 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__100: - spec_example_position: 459 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__101: - spec_example_position: 460 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__102: - spec_example_position: 461 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__103: - spec_example_position: 462 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__104: - spec_example_position: 463 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__105: - spec_example_position: 464 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__106: - spec_example_position: 465 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__107: - spec_example_position: 466 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__108: - spec_example_position: 467 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__109: - spec_example_position: 468 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__110: - spec_example_position: 469 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__111: - spec_example_position: 470 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__112: - spec_example_position: 471 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__113: - spec_example_position: 472 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__114: - spec_example_position: 473 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__115: - spec_example_position: 474 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__116: - spec_example_position: 475 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__117: - spec_example_position: 476 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__118: - spec_example_position: 477 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__119: - spec_example_position: 478 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__120: - spec_example_position: 479 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__121: - spec_example_position: 480 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__122: - spec_example_position: 481 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__123: - spec_example_position: 482 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__124: - spec_example_position: 483 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__125: - spec_example_position: 484 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__126: - spec_example_position: 485 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__127: - spec_example_position: 486 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__128: - spec_example_position: 487 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__129: - spec_example_position: 488 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__130: - spec_example_position: 489 - source_specification: commonmark -06_05_00__inlines__emphasis_and_strong_emphasis__131: - spec_example_position: 490 - source_specification: commonmark -06_06_00__inlines__strikethrough_extension__001: - spec_example_position: 491 - source_specification: github -06_06_00__inlines__strikethrough_extension__002: - spec_example_position: 492 - source_specification: github -06_07_00__inlines__links__001: - spec_example_position: 493 - source_specification: commonmark -06_07_00__inlines__links__002: - spec_example_position: 494 - source_specification: commonmark -06_07_00__inlines__links__003: - spec_example_position: 495 - source_specification: commonmark -06_07_00__inlines__links__004: - spec_example_position: 496 - source_specification: commonmark -06_07_00__inlines__links__005: - spec_example_position: 497 - source_specification: commonmark -06_07_00__inlines__links__006: - spec_example_position: 498 - source_specification: commonmark -06_07_00__inlines__links__007: - spec_example_position: 499 - source_specification: commonmark -06_07_00__inlines__links__008: - spec_example_position: 500 - source_specification: commonmark -06_07_00__inlines__links__009: - spec_example_position: 501 - source_specification: commonmark -06_07_00__inlines__links__010: - spec_example_position: 502 - source_specification: commonmark -06_07_00__inlines__links__011: - spec_example_position: 503 - source_specification: commonmark -06_07_00__inlines__links__012: - spec_example_position: 504 - source_specification: commonmark -06_07_00__inlines__links__013: - spec_example_position: 505 - source_specification: commonmark -06_07_00__inlines__links__014: - spec_example_position: 506 - source_specification: commonmark -06_07_00__inlines__links__015: - spec_example_position: 507 - source_specification: commonmark -06_07_00__inlines__links__016: - spec_example_position: 508 - source_specification: commonmark -06_07_00__inlines__links__017: - spec_example_position: 509 - source_specification: commonmark -06_07_00__inlines__links__018: - spec_example_position: 510 - source_specification: commonmark -06_07_00__inlines__links__019: - spec_example_position: 511 - source_specification: commonmark -06_07_00__inlines__links__020: - spec_example_position: 512 - source_specification: commonmark -06_07_00__inlines__links__021: - spec_example_position: 513 - source_specification: commonmark -06_07_00__inlines__links__022: - spec_example_position: 514 - source_specification: commonmark -06_07_00__inlines__links__023: - spec_example_position: 515 - source_specification: commonmark -06_07_00__inlines__links__024: - spec_example_position: 516 - source_specification: commonmark -06_07_00__inlines__links__025: - spec_example_position: 517 - source_specification: commonmark -06_07_00__inlines__links__026: - spec_example_position: 518 - source_specification: commonmark -06_07_00__inlines__links__027: - spec_example_position: 519 - source_specification: commonmark -06_07_00__inlines__links__028: - spec_example_position: 520 - source_specification: commonmark -06_07_00__inlines__links__029: - spec_example_position: 521 - source_specification: commonmark -06_07_00__inlines__links__030: - spec_example_position: 522 - source_specification: commonmark -06_07_00__inlines__links__031: - spec_example_position: 523 - source_specification: commonmark -06_07_00__inlines__links__032: - spec_example_position: 524 - source_specification: commonmark -06_07_00__inlines__links__033: - spec_example_position: 525 - source_specification: commonmark -06_07_00__inlines__links__034: - spec_example_position: 526 - source_specification: commonmark -06_07_00__inlines__links__035: - spec_example_position: 527 - source_specification: commonmark -06_07_00__inlines__links__036: - spec_example_position: 528 - source_specification: commonmark -06_07_00__inlines__links__037: - spec_example_position: 529 - source_specification: commonmark -06_07_00__inlines__links__038: - spec_example_position: 530 - source_specification: commonmark -06_07_00__inlines__links__039: - spec_example_position: 531 - source_specification: commonmark -06_07_00__inlines__links__040: - spec_example_position: 532 - source_specification: commonmark -06_07_00__inlines__links__041: - spec_example_position: 533 - source_specification: commonmark -06_07_00__inlines__links__042: - spec_example_position: 534 - source_specification: commonmark -06_07_00__inlines__links__043: - spec_example_position: 535 - source_specification: commonmark -06_07_00__inlines__links__044: - spec_example_position: 536 - source_specification: commonmark -06_07_00__inlines__links__045: - spec_example_position: 537 - source_specification: commonmark -06_07_00__inlines__links__046: - spec_example_position: 538 - source_specification: commonmark -06_07_00__inlines__links__047: - spec_example_position: 539 - source_specification: commonmark -06_07_00__inlines__links__048: - spec_example_position: 540 - source_specification: commonmark -06_07_00__inlines__links__049: - spec_example_position: 541 - source_specification: commonmark -06_07_00__inlines__links__050: - spec_example_position: 542 - source_specification: commonmark -06_07_00__inlines__links__051: - spec_example_position: 543 - source_specification: commonmark -06_07_00__inlines__links__052: - spec_example_position: 544 - source_specification: commonmark -06_07_00__inlines__links__053: - spec_example_position: 545 - source_specification: commonmark -06_07_00__inlines__links__054: - spec_example_position: 546 - source_specification: commonmark -06_07_00__inlines__links__055: - spec_example_position: 547 - source_specification: commonmark -06_07_00__inlines__links__056: - spec_example_position: 548 - source_specification: commonmark -06_07_00__inlines__links__057: - spec_example_position: 549 - source_specification: commonmark -06_07_00__inlines__links__058: - spec_example_position: 550 - source_specification: commonmark -06_07_00__inlines__links__059: - spec_example_position: 551 - source_specification: commonmark -06_07_00__inlines__links__060: - spec_example_position: 552 - source_specification: commonmark -06_07_00__inlines__links__061: - spec_example_position: 553 - source_specification: commonmark -06_07_00__inlines__links__062: - spec_example_position: 554 - source_specification: commonmark -06_07_00__inlines__links__063: - spec_example_position: 555 - source_specification: commonmark -06_07_00__inlines__links__064: - spec_example_position: 556 - source_specification: commonmark -06_07_00__inlines__links__065: - spec_example_position: 557 - source_specification: commonmark -06_07_00__inlines__links__066: - spec_example_position: 558 - source_specification: commonmark -06_07_00__inlines__links__067: - spec_example_position: 559 - source_specification: commonmark -06_07_00__inlines__links__068: - spec_example_position: 560 - source_specification: commonmark -06_07_00__inlines__links__069: - spec_example_position: 561 - source_specification: commonmark -06_07_00__inlines__links__070: - spec_example_position: 562 - source_specification: commonmark -06_07_00__inlines__links__071: - spec_example_position: 563 - source_specification: commonmark -06_07_00__inlines__links__072: - spec_example_position: 564 - source_specification: commonmark -06_07_00__inlines__links__073: - spec_example_position: 565 - source_specification: commonmark -06_07_00__inlines__links__074: - spec_example_position: 566 - source_specification: commonmark -06_07_00__inlines__links__075: - spec_example_position: 567 - source_specification: commonmark -06_07_00__inlines__links__076: - spec_example_position: 568 - source_specification: commonmark -06_07_00__inlines__links__077: - spec_example_position: 569 - source_specification: commonmark -06_07_00__inlines__links__078: - spec_example_position: 570 - source_specification: commonmark -06_07_00__inlines__links__079: - spec_example_position: 571 - source_specification: commonmark -06_07_00__inlines__links__080: - spec_example_position: 572 - source_specification: commonmark -06_07_00__inlines__links__081: - spec_example_position: 573 - source_specification: commonmark -06_07_00__inlines__links__082: - spec_example_position: 574 - source_specification: commonmark -06_07_00__inlines__links__083: - spec_example_position: 575 - source_specification: commonmark -06_07_00__inlines__links__084: - spec_example_position: 576 - source_specification: commonmark -06_07_00__inlines__links__085: - spec_example_position: 577 - source_specification: commonmark -06_07_00__inlines__links__086: - spec_example_position: 578 - source_specification: commonmark -06_07_00__inlines__links__087: - spec_example_position: 579 - source_specification: commonmark -06_08_00__inlines__images__001: - spec_example_position: 580 - source_specification: commonmark -06_08_00__inlines__images__002: - spec_example_position: 581 - source_specification: commonmark -06_08_00__inlines__images__003: - spec_example_position: 582 - source_specification: commonmark -06_08_00__inlines__images__004: - spec_example_position: 583 - source_specification: commonmark -06_08_00__inlines__images__005: - spec_example_position: 584 - source_specification: commonmark -06_08_00__inlines__images__006: - spec_example_position: 585 - source_specification: commonmark -06_08_00__inlines__images__007: - spec_example_position: 586 - source_specification: commonmark -06_08_00__inlines__images__008: - spec_example_position: 587 - source_specification: commonmark -06_08_00__inlines__images__009: - spec_example_position: 588 - source_specification: commonmark -06_08_00__inlines__images__010: - spec_example_position: 589 - source_specification: commonmark -06_08_00__inlines__images__011: - spec_example_position: 590 - source_specification: commonmark -06_08_00__inlines__images__012: - spec_example_position: 591 - source_specification: commonmark -06_08_00__inlines__images__013: - spec_example_position: 592 - source_specification: commonmark -06_08_00__inlines__images__014: - spec_example_position: 593 - source_specification: commonmark -06_08_00__inlines__images__015: - spec_example_position: 594 - source_specification: commonmark -06_08_00__inlines__images__016: - spec_example_position: 595 - source_specification: commonmark -06_08_00__inlines__images__017: - spec_example_position: 596 - source_specification: commonmark -06_08_00__inlines__images__018: - spec_example_position: 597 - source_specification: commonmark -06_08_00__inlines__images__019: - spec_example_position: 598 - source_specification: commonmark -06_08_00__inlines__images__020: - spec_example_position: 599 - source_specification: commonmark -06_08_00__inlines__images__021: - spec_example_position: 600 - source_specification: commonmark -06_08_00__inlines__images__022: - spec_example_position: 601 - source_specification: commonmark -06_09_00__inlines__autolinks__001: - spec_example_position: 602 - source_specification: commonmark -06_09_00__inlines__autolinks__002: - spec_example_position: 603 - source_specification: commonmark -06_09_00__inlines__autolinks__003: - spec_example_position: 604 - source_specification: commonmark -06_09_00__inlines__autolinks__004: - spec_example_position: 605 - source_specification: commonmark -06_09_00__inlines__autolinks__005: - spec_example_position: 606 - source_specification: commonmark -06_09_00__inlines__autolinks__006: - spec_example_position: 607 - source_specification: commonmark -06_09_00__inlines__autolinks__007: - spec_example_position: 608 - source_specification: commonmark -06_09_00__inlines__autolinks__008: - spec_example_position: 609 - source_specification: commonmark -06_09_00__inlines__autolinks__009: - spec_example_position: 610 - source_specification: commonmark -06_09_00__inlines__autolinks__010: - spec_example_position: 611 - source_specification: commonmark -06_09_00__inlines__autolinks__011: - spec_example_position: 612 - source_specification: commonmark -06_09_00__inlines__autolinks__012: - spec_example_position: 613 - source_specification: commonmark -06_09_00__inlines__autolinks__013: - spec_example_position: 614 - source_specification: commonmark -06_09_00__inlines__autolinks__014: - spec_example_position: 615 - source_specification: commonmark -06_09_00__inlines__autolinks__015: - spec_example_position: 616 - source_specification: commonmark -06_09_00__inlines__autolinks__016: - spec_example_position: 617 - source_specification: commonmark -06_09_00__inlines__autolinks__017: - spec_example_position: 618 - source_specification: commonmark -06_09_00__inlines__autolinks__018: - spec_example_position: 619 - source_specification: commonmark -06_09_00__inlines__autolinks__019: - spec_example_position: 620 - source_specification: commonmark -06_10_00__inlines__autolinks_extension__001: - spec_example_position: 621 - source_specification: github -06_10_00__inlines__autolinks_extension__002: - spec_example_position: 622 - source_specification: github -06_10_00__inlines__autolinks_extension__003: - spec_example_position: 623 - source_specification: github -06_10_00__inlines__autolinks_extension__004: - spec_example_position: 624 - source_specification: github -06_10_00__inlines__autolinks_extension__005: - spec_example_position: 625 - source_specification: github -06_10_00__inlines__autolinks_extension__006: - spec_example_position: 626 - source_specification: github -06_10_00__inlines__autolinks_extension__007: - spec_example_position: 627 - source_specification: github -06_10_00__inlines__autolinks_extension__008: - spec_example_position: 628 - source_specification: github -06_10_00__inlines__autolinks_extension__009: - spec_example_position: 629 - source_specification: github -06_10_00__inlines__autolinks_extension__010: - spec_example_position: 630 - source_specification: github -06_10_00__inlines__autolinks_extension__011: - spec_example_position: 631 - source_specification: github -06_11_00__inlines__raw_html__001: - spec_example_position: 632 - source_specification: commonmark -06_11_00__inlines__raw_html__002: - spec_example_position: 633 - source_specification: commonmark -06_11_00__inlines__raw_html__003: - spec_example_position: 634 - source_specification: commonmark -06_11_00__inlines__raw_html__004: - spec_example_position: 635 - source_specification: commonmark -06_11_00__inlines__raw_html__005: - spec_example_position: 636 - source_specification: commonmark -06_11_00__inlines__raw_html__006: - spec_example_position: 637 - source_specification: commonmark -06_11_00__inlines__raw_html__007: - spec_example_position: 638 - source_specification: commonmark -06_11_00__inlines__raw_html__008: - spec_example_position: 639 - source_specification: commonmark -06_11_00__inlines__raw_html__009: - spec_example_position: 640 - source_specification: commonmark -06_11_00__inlines__raw_html__010: - spec_example_position: 641 - source_specification: commonmark -06_11_00__inlines__raw_html__011: - spec_example_position: 642 - source_specification: commonmark -06_11_00__inlines__raw_html__012: - spec_example_position: 643 - source_specification: commonmark -06_11_00__inlines__raw_html__013: - spec_example_position: 644 - source_specification: commonmark -06_11_00__inlines__raw_html__014: - spec_example_position: 645 - source_specification: commonmark -06_11_00__inlines__raw_html__015: - spec_example_position: 646 - source_specification: commonmark -06_11_00__inlines__raw_html__016: - spec_example_position: 647 - source_specification: commonmark -06_11_00__inlines__raw_html__017: - spec_example_position: 648 - source_specification: commonmark -06_11_00__inlines__raw_html__018: - spec_example_position: 649 - source_specification: commonmark -06_11_00__inlines__raw_html__019: - spec_example_position: 650 - source_specification: commonmark -06_11_00__inlines__raw_html__020: - spec_example_position: 651 - source_specification: commonmark -06_11_00__inlines__raw_html__021: - spec_example_position: 652 - source_specification: commonmark -06_12_00__inlines__disallowed_raw_html_extension__001: - spec_example_position: 653 - source_specification: github -06_13_00__inlines__hard_line_breaks__001: - spec_example_position: 654 - source_specification: commonmark -06_13_00__inlines__hard_line_breaks__002: - spec_example_position: 655 - source_specification: commonmark -06_13_00__inlines__hard_line_breaks__003: - spec_example_position: 656 - source_specification: commonmark -06_13_00__inlines__hard_line_breaks__004: - spec_example_position: 657 - source_specification: commonmark -06_13_00__inlines__hard_line_breaks__005: - spec_example_position: 658 - source_specification: commonmark -06_13_00__inlines__hard_line_breaks__006: - spec_example_position: 659 - source_specification: commonmark -06_13_00__inlines__hard_line_breaks__007: - spec_example_position: 660 - source_specification: commonmark -06_13_00__inlines__hard_line_breaks__008: - spec_example_position: 661 - source_specification: commonmark -06_13_00__inlines__hard_line_breaks__009: - spec_example_position: 662 - source_specification: commonmark -06_13_00__inlines__hard_line_breaks__010: - spec_example_position: 663 - source_specification: commonmark -06_13_00__inlines__hard_line_breaks__011: - spec_example_position: 664 - source_specification: commonmark -06_13_00__inlines__hard_line_breaks__012: - spec_example_position: 665 - source_specification: commonmark -06_13_00__inlines__hard_line_breaks__013: - spec_example_position: 666 - source_specification: commonmark -06_13_00__inlines__hard_line_breaks__014: - spec_example_position: 667 - source_specification: commonmark -06_13_00__inlines__hard_line_breaks__015: - spec_example_position: 668 - source_specification: commonmark -06_14_00__inlines__soft_line_breaks__001: - spec_example_position: 669 - source_specification: commonmark -06_14_00__inlines__soft_line_breaks__002: - spec_example_position: 670 - source_specification: commonmark -06_15_00__inlines__textual_content__001: - spec_example_position: 671 - source_specification: commonmark -06_15_00__inlines__textual_content__002: - spec_example_position: 672 - source_specification: commonmark -06_15_00__inlines__textual_content__003: - spec_example_position: 673 - source_specification: commonmark -07_01_00__gitlab_official_specification_markdown__task_list_items__001: - spec_example_position: 674 - source_specification: gitlab -07_01_00__gitlab_official_specification_markdown__task_list_items__002: - spec_example_position: 675 - source_specification: gitlab -07_01_00__gitlab_official_specification_markdown__task_list_items__003: - spec_example_position: 676 - source_specification: gitlab -07_01_00__gitlab_official_specification_markdown__task_list_items__004: - spec_example_position: 677 - source_specification: gitlab -07_02_00__gitlab_official_specification_markdown__front_matter__001: - spec_example_position: 678 - source_specification: gitlab -07_02_00__gitlab_official_specification_markdown__front_matter__002: - spec_example_position: 679 - source_specification: gitlab -07_02_00__gitlab_official_specification_markdown__front_matter__003: - spec_example_position: 680 - source_specification: gitlab -07_02_00__gitlab_official_specification_markdown__front_matter__004: - spec_example_position: 681 - source_specification: gitlab -07_02_00__gitlab_official_specification_markdown__front_matter__005: - spec_example_position: 682 - source_specification: gitlab -07_03_00__gitlab_official_specification_markdown__table_of_contents__001: - spec_example_position: 683 - source_specification: gitlab -07_03_00__gitlab_official_specification_markdown__table_of_contents__002: - spec_example_position: 684 - source_specification: gitlab -07_03_00__gitlab_official_specification_markdown__table_of_contents__003: - spec_example_position: 685 - source_specification: gitlab -07_03_00__gitlab_official_specification_markdown__table_of_contents__004: - spec_example_position: 686 - source_specification: gitlab -08_01_00__gitlab_internal_extension_markdown__audio__001: - spec_example_position: 687 - source_specification: gitlab -08_01_00__gitlab_internal_extension_markdown__audio__002: - spec_example_position: 688 - source_specification: gitlab -08_02_00__gitlab_internal_extension_markdown__video__001: - spec_example_position: 689 - source_specification: gitlab -08_02_00__gitlab_internal_extension_markdown__video__002: - spec_example_position: 690 - source_specification: gitlab -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__001: - spec_example_position: 691 - source_specification: gitlab -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__002: - spec_example_position: 692 - source_specification: gitlab -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__003: - spec_example_position: 693 - source_specification: gitlab -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__004: - spec_example_position: 694 - source_specification: gitlab -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__005: - spec_example_position: 695 - source_specification: gitlab -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__006: - spec_example_position: 696 - source_specification: gitlab -08_04_01__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_image_for_group__001: - spec_example_position: 697 - source_specification: gitlab -08_04_02__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_image_for_project__001: - spec_example_position: 698 - source_specification: gitlab -08_04_03__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_image_for_project_wiki__001: - spec_example_position: 699 - source_specification: gitlab -08_04_04__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_link_for_group__001: - spec_example_position: 700 - source_specification: gitlab -08_04_05__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_link_for_project__001: - spec_example_position: 701 - source_specification: gitlab -08_04_06__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_link_for_project_wiki__001: - spec_example_position: 702 - source_specification: gitlab -08_04_07__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_link_for_group_wiki__001: - spec_example_position: 703 - source_specification: gitlab -08_04_08__gitlab_internal_extension_markdown__migrated_golden_master_examples__audio__001: - spec_example_position: 704 - source_specification: gitlab -08_04_09__gitlab_internal_extension_markdown__migrated_golden_master_examples__audio_and_video_in_lists__001: - spec_example_position: 705 - source_specification: gitlab -08_04_10__gitlab_internal_extension_markdown__migrated_golden_master_examples__blockquote__001: - spec_example_position: 706 - source_specification: gitlab -08_04_11__gitlab_internal_extension_markdown__migrated_golden_master_examples__bold__001: - spec_example_position: 707 - source_specification: gitlab -08_04_12__gitlab_internal_extension_markdown__migrated_golden_master_examples__bullet_list_style_1__001: - spec_example_position: 708 - source_specification: gitlab -08_04_13__gitlab_internal_extension_markdown__migrated_golden_master_examples__bullet_list_style_2__001: - spec_example_position: 709 - source_specification: gitlab -08_04_14__gitlab_internal_extension_markdown__migrated_golden_master_examples__bullet_list_style_3__001: - spec_example_position: 710 - source_specification: gitlab -08_04_15__gitlab_internal_extension_markdown__migrated_golden_master_examples__code_block_javascript__001: - spec_example_position: 711 - source_specification: gitlab -08_04_16__gitlab_internal_extension_markdown__migrated_golden_master_examples__code_block_plaintext__001: - spec_example_position: 712 - source_specification: gitlab -08_04_17__gitlab_internal_extension_markdown__migrated_golden_master_examples__code_block_unknown__001: - spec_example_position: 713 - source_specification: gitlab -08_04_18__gitlab_internal_extension_markdown__migrated_golden_master_examples__color_chips__001: - spec_example_position: 714 - source_specification: gitlab -08_04_19__gitlab_internal_extension_markdown__migrated_golden_master_examples__description_list__001: - spec_example_position: 715 - source_specification: gitlab -08_04_20__gitlab_internal_extension_markdown__migrated_golden_master_examples__details__001: - spec_example_position: 716 - source_specification: gitlab -08_04_21__gitlab_internal_extension_markdown__migrated_golden_master_examples__diagram_kroki_nomnoml__001: - spec_example_position: 717 - source_specification: gitlab -08_04_22__gitlab_internal_extension_markdown__migrated_golden_master_examples__diagram_plantuml__001: - spec_example_position: 718 - source_specification: gitlab -08_04_23__gitlab_internal_extension_markdown__migrated_golden_master_examples__diagram_plantuml_unicode__001: - spec_example_position: 719 - source_specification: gitlab -08_04_24__gitlab_internal_extension_markdown__migrated_golden_master_examples__div__001: - spec_example_position: 720 - source_specification: gitlab -08_04_25__gitlab_internal_extension_markdown__migrated_golden_master_examples__emoji__001: - spec_example_position: 721 - source_specification: gitlab -08_04_26__gitlab_internal_extension_markdown__migrated_golden_master_examples__emphasis__001: - spec_example_position: 722 - source_specification: gitlab -08_04_27__gitlab_internal_extension_markdown__migrated_golden_master_examples__figure__001: - spec_example_position: 723 - source_specification: gitlab -08_04_28__gitlab_internal_extension_markdown__migrated_golden_master_examples__footnotes__001: - spec_example_position: 724 - source_specification: gitlab -08_04_29__gitlab_internal_extension_markdown__migrated_golden_master_examples__frontmatter_json__001: - spec_example_position: 725 - source_specification: gitlab -08_04_30__gitlab_internal_extension_markdown__migrated_golden_master_examples__frontmatter_toml__001: - spec_example_position: 726 - source_specification: gitlab -08_04_31__gitlab_internal_extension_markdown__migrated_golden_master_examples__frontmatter_yaml__001: - spec_example_position: 727 - source_specification: gitlab -08_04_32__gitlab_internal_extension_markdown__migrated_golden_master_examples__hard_break__001: - spec_example_position: 728 - source_specification: gitlab -08_04_33__gitlab_internal_extension_markdown__migrated_golden_master_examples__headings__001: - spec_example_position: 729 - source_specification: gitlab -08_04_34__gitlab_internal_extension_markdown__migrated_golden_master_examples__horizontal_rule__001: - spec_example_position: 730 - source_specification: gitlab -08_04_35__gitlab_internal_extension_markdown__migrated_golden_master_examples__html_marks__001: - spec_example_position: 731 - source_specification: gitlab -08_04_36__gitlab_internal_extension_markdown__migrated_golden_master_examples__image__001: - spec_example_position: 732 - source_specification: gitlab -08_04_37__gitlab_internal_extension_markdown__migrated_golden_master_examples__inline_code__001: - spec_example_position: 733 - source_specification: gitlab -08_04_38__gitlab_internal_extension_markdown__migrated_golden_master_examples__inline_diff__001: - spec_example_position: 734 - source_specification: gitlab -08_04_39__gitlab_internal_extension_markdown__migrated_golden_master_examples__label__001: - spec_example_position: 735 - source_specification: gitlab -08_04_40__gitlab_internal_extension_markdown__migrated_golden_master_examples__link__001: - spec_example_position: 736 - source_specification: gitlab -08_04_41__gitlab_internal_extension_markdown__migrated_golden_master_examples__math__001: - spec_example_position: 737 - source_specification: gitlab -08_04_42__gitlab_internal_extension_markdown__migrated_golden_master_examples__ordered_list__001: - spec_example_position: 738 - source_specification: gitlab -08_04_43__gitlab_internal_extension_markdown__migrated_golden_master_examples__ordered_list_with_start_order__001: - spec_example_position: 739 - source_specification: gitlab -08_04_44__gitlab_internal_extension_markdown__migrated_golden_master_examples__ordered_task_list__001: - spec_example_position: 740 - source_specification: gitlab -08_04_45__gitlab_internal_extension_markdown__migrated_golden_master_examples__ordered_task_list_with_order__001: - spec_example_position: 741 - source_specification: gitlab -08_04_46__gitlab_internal_extension_markdown__migrated_golden_master_examples__reference_for_project_wiki__001: - spec_example_position: 742 - source_specification: gitlab -08_04_47__gitlab_internal_extension_markdown__migrated_golden_master_examples__strike__001: - spec_example_position: 743 - source_specification: gitlab -08_04_48__gitlab_internal_extension_markdown__migrated_golden_master_examples__table__001: - spec_example_position: 744 - source_specification: gitlab -08_04_49__gitlab_internal_extension_markdown__migrated_golden_master_examples__table_of_contents__001: - spec_example_position: 745 - source_specification: gitlab -08_04_50__gitlab_internal_extension_markdown__migrated_golden_master_examples__task_list__001: - spec_example_position: 746 - source_specification: gitlab -08_04_51__gitlab_internal_extension_markdown__migrated_golden_master_examples__video__001: - spec_example_position: 747 - source_specification: gitlab -08_04_52__gitlab_internal_extension_markdown__migrated_golden_master_examples__word_break__001: - spec_example_position: 748 - source_specification: gitlab -08_05_00__gitlab_internal_extension_markdown__image_attributes__001: - spec_example_position: 749 - source_specification: gitlab -08_05_00__gitlab_internal_extension_markdown__image_attributes__002: - spec_example_position: 750 - source_specification: gitlab -08_05_00__gitlab_internal_extension_markdown__image_attributes__003: - spec_example_position: 751 - source_specification: gitlab -08_05_00__gitlab_internal_extension_markdown__image_attributes__004: - spec_example_position: 752 - source_specification: gitlab -08_05_00__gitlab_internal_extension_markdown__image_attributes__005: - spec_example_position: 753 - source_specification: gitlab -08_06_00__gitlab_internal_extension_markdown__footnotes__001: - spec_example_position: 754 - source_specification: gitlab -09_00_00__gfm_undocumented_extensions_and_more_robust_test__footnotes__002: - spec_example_position: 755 - source_specification: commonmark -? 09_01_00__gfm_undocumented_extensions_and_more_robust_test__when_a_footnote_is_used_multiple_times,_we_insert_multiple_backrefs.__001 -: spec_example_position: 756 - source_specification: commonmark -09_02_00__gfm_undocumented_extensions_and_more_robust_test__footnote_reference_labels_are_href_escaped__001: - spec_example_position: 757 - source_specification: commonmark -09_03_00__gfm_undocumented_extensions_and_more_robust_test__interop__001: - spec_example_position: 758 - source_specification: commonmark -09_03_00__gfm_undocumented_extensions_and_more_robust_test__interop__002: - spec_example_position: 759 - source_specification: commonmark -09_04_00__gfm_undocumented_extensions_and_more_robust_test__task_lists__001: - spec_example_position: 760 - source_specification: commonmark -09_04_00__gfm_undocumented_extensions_and_more_robust_test__task_lists__002: - spec_example_position: 761 - source_specification: commonmark -09_04_00__gfm_undocumented_extensions_and_more_robust_test__task_lists__003: - spec_example_position: 762 - source_specification: commonmark diff --git a/glfm_specification/output_example_snapshots/html.yml b/glfm_specification/output_example_snapshots/html.yml deleted file mode 100644 index 1170db2ac2f0aca51487f537c2920c85e4438398..0000000000000000000000000000000000000000 --- a/glfm_specification/output_example_snapshots/html.yml +++ /dev/null @@ -1,6943 +0,0 @@ ---- -02_01_00__preliminaries__tabs__001: - canonical: "<pre><code>foo\tbaz\t\tbim\n</code></pre>\n" - static: "<div class=\"gl-relative markdown-code-block js-markdown-code\">\n<pre - data-sourcepos=\"1:2-1:13\" class=\"code highlight js-syntax-highlight language-plaintext\" - v-pre=\"true\"><code><span id=\"LC1\" class=\"line\" lang=\"plaintext\">foo\tbaz\t\tbim</span></code></pre>\n<copy-code></copy-code>\n</div>" -02_01_00__preliminaries__tabs__002: - canonical: "<pre><code>foo\tbaz\t\tbim\n</code></pre>\n" - static: "<div class=\"gl-relative markdown-code-block js-markdown-code\">\n<pre - data-sourcepos=\"1:4-1:15\" class=\"code highlight js-syntax-highlight language-plaintext\" - v-pre=\"true\"><code><span id=\"LC1\" class=\"line\" lang=\"plaintext\">foo\tbaz\t\tbim</span></code></pre>\n<copy-code></copy-code>\n</div>" -02_01_00__preliminaries__tabs__003: - canonical: "<pre><code>a\ta\ná½\ta\n</code></pre>\n" - static: "<div class=\"gl-relative markdown-code-block js-markdown-code\">\n<pre - data-sourcepos=\"1:5-2:9\" class=\"code highlight js-syntax-highlight language-plaintext\" - v-pre=\"true\"><code><span id=\"LC1\" class=\"line\" lang=\"plaintext\">a\ta</span>\n<span - id=\"LC2\" class=\"line\" lang=\"plaintext\">á½\ta</span></code></pre>\n<copy-code></copy-code>\n</div>" -02_01_00__preliminaries__tabs__004: - canonical: | - <ul> - <li> - <p>foo</p> - <p>bar</p> - </li> - </ul> - static: |- - <ul data-sourcepos="1:3-3:4" dir="auto"> - <li data-sourcepos="1:3-3:4"> - <p data-sourcepos="1:5-1:7">foo</p> - <p data-sourcepos="3:2-3:4">bar</p> - </li> - </ul> -02_01_00__preliminaries__tabs__005: - canonical: | - <ul> - <li> - <p>foo</p> - <pre><code> bar - </code></pre> - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-3:5" dir="auto"> - <li data-sourcepos="1:1-3:5"> - <p data-sourcepos="1:3-1:5">foo</p> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="3:2-3:5" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> bar</span></code></pre> - <copy-code></copy-code> - </div> - </li> - </ul> -02_01_00__preliminaries__tabs__006: - canonical: | - <blockquote> - <pre><code> foo - </code></pre> - </blockquote> - static: |- - <blockquote data-sourcepos="1:1-1:6" dir="auto"> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:3-1:6" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> foo</span></code></pre> - <copy-code></copy-code> - </div> - </blockquote> -02_01_00__preliminaries__tabs__007: - canonical: | - <ul> - <li> - <pre><code> foo - </code></pre> - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-1:6" dir="auto"> - <li data-sourcepos="1:1-1:6"> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:3-1:6" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> foo</span></code></pre> - <copy-code></copy-code> - </div> - </li> - </ul> -02_01_00__preliminaries__tabs__008: - canonical: | - <pre><code>foo - bar - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:5-2:4" class="code highlight js-syntax-highlight language-plaintext" 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> -02_01_00__preliminaries__tabs__009: - canonical: | - <ul> - <li>foo - <ul> - <li>bar - <ul> - <li>baz</li> - </ul> - </li> - </ul> - </li> - </ul> - static: |- - <ul data-sourcepos="1:2-3:7" dir="auto"> - <li data-sourcepos="1:2-3:7">foo - <ul data-sourcepos="2:4-3:7"> - <li data-sourcepos="2:4-3:7">bar - <ul data-sourcepos="3:3-3:7"> - <li data-sourcepos="3:3-3:7">baz</li> - </ul> - </li> - </ul> - </li> - </ul> -02_01_00__preliminaries__tabs__010: - canonical: | - <h1>Foo</h1> - static: |- - <h1 data-sourcepos="1:1-1:5" dir="auto"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>Foo</h1> -02_01_00__preliminaries__tabs__011: - canonical: | - <hr /> - static: |- - <hr data-sourcepos="1:1-1:6"> -03_01_00__blocks_and_inlines__precedence__001: - canonical: | - <ul> - <li>`one</li> - <li>two`</li> - </ul> - static: |- - <ul data-sourcepos="1:1-2:6" dir="auto"> - <li data-sourcepos="1:1-1:6">`one</li> - <li data-sourcepos="2:1-2:6">two`</li> - </ul> -04_01_00__leaf_blocks__thematic_breaks__001: - canonical: | - <hr /> - <hr /> - <hr /> - static: |- - <hr data-sourcepos="1:1-1:3"> - <hr data-sourcepos="2:1-2:3"> - <hr data-sourcepos="3:1-3:3"> -04_01_00__leaf_blocks__thematic_breaks__002: - canonical: | - <p>+++</p> - static: |- - <p data-sourcepos="1:1-1:3" dir="auto">+++</p> -04_01_00__leaf_blocks__thematic_breaks__003: - canonical: | - <p>===</p> - static: |- - <p data-sourcepos="1:1-1:3" dir="auto">===</p> -04_01_00__leaf_blocks__thematic_breaks__004: - canonical: | - <p>-- - ** - __</p> - static: |- - <p data-sourcepos="1:1-3:2" dir="auto">-- - ** - __</p> -04_01_00__leaf_blocks__thematic_breaks__005: - canonical: | - <hr /> - <hr /> - <hr /> - static: |- - <hr data-sourcepos="1:2-1:4"> - <hr data-sourcepos="2:3-2:5"> - <hr data-sourcepos="3:4-3:6"> -04_01_00__leaf_blocks__thematic_breaks__006: - canonical: | - <pre><code>*** - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:5-1:7" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">***</span></code></pre> - <copy-code></copy-code> - </div> -04_01_00__leaf_blocks__thematic_breaks__007: - canonical: | - <p>Foo - ***</p> - static: |- - <p data-sourcepos="1:1-2:7" dir="auto">Foo - ***</p> -04_01_00__leaf_blocks__thematic_breaks__008: - canonical: | - <hr /> - static: |- - <hr data-sourcepos="1:1-1:37"> -04_01_00__leaf_blocks__thematic_breaks__009: - canonical: | - <hr /> - static: |- - <hr data-sourcepos="1:2-1:6"> -04_01_00__leaf_blocks__thematic_breaks__010: - canonical: | - <hr /> - static: |- - <hr data-sourcepos="1:2-1:19"> -04_01_00__leaf_blocks__thematic_breaks__011: - canonical: | - <hr /> - static: |- - <hr data-sourcepos="1:1-1:21"> -04_01_00__leaf_blocks__thematic_breaks__012: - canonical: | - <hr /> - static: |- - <hr data-sourcepos="1:1-1:11"> -04_01_00__leaf_blocks__thematic_breaks__013: - canonical: | - <p>_ _ _ _ a</p> - <p>a------</p> - <p>---a---</p> - static: |- - <p data-sourcepos="1:1-1:9" dir="auto">_ _ _ _ a</p> - <p data-sourcepos="3:1-3:7" dir="auto">a------</p> - <p data-sourcepos="5:1-5:7" dir="auto">---a---</p> -04_01_00__leaf_blocks__thematic_breaks__014: - canonical: | - <p><em>-</em></p> - static: |- - <p data-sourcepos="1:2-1:4" dir="auto"><em data-sourcepos="1:2-1:4">-</em></p> -04_01_00__leaf_blocks__thematic_breaks__015: - canonical: | - <ul> - <li>foo</li> - </ul> - <hr /> - <ul> - <li>bar</li> - </ul> - static: |- - <ul data-sourcepos="1:1-1:5" dir="auto"> - <li data-sourcepos="1:1-1:5">foo</li> - </ul> - <hr data-sourcepos="2:1-2:3"> - <ul data-sourcepos="3:1-3:5" dir="auto"> - <li data-sourcepos="3:1-3:5">bar</li> - </ul> -04_01_00__leaf_blocks__thematic_breaks__016: - canonical: | - <p>Foo</p> - <hr /> - <p>bar</p> - static: |- - <p data-sourcepos="1:1-1:3" dir="auto">Foo</p> - <hr data-sourcepos="2:1-2:3"> - <p data-sourcepos="3:1-3:3" dir="auto">bar</p> -04_01_00__leaf_blocks__thematic_breaks__017: - canonical: | - <h2>Foo</h2> - <p>bar</p> - static: |- - <h2 data-sourcepos="1:1-2:3" dir="auto"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>Foo</h2> - <p data-sourcepos="3:1-3:3" dir="auto">bar</p> -04_01_00__leaf_blocks__thematic_breaks__018: - canonical: | - <ul> - <li>Foo</li> - </ul> - <hr /> - <ul> - <li>Bar</li> - </ul> - static: |- - <ul data-sourcepos="1:1-1:5" dir="auto"> - <li data-sourcepos="1:1-1:5">Foo</li> - </ul> - <hr data-sourcepos="2:1-2:5"> - <ul data-sourcepos="3:1-3:5" dir="auto"> - <li data-sourcepos="3:1-3:5">Bar</li> - </ul> -04_01_00__leaf_blocks__thematic_breaks__019: - canonical: | - <ul> - <li>Foo</li> - <li> - <hr /> - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-2:7" dir="auto"> - <li data-sourcepos="1:1-1:5">Foo</li> - <li data-sourcepos="2:1-2:7"> - <hr data-sourcepos="2:3-2:7"> - </li> - </ul> -04_02_00__leaf_blocks__atx_headings__001: - canonical: | - <h1>foo</h1> - <h2>foo</h2> - <h3>foo</h3> - <h4>foo</h4> - <h5>foo</h5> - <h6>foo</h6> - static: |- - <h1 data-sourcepos="1:1-1:5" dir="auto"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>foo</h1> - <h2 data-sourcepos="2:1-2:6" dir="auto"> - <a href="#foo-1" aria-hidden="true" class="anchor" id="user-content-foo-1"></a>foo</h2> - <h3 data-sourcepos="3:1-3:7" dir="auto"> - <a href="#foo-2" aria-hidden="true" class="anchor" id="user-content-foo-2"></a>foo</h3> - <h4 data-sourcepos="4:1-4:8" dir="auto"> - <a href="#foo-3" aria-hidden="true" class="anchor" id="user-content-foo-3"></a>foo</h4> - <h5 data-sourcepos="5:1-5:9" dir="auto"> - <a href="#foo-4" aria-hidden="true" class="anchor" id="user-content-foo-4"></a>foo</h5> - <h6 data-sourcepos="6:1-6:10" dir="auto"> - <a href="#foo-5" aria-hidden="true" class="anchor" id="user-content-foo-5"></a>foo</h6> -04_02_00__leaf_blocks__atx_headings__002: - canonical: | - <p>####### foo</p> - static: |- - <p data-sourcepos="1:1-1:11" dir="auto">####### foo</p> -04_02_00__leaf_blocks__atx_headings__003: - canonical: | - <p>#5 bolt</p> - <p>#hashtag</p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto">#5 bolt</p> - <p data-sourcepos="3:1-3:8" dir="auto">#hashtag</p> -04_02_00__leaf_blocks__atx_headings__004: - canonical: | - <p>## foo</p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto"><span data-escaped-char data-sourcepos="1:1-1:2">#</span># foo</p> -04_02_00__leaf_blocks__atx_headings__005: - canonical: | - <h1>foo <em>bar</em> *baz*</h1> - static: |- - <h1 data-sourcepos="1:1-1:19" dir="auto"> - <a href="#foo-bar-baz" aria-hidden="true" class="anchor" id="user-content-foo-bar-baz"></a>foo <em data-sourcepos="1:7-1:11">bar</em> *baz*</h1> -04_02_00__leaf_blocks__atx_headings__006: - canonical: | - <h1>foo</h1> - static: |- - <h1 data-sourcepos="1:1-1:43" dir="auto"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>foo</h1> -04_02_00__leaf_blocks__atx_headings__007: - canonical: | - <h3>foo</h3> - <h2>foo</h2> - <h1>foo</h1> - static: |- - <h3 data-sourcepos="1:2-1:8" dir="auto"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>foo</h3> - <h2 data-sourcepos="2:3-2:8" dir="auto"> - <a href="#foo-1" aria-hidden="true" class="anchor" id="user-content-foo-1"></a>foo</h2> - <h1 data-sourcepos="3:4-3:8" dir="auto"> - <a href="#foo-2" aria-hidden="true" class="anchor" id="user-content-foo-2"></a>foo</h1> -04_02_00__leaf_blocks__atx_headings__008: - canonical: | - <pre><code># foo - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:5-1:9" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"># foo</span></code></pre> - <copy-code></copy-code> - </div> -04_02_00__leaf_blocks__atx_headings__009: - canonical: | - <p>foo - # bar</p> - static: |- - <p data-sourcepos="1:1-2:9" dir="auto">foo - # bar</p> -04_02_00__leaf_blocks__atx_headings__010: - canonical: | - <h2>foo</h2> - <h3>bar</h3> - static: |- - <h2 data-sourcepos="1:1-1:9" dir="auto"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>foo</h2> - <h3 data-sourcepos="2:3-2:18" dir="auto"> - <a href="#bar" aria-hidden="true" class="anchor" id="user-content-bar"></a>bar</h3> -04_02_00__leaf_blocks__atx_headings__011: - canonical: | - <h1>foo</h1> - <h5>foo</h5> - static: |- - <h1 data-sourcepos="1:1-1:40" dir="auto"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>foo</h1> - <h5 data-sourcepos="2:1-2:12" dir="auto"> - <a href="#foo-1" aria-hidden="true" class="anchor" id="user-content-foo-1"></a>foo</h5> -04_02_00__leaf_blocks__atx_headings__012: - canonical: | - <h3>foo</h3> - static: |- - <h3 data-sourcepos="1:1-1:16" dir="auto"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>foo</h3> -04_02_00__leaf_blocks__atx_headings__013: - canonical: | - <h3>foo ### b</h3> - static: |- - <h3 data-sourcepos="1:1-1:13" dir="auto"> - <a href="#foo--b" aria-hidden="true" class="anchor" id="user-content-foo--b"></a>foo ### b</h3> -04_02_00__leaf_blocks__atx_headings__014: - canonical: | - <h1>foo#</h1> - static: |- - <h1 data-sourcepos="1:1-1:6" dir="auto"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>foo#</h1> -04_02_00__leaf_blocks__atx_headings__015: - canonical: | - <h3>foo ###</h3> - <h2>foo ###</h2> - <h1>foo #</h1> - static: |- - <h3 data-sourcepos="1:1-1:12" dir="auto"> - <a href="#foo-" aria-hidden="true" class="anchor" id="user-content-foo-"></a>foo <span data-escaped-char data-sourcepos="1:9-1:10">#</span>##</h3> - <h2 data-sourcepos="2:1-2:11" dir="auto"> - <a href="#foo--1" aria-hidden="true" class="anchor" id="user-content-foo--1"></a>foo #<span data-escaped-char data-sourcepos="2:9-2:10">#</span>#</h2> - <h1 data-sourcepos="3:1-3:8" dir="auto"> - <a href="#foo--2" aria-hidden="true" class="anchor" id="user-content-foo--2"></a>foo <span data-escaped-char data-sourcepos="3:7-3:8">#</span> - </h1> -04_02_00__leaf_blocks__atx_headings__016: - canonical: | - <hr /> - <h2>foo</h2> - <hr /> - static: |- - <hr data-sourcepos="1:1-1:4"> - <h2 data-sourcepos="2:1-2:6" dir="auto"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>foo</h2> - <hr data-sourcepos="3:1-3:4"> -04_02_00__leaf_blocks__atx_headings__017: - canonical: | - <p>Foo bar</p> - <h1>baz</h1> - <p>Bar foo</p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto">Foo bar</p> - <h1 data-sourcepos="2:1-2:5" dir="auto"> - <a href="#baz" aria-hidden="true" class="anchor" id="user-content-baz"></a>baz</h1> - <p data-sourcepos="3:1-3:7" dir="auto">Bar foo</p> -04_02_00__leaf_blocks__atx_headings__018: - canonical: | - <h2></h2> - <h1></h1> - <h3></h3> - static: |- - <h2 data-sourcepos="1:1-1:3" dir="auto"><a href="#" aria-hidden="true" class="anchor" id="user-content-"></a></h2> - <h1 data-sourcepos="2:1-2:1" dir="auto"><a href="#-1" aria-hidden="true" class="anchor" id="user-content--1"></a></h1> - <h3 data-sourcepos="3:1-3:7" dir="auto"><a href="#-2" aria-hidden="true" class="anchor" id="user-content--2"></a></h3> -04_03_00__leaf_blocks__setext_headings__001: - canonical: | - <h1>Foo <em>bar</em></h1> - <h2>Foo <em>bar</em></h2> - static: |- - <h1 data-sourcepos="1:1-2:9" dir="auto"> - <a href="#foo-bar" aria-hidden="true" class="anchor" id="user-content-foo-bar"></a>Foo <em data-sourcepos="1:5-1:9">bar</em> - </h1> - <h2 data-sourcepos="4:1-5:9" dir="auto"> - <a href="#foo-bar-1" aria-hidden="true" class="anchor" id="user-content-foo-bar-1"></a>Foo <em data-sourcepos="4:5-4:9">bar</em> - </h2> -04_03_00__leaf_blocks__setext_headings__002: - canonical: | - <h1>Foo <em>bar - baz</em></h1> - static: |- - <h1 data-sourcepos="1:1-3:4" dir="auto"> - <a href="#foo-bar-baz" aria-hidden="true" class="anchor" id="user-content-foo-bar-baz"></a>Foo <em data-sourcepos="1:5-2:4">bar - baz</em> - </h1> -04_03_00__leaf_blocks__setext_headings__003: - canonical: | - <h1>Foo <em>bar - baz</em></h1> - static: |- - <h1 data-sourcepos="1:3-3:4" dir="auto"> - <a href="#foo-bar-baz" aria-hidden="true" class="anchor" id="user-content-foo-bar-baz"></a>Foo <em data-sourcepos="1:7-2:6">bar - baz</em> - </h1> -04_03_00__leaf_blocks__setext_headings__004: - canonical: | - <h2>Foo</h2> - <h1>Foo</h1> - static: |- - <h2 data-sourcepos="1:1-2:25" dir="auto"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>Foo</h2> - <h1 data-sourcepos="4:1-5:1" dir="auto"> - <a href="#foo-1" aria-hidden="true" class="anchor" id="user-content-foo-1"></a>Foo</h1> -04_03_00__leaf_blocks__setext_headings__005: - canonical: | - <h2>Foo</h2> - <h2>Foo</h2> - <h1>Foo</h1> - static: |- - <h2 data-sourcepos="1:4-2:3" dir="auto"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>Foo</h2> - <h2 data-sourcepos="4:3-5:5" dir="auto"> - <a href="#foo-1" aria-hidden="true" class="anchor" id="user-content-foo-1"></a>Foo</h2> - <h1 data-sourcepos="7:3-8:5" dir="auto"> - <a href="#foo-2" aria-hidden="true" class="anchor" id="user-content-foo-2"></a>Foo</h1> -04_03_00__leaf_blocks__setext_headings__006: - canonical: | - <pre><code>Foo - --- - - Foo - </code></pre> - <hr /> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:5-4:7" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> - <copy-code></copy-code> - </div> - <hr data-sourcepos="5:1-5:3"> -04_03_00__leaf_blocks__setext_headings__007: - canonical: | - <h2>Foo</h2> - static: |- - <h2 data-sourcepos="1:1-2:13" dir="auto"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>Foo</h2> -04_03_00__leaf_blocks__setext_headings__008: - canonical: | - <p>Foo - ---</p> - static: |- - <p data-sourcepos="1:1-2:7" dir="auto">Foo - ---</p> -04_03_00__leaf_blocks__setext_headings__009: - canonical: | - <p>Foo - = =</p> - <p>Foo</p> - <hr /> - static: |- - <p data-sourcepos="1:1-2:3" dir="auto">Foo - = =</p> - <p data-sourcepos="4:1-4:3" dir="auto">Foo</p> - <hr data-sourcepos="5:1-5:5"> -04_03_00__leaf_blocks__setext_headings__010: - canonical: | - <h2>Foo</h2> - static: |- - <h2 data-sourcepos="1:1-2:5" dir="auto"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>Foo</h2> -04_03_00__leaf_blocks__setext_headings__011: - canonical: | - <h2>Foo\</h2> - static: |- - <h2 data-sourcepos="1:1-2:4" dir="auto"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>Foo\</h2> -04_03_00__leaf_blocks__setext_headings__012: - canonical: | - <h2>`Foo</h2> - <p>`</p> - <h2><a title="a lot</h2> - <p>of dashes"/></p> - static: |- - <h2 data-sourcepos="1:1-2:4" dir="auto"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>`Foo</h2> - <p data-sourcepos="3:1-3:1" dir="auto">`</p> - <h2 data-sourcepos="5:1-6:3" dir="auto"> - <a href="#a-titlea-lot" aria-hidden="true" class="anchor" id="user-content-a-titlea-lot"></a><a title="a lot</h2> - <p data-sourcepos="7:1-7:12" dir="auto">of dashes"/></p> -04_03_00__leaf_blocks__setext_headings__013: - canonical: | - <blockquote> - <p>Foo</p> - </blockquote> - <hr /> - static: |- - <blockquote data-sourcepos="1:1-1:5" dir="auto"> - <p data-sourcepos="1:3-1:5">Foo</p> - </blockquote> - <hr data-sourcepos="2:1-2:3"> -04_03_00__leaf_blocks__setext_headings__014: - canonical: | - <blockquote> - <p>foo - bar - ===</p> - </blockquote> - static: |- - <blockquote data-sourcepos="1:1-3:3" dir="auto"> - <p data-sourcepos="1:3-3:3">foo - bar - ===</p> - </blockquote> -04_03_00__leaf_blocks__setext_headings__015: - canonical: | - <ul> - <li>Foo</li> - </ul> - <hr /> - static: |- - <ul data-sourcepos="1:1-1:5" dir="auto"> - <li data-sourcepos="1:1-1:5">Foo</li> - </ul> - <hr data-sourcepos="2:1-2:3"> -04_03_00__leaf_blocks__setext_headings__016: - canonical: | - <h2>Foo - Bar</h2> - static: |- - <h2 data-sourcepos="1:1-3:3" dir="auto"> - <a href="#foo-bar" aria-hidden="true" class="anchor" id="user-content-foo-bar"></a>Foo - Bar</h2> -04_03_00__leaf_blocks__setext_headings__017: - canonical: | - <hr /> - <h2>Foo</h2> - <h2>Bar</h2> - <p>Baz</p> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-3:3" data-canonical-lang="yaml" data-lang-params="frontmatter" class="code highlight js-syntax-highlight language-yaml" v-pre="true"><code><span id="LC1" class="line" lang="yaml"><span class="s">Foo</span></span></code></pre> - <copy-code></copy-code> - </div> - <h2 data-sourcepos="4:1-5:3" dir="auto"> - <a href="#bar" aria-hidden="true" class="anchor" id="user-content-bar"></a>Bar</h2> - <p data-sourcepos="6:1-6:3" dir="auto">Baz</p> -04_03_00__leaf_blocks__setext_headings__018: - canonical: | - <p>====</p> - static: |- - <p data-sourcepos="2:1-2:4" dir="auto">====</p> -04_03_00__leaf_blocks__setext_headings__019: - canonical: | - <hr /> - <hr /> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-2:3" data-canonical-lang="yaml" data-lang-params="frontmatter" class="code highlight js-syntax-highlight language-yaml" v-pre="true"><code></code></pre> - <copy-code></copy-code> - </div> -04_03_00__leaf_blocks__setext_headings__020: - canonical: | - <ul> - <li>foo</li> - </ul> - <hr /> - static: |- - <ul data-sourcepos="1:1-1:5" dir="auto"> - <li data-sourcepos="1:1-1:5">foo</li> - </ul> - <hr data-sourcepos="2:1-2:5"> -04_03_00__leaf_blocks__setext_headings__021: - canonical: | - <pre><code>foo - </code></pre> - <hr /> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:5-1:7" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span></code></pre> - <copy-code></copy-code> - </div> - <hr data-sourcepos="2:1-2:3"> -04_03_00__leaf_blocks__setext_headings__022: - canonical: | - <blockquote> - <p>foo</p> - </blockquote> - <hr /> - static: |- - <blockquote data-sourcepos="1:1-1:5" dir="auto"> - <p data-sourcepos="1:3-1:5">foo</p> - </blockquote> - <hr data-sourcepos="2:1-2:5"> -04_03_00__leaf_blocks__setext_headings__023: - canonical: | - <h2>> foo</h2> - static: |- - <h2 data-sourcepos="1:1-2:6" dir="auto"> - <a href="#-foo" aria-hidden="true" class="anchor" id="user-content--foo"></a>> foo</h2> -04_03_00__leaf_blocks__setext_headings__024: - canonical: | - <p>Foo</p> - <h2>bar</h2> - <p>baz</p> - static: |- - <p data-sourcepos="1:1-1:3" dir="auto">Foo</p> - <h2 data-sourcepos="3:1-4:3" dir="auto"> - <a href="#bar" aria-hidden="true" class="anchor" id="user-content-bar"></a>bar</h2> - <p data-sourcepos="5:1-5:3" dir="auto">baz</p> -04_03_00__leaf_blocks__setext_headings__025: - canonical: | - <p>Foo - bar</p> - <hr /> - <p>baz</p> - static: |- - <p data-sourcepos="1:1-2:3" dir="auto">Foo - bar</p> - <hr data-sourcepos="4:1-5:0"> - <p data-sourcepos="6:1-6:3" dir="auto">baz</p> -04_03_00__leaf_blocks__setext_headings__026: - canonical: | - <p>Foo - bar</p> - <hr /> - <p>baz</p> - static: |- - <p data-sourcepos="1:1-2:3" dir="auto">Foo - bar</p> - <hr data-sourcepos="3:1-3:5"> - <p data-sourcepos="4:1-4:3" dir="auto">baz</p> -04_03_00__leaf_blocks__setext_headings__027: - canonical: | - <p>Foo - bar - --- - baz</p> - static: |- - <p data-sourcepos="1:1-4:3" dir="auto">Foo - bar - --- - baz</p> -04_04_00__leaf_blocks__indented_code_blocks__001: - canonical: | - <pre><code>a simple - indented code block - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:5-2:25" class="code highlight js-syntax-highlight language-plaintext" 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> -04_04_00__leaf_blocks__indented_code_blocks__002: - canonical: | - <ul> - <li> - <p>foo</p> - <p>bar</p> - </li> - </ul> - static: |- - <ul data-sourcepos="1:3-3:7" dir="auto"> - <li data-sourcepos="1:3-3:7"> - <p data-sourcepos="1:5-1:7">foo</p> - <p data-sourcepos="3:5-3:7">bar</p> - </li> - </ul> -04_04_00__leaf_blocks__indented_code_blocks__003: - canonical: | - <ol> - <li> - <p>foo</p> - <ul> - <li>bar</li> - </ul> - </li> - </ol> - static: |- - <ol data-sourcepos="1:1-3:9" dir="auto"> - <li data-sourcepos="1:1-3:9"> - <p data-sourcepos="1:5-1:7">foo</p> - <ul data-sourcepos="3:5-3:9"> - <li data-sourcepos="3:5-3:9">bar</li> - </ul> - </li> - </ol> -04_04_00__leaf_blocks__indented_code_blocks__004: - canonical: | - <pre><code><a/> - *hi* - - - one - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:5-4:9" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> - <copy-code></copy-code> - </div> -04_04_00__leaf_blocks__indented_code_blocks__005: - canonical: | - <pre><code>chunk1 - - chunk2 - - - - chunk3 - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:5-7:10" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> - <copy-code></copy-code> - </div> -04_04_00__leaf_blocks__indented_code_blocks__006: - canonical: "<pre><code>chunk1\n \n chunk2\n</code></pre>\n" - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:5-3:12" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> - <copy-code></copy-code> - </div> -04_04_00__leaf_blocks__indented_code_blocks__007: - canonical: | - <p>Foo - bar</p> - static: |- - <p data-sourcepos="1:1-2:7" dir="auto">Foo - bar</p> -04_04_00__leaf_blocks__indented_code_blocks__008: - canonical: | - <pre><code>foo - </code></pre> - <p>bar</p> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:5-1:7" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span></code></pre> - <copy-code></copy-code> - </div> - <p data-sourcepos="2:1-2:3" dir="auto">bar</p> -04_04_00__leaf_blocks__indented_code_blocks__009: - canonical: | - <h1>Heading</h1> - <pre><code>foo - </code></pre> - <h2>Heading</h2> - <pre><code>foo - </code></pre> - <hr /> - static: |- - <h1 data-sourcepos="1:1-1:9" dir="auto"> - <a href="#heading" aria-hidden="true" class="anchor" id="user-content-heading"></a>Heading</h1> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="2:5-2:7" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span></code></pre> - <copy-code></copy-code> - </div> - <h2 data-sourcepos="3:1-4:6" dir="auto"> - <a href="#heading-1" aria-hidden="true" class="anchor" id="user-content-heading-1"></a>Heading</h2> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="5:5-5:7" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span></code></pre> - <copy-code></copy-code> - </div> - <hr data-sourcepos="6:1-6:4"> -04_04_00__leaf_blocks__indented_code_blocks__010: - canonical: | - <pre><code> foo - bar - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:5-2:7" class="code highlight js-syntax-highlight language-plaintext" 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> -04_04_00__leaf_blocks__indented_code_blocks__011: - canonical: | - <pre><code>foo - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="3:5-5:0" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span></code></pre> - <copy-code></copy-code> - </div> -04_04_00__leaf_blocks__indented_code_blocks__012: - canonical: "<pre><code>foo \n</code></pre>\n" - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:5-1:9" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo </span></code></pre> - <copy-code></copy-code> - </div> -04_05_00__leaf_blocks__fenced_code_blocks__001: - canonical: | - <pre><code>< - > - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-4:3" class="code highlight js-syntax-highlight language-plaintext" 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> -04_05_00__leaf_blocks__fenced_code_blocks__002: - canonical: | - <pre><code>< - > - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-4:3" class="code highlight js-syntax-highlight language-plaintext" 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> -04_05_00__leaf_blocks__fenced_code_blocks__003: - canonical: | - <p><code>foo</code></p> - static: |- - <p data-sourcepos="1:1-3:2" dir="auto"><code data-sourcepos="1:3-3:0">foo</code></p> -04_05_00__leaf_blocks__fenced_code_blocks__004: - canonical: | - <pre><code>aaa - ~~~ - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-4:3" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span> - <span id="LC2" class="line" lang="plaintext">~~~</span></code></pre> - <copy-code></copy-code> - </div> -04_05_00__leaf_blocks__fenced_code_blocks__005: - canonical: | - <pre><code>aaa - ``` - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-4:3" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span> - <span id="LC2" class="line" lang="plaintext">```</span></code></pre> - <copy-code></copy-code> - </div> -04_05_00__leaf_blocks__fenced_code_blocks__006: - canonical: | - <pre><code>aaa - ``` - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-4:6" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span> - <span id="LC2" class="line" lang="plaintext">```</span></code></pre> - <copy-code></copy-code> - </div> -04_05_00__leaf_blocks__fenced_code_blocks__007: - canonical: | - <pre><code>aaa - ~~~ - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-4:4" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span> - <span id="LC2" class="line" lang="plaintext">~~~</span></code></pre> - <copy-code></copy-code> - </div> -04_05_00__leaf_blocks__fenced_code_blocks__008: - canonical: | - <pre><code></code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-1:3" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code></code></pre> - <copy-code></copy-code> - </div> -04_05_00__leaf_blocks__fenced_code_blocks__009: - canonical: | - <pre><code> - ``` - aaa - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-4:3" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> - <copy-code></copy-code> - </div> -04_05_00__leaf_blocks__fenced_code_blocks__010: - canonical: | - <blockquote> - <pre><code>aaa - </code></pre> - </blockquote> - <p>bbb</p> - static: |- - <blockquote data-sourcepos="1:1-2:5" dir="auto"> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:3-3:0" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span></code></pre> - <copy-code></copy-code> - </div> - </blockquote> - <p data-sourcepos="4:1-4:3" dir="auto">bbb</p> -04_05_00__leaf_blocks__fenced_code_blocks__011: - canonical: "<pre><code>\n \n</code></pre>\n" - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-4:3" class="code highlight js-syntax-highlight language-plaintext" 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> -04_05_00__leaf_blocks__fenced_code_blocks__012: - canonical: | - <pre><code></code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-2:3" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code></code></pre> - <copy-code></copy-code> - </div> -04_05_00__leaf_blocks__fenced_code_blocks__013: - canonical: | - <pre><code>aaa - aaa - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:2-4:3" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span> - <span id="LC2" class="line" lang="plaintext">aaa</span></code></pre> - <copy-code></copy-code> - </div> -04_05_00__leaf_blocks__fenced_code_blocks__014: - canonical: | - <pre><code>aaa - aaa - aaa - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:3-5:5" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span> - <span id="LC2" class="line" lang="plaintext">aaa</span> - <span id="LC3" class="line" lang="plaintext">aaa</span></code></pre> - <copy-code></copy-code> - </div> -04_05_00__leaf_blocks__fenced_code_blocks__015: - canonical: | - <pre><code>aaa - aaa - aaa - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:4-5:6" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span> - <span id="LC2" class="line" lang="plaintext"> aaa</span> - <span id="LC3" class="line" lang="plaintext">aaa</span></code></pre> - <copy-code></copy-code> - </div> -04_05_00__leaf_blocks__fenced_code_blocks__016: - canonical: | - <pre><code>``` - aaa - ``` - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:5-3:7" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> - <copy-code></copy-code> - </div> -04_05_00__leaf_blocks__fenced_code_blocks__017: - canonical: | - <pre><code>aaa - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-3:5" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span></code></pre> - <copy-code></copy-code> - </div> -04_05_00__leaf_blocks__fenced_code_blocks__018: - canonical: | - <pre><code>aaa - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:4-3:5" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span></code></pre> - <copy-code></copy-code> - </div> -04_05_00__leaf_blocks__fenced_code_blocks__019: - canonical: | - <pre><code>aaa - ``` - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-3:7" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span> - <span id="LC2" class="line" lang="plaintext"> ```</span></code></pre> - <copy-code></copy-code> - </div> -04_05_00__leaf_blocks__fenced_code_blocks__020: - canonical: | - <p><code> </code> - aaa</p> - static: |- - <p data-sourcepos="1:1-2:3" dir="auto"><code data-sourcepos="1:4-1:4"> </code> - aaa</p> -04_05_00__leaf_blocks__fenced_code_blocks__021: - canonical: | - <pre><code>aaa - ~~~ ~~ - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-3:6" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span> - <span id="LC2" class="line" lang="plaintext">~~~ ~~</span></code></pre> - <copy-code></copy-code> - </div> -04_05_00__leaf_blocks__fenced_code_blocks__022: - canonical: | - <p>foo</p> - <pre><code>bar - </code></pre> - <p>baz</p> - static: |- - <p data-sourcepos="1:1-1:3" dir="auto">foo</p> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="2:1-4:3" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">bar</span></code></pre> - <copy-code></copy-code> - </div> - <p data-sourcepos="5:1-5:3" dir="auto">baz</p> -04_05_00__leaf_blocks__fenced_code_blocks__023: - canonical: | - <h2>foo</h2> - <pre><code>bar - </code></pre> - <h1>baz</h1> - static: |- - <h2 data-sourcepos="1:1-2:3" dir="auto"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>foo</h2> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="3:1-5:3" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">bar</span></code></pre> - <copy-code></copy-code> - </div> - <h1 data-sourcepos="6:1-6:5" dir="auto"> - <a href="#baz" aria-hidden="true" class="anchor" id="user-content-baz"></a>baz</h1> -04_05_00__leaf_blocks__fenced_code_blocks__024: - canonical: | - <pre><code class="language-ruby">def foo(x) - return 3 - end - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-5:3" data-canonical-lang="ruby" class="code highlight js-syntax-highlight language-ruby" v-pre="true"><code><span id="LC1" class="line" lang="ruby"><span class="k">def</span> <span class="nf">foo</span><span class="p">(</span><span class="n">x</span><span class="p">)</span></span> - <span id="LC2" class="line" lang="ruby"> <span class="k">return</span> <span class="mi">3</span></span> - <span id="LC3" class="line" lang="ruby"><span class="k">end</span></span></code></pre> - <copy-code></copy-code> - </div> -04_05_00__leaf_blocks__fenced_code_blocks__025: - canonical: | - <pre><code class="language-ruby">def foo(x) - return 3 - end - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-5:7" data-canonical-lang="ruby" data-lang-params="startline=3 $%@#$" class="code highlight js-syntax-highlight language-ruby" v-pre="true"><code><span id="LC1" class="line" lang="ruby"><span class="k">def</span> <span class="nf">foo</span><span class="p">(</span><span class="n">x</span><span class="p">)</span></span> - <span id="LC2" class="line" lang="ruby"> <span class="k">return</span> <span class="mi">3</span></span> - <span id="LC3" class="line" lang="ruby"><span class="k">end</span></span></code></pre> - <copy-code></copy-code> - </div> -04_05_00__leaf_blocks__fenced_code_blocks__026: - canonical: | - <pre><code class="language-;"></code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-2:4" data-canonical-lang=";" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code></code></pre> - <copy-code></copy-code> - </div> -04_05_00__leaf_blocks__fenced_code_blocks__027: - canonical: | - <p><code>aa</code> - foo</p> - static: |- - <p data-sourcepos="1:1-2:3" dir="auto"><code data-sourcepos="1:4-1:7">aa</code> - foo</p> -04_05_00__leaf_blocks__fenced_code_blocks__028: - canonical: | - <pre><code class="language-aa">foo - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-3:3" data-canonical-lang="aa" data-lang-params="``` ~~~" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span></code></pre> - <copy-code></copy-code> - </div> -04_05_00__leaf_blocks__fenced_code_blocks__029: - canonical: | - <pre><code>``` aaa - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-3:3" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">``` aaa</span></code></pre> - <copy-code></copy-code> - </div> -04_06_00__leaf_blocks__html_blocks__001: - canonical: | - <table><tr><td> - <pre> - **Hello**, - <p><em>world</em>. - </pre></p> - </td></tr></table> - static: |- - <table dir="auto"><tr><td> - <pre> - **Hello**, - <p data-sourcepos="5:1-6:6"><em data-sourcepos="5:1-5:7">world</em>. - </p></pre> - </td></tr></table> -04_06_00__leaf_blocks__html_blocks__002: - canonical: | - <table> - <tr> - <td> - hi - </td> - </tr> - </table> - <p>okay.</p> - static: |- - <table dir="auto"> - <tr> - <td> - hi - </td> - </tr> - </table> - <p data-sourcepos="9:1-9:5" dir="auto">okay.</p> -04_06_00__leaf_blocks__html_blocks__003: - canonical: |2 - <div> - *hello* - <foo><a> - static: |2- - <div> - *hello* - <a></a> - </div> -04_06_00__leaf_blocks__html_blocks__004: - canonical: | - </div> - *foo* - static: |2- - - *foo* -04_06_00__leaf_blocks__html_blocks__005: - canonical: | - <DIV CLASS="foo"> - <p><em>Markdown</em></p> - </DIV> - static: |- - <div> - <p data-sourcepos="3:1-3:10"><em data-sourcepos="3:1-3:10">Markdown</em></p> - </div> -04_06_00__leaf_blocks__html_blocks__006: - canonical: | - <div id="foo" - class="bar"> - </div> - static: |- - <div> - </div> -04_06_00__leaf_blocks__html_blocks__007: - canonical: | - <div id="foo" class="bar - baz"> - </div> - static: |- - <div> - </div> -04_06_00__leaf_blocks__html_blocks__008: - canonical: | - <div> - *foo* - <p><em>bar</em></p> - static: |- - <div> - *foo* - <p data-sourcepos="4:1-4:5"><em data-sourcepos="4:1-4:5">bar</em></p> - </div> -04_06_00__leaf_blocks__html_blocks__009: - canonical: | - <div id="foo" - *hi* - static: |- - <div></div> -04_06_00__leaf_blocks__html_blocks__010: - canonical: | - <div class - foo - static: |- - <div></div> -04_06_00__leaf_blocks__html_blocks__011: - canonical: | - <div *???-&&&-<--- - *foo* - static: |- - <div></div> -04_06_00__leaf_blocks__html_blocks__012: - canonical: | - <div><a href="bar">*foo*</a></div> - static: |- - <div><a href="bar">*foo*</a></div> -04_06_00__leaf_blocks__html_blocks__013: - canonical: | - <table><tr><td> - foo - </td></tr></table> - static: |- - <table dir="auto"><tr><td> - foo - </td></tr></table> -04_06_00__leaf_blocks__html_blocks__014: - canonical: | - <div></div> - ``` c - int x = 33; - ``` - static: |- - <div></div> - ``` c - int x = 33; - ``` -04_06_00__leaf_blocks__html_blocks__015: - canonical: | - <a href="foo"> - *bar* - </a> - static: |- - <a href="foo"> - *bar* - </a> -04_06_00__leaf_blocks__html_blocks__016: - canonical: | - <Warning> - *bar* - </Warning> - static: |2 - - *bar* -04_06_00__leaf_blocks__html_blocks__017: - canonical: | - <i class="foo"> - *bar* - </i> - static: |- - <i> - *bar* - </i> -04_06_00__leaf_blocks__html_blocks__018: - canonical: | - </ins> - *bar* - static: |2- - - *bar* -04_06_00__leaf_blocks__html_blocks__019: - canonical: | - <del> - *foo* - </del> - static: |- - <del> - *foo* - </del> -04_06_00__leaf_blocks__html_blocks__020: - canonical: | - <del> - <p><em>foo</em></p> - </del> - static: |- - <del> - <p data-sourcepos="3:1-3:5"><em data-sourcepos="3:1-3:5">foo</em></p> - </del> -04_06_00__leaf_blocks__html_blocks__021: - canonical: | - <p><del><em>foo</em></del></p> - static: |- - <p data-sourcepos="1:1-1:16" dir="auto"><del><em data-sourcepos="1:6-1:10">foo</em></del></p> -04_06_00__leaf_blocks__html_blocks__022: - canonical: | - <pre language="haskell"><code> - import Text.HTML.TagSoup - - main :: IO () - main = print $ parseTags tags - </code></pre> - <p>okay</p> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></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></code></pre> - <copy-code></copy-code> - </div> - <p data-sourcepos="7:1-7:4" dir="auto">okay</p> -04_06_00__leaf_blocks__html_blocks__023: - canonical: | - <script type="text/javascript"> - // JavaScript example - - document.getElementById("demo").innerHTML = "Hello JavaScript!"; - </script> - <p>okay</p> - static: |2- - - <p data-sourcepos="6:1-6:4" dir="auto">okay</p> -04_06_00__leaf_blocks__html_blocks__024: - canonical: | - <style - type="text/css"> - h1 {color:red;} - - p {color:blue;} - </style> - <p>okay</p> - static: |2- - - h1 {color:red;} - - p {color:blue;} - - <p data-sourcepos="7:1-7:4" dir="auto">okay</p> -04_06_00__leaf_blocks__html_blocks__025: - canonical: | - <style - type="text/css"> - - foo - static: |2- - - - foo -04_06_00__leaf_blocks__html_blocks__026: - canonical: | - <blockquote> - <div> - foo - </blockquote> - <p>bar</p> - static: |- - <blockquote data-sourcepos="1:1-2:5" dir="auto"> - <div> - foo - - <p data-sourcepos="4:1-4:3">bar</p> - </div> - </blockquote> -04_06_00__leaf_blocks__html_blocks__027: - canonical: | - <ul> - <li> - <div> - </li> - <li>foo</li> - </ul> - static: |- - <ul data-sourcepos="1:1-2:5" dir="auto"> - <li data-sourcepos="1:1-1:7"> - <div> - - <li data-sourcepos="2:1-2:5">foo</li> - </div> - </li> - </ul> -04_06_00__leaf_blocks__html_blocks__028: - canonical: | - <style>p{color:red;}</style> - <p><em>foo</em></p> - static: |- - p{color:red;} - <p data-sourcepos="2:1-2:5" dir="auto"><em data-sourcepos="2:1-2:5">foo</em></p> -04_06_00__leaf_blocks__html_blocks__029: - canonical: | - <!-- foo -->*bar* - <p><em>baz</em></p> - static: |- - <!-- foo -->*bar* - <p data-sourcepos="2:1-2:5" dir="auto"><em data-sourcepos="2:1-2:5">baz</em></p> -04_06_00__leaf_blocks__html_blocks__030: - canonical: | - <script> - foo - </script>1. *bar* - static: |- - 1. *bar* -04_06_00__leaf_blocks__html_blocks__031: - canonical: | - <!-- Foo - - bar - baz --> - <p>okay</p> - static: |- - <!-- Foo - - bar - baz --> - <p data-sourcepos="5:1-5:4" dir="auto">okay</p> -04_06_00__leaf_blocks__html_blocks__032: - canonical: | - <?php - - echo '>'; - - ?> - <p>okay</p> - static: |- - <?php echo '>'; - - ?> - <p data-sourcepos="6:1-6:4" dir="auto">okay</p> -04_06_00__leaf_blocks__html_blocks__033: - canonical: | - <!DOCTYPE html> - static: "" -04_06_00__leaf_blocks__html_blocks__034: - canonical: | - <![CDATA[ - function matchwo(a,b) - { - if (a < b && a < 0) then { - return 1; - - } else { - - return 0; - } - } - ]]> - <p>okay</p> - static: |2- - - <p data-sourcepos="13:1-13:4" dir="auto">okay</p> -04_06_00__leaf_blocks__html_blocks__035: - canonical: |2 - <!-- foo --> - <pre><code><!-- foo --> - </code></pre> - static: |2- - <!-- foo --> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="3:5-3:16" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><!-- foo --></span></code></pre> - <copy-code></copy-code> - </div> -04_06_00__leaf_blocks__html_blocks__036: - canonical: |2 - <div> - <pre><code><div> - </code></pre> - static: |2- - <div> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="3:5-3:9" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div></span></code></pre> - <copy-code></copy-code> - </div> - </div> -04_06_00__leaf_blocks__html_blocks__037: - canonical: | - <p>Foo</p> - <div> - bar - </div> - static: |- - <p data-sourcepos="1:1-1:3" dir="auto">Foo</p> - <div> - bar - </div> -04_06_00__leaf_blocks__html_blocks__038: - canonical: | - <div> - bar - </div> - *foo* - static: |- - <div> - bar - </div> - *foo* -04_06_00__leaf_blocks__html_blocks__039: - canonical: | - <p>Foo - <a href="bar"> - baz</p> - static: |- - <p data-sourcepos="1:1-3:3" dir="auto">Foo - <a href="bar"> - baz</a></p> -04_06_00__leaf_blocks__html_blocks__040: - canonical: | - <div> - <p><em>Emphasized</em> text.</p> - </div> - static: |- - <div> - <p data-sourcepos="3:1-3:18"><em data-sourcepos="3:1-3:12">Emphasized</em> text.</p> - </div> -04_06_00__leaf_blocks__html_blocks__041: - canonical: | - <div> - *Emphasized* text. - </div> - static: |- - <div> - *Emphasized* text. - </div> -04_06_00__leaf_blocks__html_blocks__042: - canonical: | - <table> - <tr> - <td> - Hi - </td> - </tr> - </table> - static: |- - <table dir="auto"> - <tr> - <td> - Hi - </td> - </tr> - </table> -04_06_00__leaf_blocks__html_blocks__043: - canonical: | - <table> - <tr> - <pre><code><td> - Hi - </td> - </code></pre> - </tr> - </table> - static: |- - <table dir="auto"> - <tr> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="5:5-8:0" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><td></span> - <span id="LC2" class="line" lang="plaintext"> Hi</span> - <span id="LC3" class="line" lang="plaintext"></td></span></code></pre> - <copy-code></copy-code> - </div> - </tr> - </table> -04_07_00__leaf_blocks__link_reference_definitions__001: - canonical: | - <p><a href="/url" title="title">foo</a></p> - static: |- - <p data-sourcepos="3:1-3:5" dir="auto"><a data-sourcepos="3:1-3:5" href="/url" title="title">foo</a></p> -04_07_00__leaf_blocks__link_reference_definitions__002: - canonical: | - <p><a href="/url" title="the title">foo</a></p> - static: |- - <p data-sourcepos="5:1-5:5" dir="auto"><a data-sourcepos="5:1-5:5" href="/url" title="the title">foo</a></p> -04_07_00__leaf_blocks__link_reference_definitions__003: - canonical: | - <p><a href="my_(url)" title="title (with parens)">Foo*bar]</a></p> - static: |- - <p data-sourcepos="3:1-3:11" dir="auto"><a data-sourcepos="3:1-3:11" href="my_(url)" title="title (with parens)">Foo*bar]</a></p> -04_07_00__leaf_blocks__link_reference_definitions__004: - canonical: | - <p><a href="my%20url" title="title">Foo bar</a></p> - static: |- - <p data-sourcepos="5:1-5:9" dir="auto"><a data-sourcepos="5:1-5:9" href="my%20url" title="title">Foo bar</a></p> -04_07_00__leaf_blocks__link_reference_definitions__005: - canonical: | - <p><a href="/url" title=" - title - line1 - line2 - ">foo</a></p> - static: |- - <p data-sourcepos="7:1-7:5" dir="auto"><a data-sourcepos="7:1-7:5" href="/url" title=" - title - line1 - line2 - ">foo</a></p> -04_07_00__leaf_blocks__link_reference_definitions__006: - canonical: | - <p>[foo]: /url 'title</p> - <p>with blank line'</p> - <p>[foo]</p> - static: |- - <p data-sourcepos="1:1-1:18" dir="auto">[foo]: /url 'title</p> - <p data-sourcepos="3:1-3:16" dir="auto">with blank line'</p> - <p data-sourcepos="5:1-5:5" dir="auto">[foo]</p> -04_07_00__leaf_blocks__link_reference_definitions__007: - canonical: | - <p><a href="/url">foo</a></p> - static: |- - <p data-sourcepos="4:1-4:5" dir="auto"><a data-sourcepos="4:1-4:5" href="/url">foo</a></p> -04_07_00__leaf_blocks__link_reference_definitions__008: - canonical: | - <p>[foo]:</p> - <p>[foo]</p> - static: |- - <p data-sourcepos="1:1-1:6" dir="auto">[foo]:</p> - <p data-sourcepos="3:1-3:5" dir="auto">[foo]</p> -04_07_00__leaf_blocks__link_reference_definitions__009: - canonical: | - <p><a href="">foo</a></p> - static: |- - <p data-sourcepos="3:1-3:5" dir="auto"><a data-sourcepos="3:1-3:5" href="">foo</a></p> -04_07_00__leaf_blocks__link_reference_definitions__010: - canonical: | - <p>[foo]: <bar>(baz)</p> - <p>[foo]</p> - static: |- - <p data-sourcepos="1:1-1:17" dir="auto">[foo]: (baz)</p> - <p data-sourcepos="3:1-3:5" dir="auto">[foo]</p> -04_07_00__leaf_blocks__link_reference_definitions__011: - canonical: | - <p><a href="/url%5Cbar*baz" title="foo"bar\baz">foo</a></p> - static: |- - <p data-sourcepos="3:1-3:5" dir="auto"><a data-sourcepos="3:1-3:5" href="/url%5Cbar*baz" title='foo"bar\baz'>foo</a></p> -04_07_00__leaf_blocks__link_reference_definitions__012: - canonical: | - <p><a href="url">foo</a></p> - static: |- - <p data-sourcepos="1:1-1:5" dir="auto"><a data-sourcepos="1:1-1:5" href="url">foo</a></p> -04_07_00__leaf_blocks__link_reference_definitions__013: - canonical: | - <p><a href="first">foo</a></p> - static: |- - <p data-sourcepos="1:1-1:5" dir="auto"><a data-sourcepos="1:1-1:5" href="first">foo</a></p> -04_07_00__leaf_blocks__link_reference_definitions__014: - canonical: | - <p><a href="/url">Foo</a></p> - static: |- - <p data-sourcepos="3:1-3:5" dir="auto"><a data-sourcepos="3:1-3:5" href="/url">Foo</a></p> -04_07_00__leaf_blocks__link_reference_definitions__015: - canonical: | - <p><a href="/%CF%86%CE%BF%CF%85">αγω</a></p> - static: |- - <p data-sourcepos="3:1-3:8" dir="auto"><a data-sourcepos="3:1-3:8" href="/%CF%86%CE%BF%CF%85">αγω</a></p> -04_07_00__leaf_blocks__link_reference_definitions__016: - canonical: "" - static: "" -04_07_00__leaf_blocks__link_reference_definitions__017: - canonical: | - <p>bar</p> - static: |- - <p data-sourcepos="1:1-4:3" dir="auto">bar</p> -04_07_00__leaf_blocks__link_reference_definitions__018: - canonical: | - <p>[foo]: /url "title" ok</p> - static: |- - <p data-sourcepos="1:1-1:22" dir="auto">[foo]: /url "title" ok</p> -04_07_00__leaf_blocks__link_reference_definitions__019: - canonical: | - <p>"title" ok</p> - static: |- - <p data-sourcepos="1:1-2:10" dir="auto">"title" ok</p> -04_07_00__leaf_blocks__link_reference_definitions__020: - canonical: | - <pre><code>[foo]: /url "title" - </code></pre> - <p>[foo]</p> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:5-2:0" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url "title"</span></code></pre> - <copy-code></copy-code> - </div> - <p data-sourcepos="3:1-3:5" dir="auto">[foo]</p> -04_07_00__leaf_blocks__link_reference_definitions__021: - canonical: | - <pre><code>[foo]: /url - </code></pre> - <p>[foo]</p> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-3:3" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo]: /url</span></code></pre> - <copy-code></copy-code> - </div> - <p data-sourcepos="5:1-5:5" dir="auto">[foo]</p> -04_07_00__leaf_blocks__link_reference_definitions__022: - canonical: | - <p>Foo - [bar]: /baz</p> - <p>[bar]</p> - static: |- - <p data-sourcepos="1:1-2:11" dir="auto">Foo - [bar]: /baz</p> - <p data-sourcepos="4:1-4:5" dir="auto">[bar]</p> -04_07_00__leaf_blocks__link_reference_definitions__023: - canonical: | - <h1><a href="/url">Foo</a></h1> - <blockquote> - <p>bar</p> - </blockquote> - static: |- - <h1 data-sourcepos="1:1-1:7" dir="auto"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a><a data-sourcepos="1:3-1:7" href="/url">Foo</a> - </h1> - <blockquote data-sourcepos="3:1-3:5" dir="auto"> - <p data-sourcepos="3:3-3:5">bar</p> - </blockquote> -04_07_00__leaf_blocks__link_reference_definitions__024: - canonical: | - <h1>bar</h1> - <p><a href="/url">foo</a></p> - static: |- - <h1 data-sourcepos="1:1-3:3" dir="auto"> - <a href="#bar" aria-hidden="true" class="anchor" id="user-content-bar"></a>bar</h1> - <p data-sourcepos="4:1-4:5" dir="auto"><a data-sourcepos="4:1-4:5" href="/url">foo</a></p> -04_07_00__leaf_blocks__link_reference_definitions__025: - canonical: | - <p>=== - <a href="/url">foo</a></p> - static: |- - <p data-sourcepos="1:1-3:5" dir="auto">=== - <a data-sourcepos="2:1-2:5" href="/url">foo</a></p> -04_07_00__leaf_blocks__link_reference_definitions__026: - canonical: | - <p><a href="/foo-url" title="foo">foo</a>, - <a href="/bar-url" title="bar">bar</a>, - <a href="/baz-url">baz</a></p> - static: |- - <p data-sourcepos="6:1-8:5" dir="auto"><a data-sourcepos="6:1-6:5" href="/foo-url" title="foo">foo</a>, - <a data-sourcepos="7:1-7:5" href="/bar-url" title="bar">bar</a>, - <a data-sourcepos="8:1-8:5" href="/baz-url">baz</a></p> -04_07_00__leaf_blocks__link_reference_definitions__027: - canonical: | - <p><a href="/url">foo</a></p> - <blockquote> - </blockquote> - static: |- - <p data-sourcepos="1:1-1:5" dir="auto"><a data-sourcepos="1:1-1:5" href="/url">foo</a></p> - <blockquote data-sourcepos="3:1-3:13" dir="auto"> - </blockquote> -04_07_00__leaf_blocks__link_reference_definitions__028: - canonical: "" - static: "" -04_08_00__leaf_blocks__paragraphs__001: - canonical: | - <p>aaa</p> - <p>bbb</p> - static: |- - <p data-sourcepos="1:1-1:3" dir="auto">aaa</p> - <p data-sourcepos="3:1-3:3" dir="auto">bbb</p> -04_08_00__leaf_blocks__paragraphs__002: - canonical: | - <p>aaa - bbb</p> - <p>ccc - ddd</p> - static: |- - <p data-sourcepos="1:1-2:3" dir="auto">aaa - bbb</p> - <p data-sourcepos="4:1-5:3" dir="auto">ccc - ddd</p> -04_08_00__leaf_blocks__paragraphs__003: - canonical: | - <p>aaa</p> - <p>bbb</p> - static: |- - <p data-sourcepos="1:1-1:3" dir="auto">aaa</p> - <p data-sourcepos="4:1-4:3" dir="auto">bbb</p> -04_08_00__leaf_blocks__paragraphs__004: - canonical: | - <p>aaa - bbb</p> - static: |- - <p data-sourcepos="1:3-2:4" dir="auto">aaa - bbb</p> -04_08_00__leaf_blocks__paragraphs__005: - canonical: | - <p>aaa - bbb - ccc</p> - static: |- - <p data-sourcepos="1:1-3:42" dir="auto">aaa - bbb - ccc</p> -04_08_00__leaf_blocks__paragraphs__006: - canonical: | - <p>aaa - bbb</p> - static: |- - <p data-sourcepos="1:4-2:3" dir="auto">aaa - bbb</p> -04_08_00__leaf_blocks__paragraphs__007: - canonical: | - <pre><code>aaa - </code></pre> - <p>bbb</p> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:5-1:7" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">aaa</span></code></pre> - <copy-code></copy-code> - </div> - <p data-sourcepos="2:1-2:3" dir="auto">bbb</p> -04_08_00__leaf_blocks__paragraphs__008: - canonical: | - <p>aaa<br /> - bbb</p> - static: |- - <p data-sourcepos="1:1-2:8" dir="auto">aaa<br data-sourcepos="1:9-1:9"> - bbb</p> -04_09_00__leaf_blocks__blank_lines__001: - canonical: | - <p>aaa</p> - <h1>aaa</h1> - static: |- - <p data-sourcepos="3:1-3:3" dir="auto">aaa</p> - <h1 data-sourcepos="6:1-6:5" dir="auto"> - <a href="#aaa" aria-hidden="true" class="anchor" id="user-content-aaa"></a>aaa</h1> -04_10_00__leaf_blocks__tables_extension__001: - canonical: | - <table> - <thead> - <tr> - <th>foo</th> - <th>bar</th> - </tr> - </thead> - <tbody> - <tr> - <td>baz</td> - <td>bim</td> - </tr> - </tbody> - </table> - static: |- - <table data-sourcepos="1:1-3:13" dir="auto"> - <thead> - <tr data-sourcepos="1:1-1:13"> - <th data-sourcepos="1:2-1:6">foo</th> - <th data-sourcepos="1:8-1:12">bar</th> - </tr> - </thead> - <tbody> - <tr data-sourcepos="3:1-3:13"> - <td data-sourcepos="3:2-3:6">baz</td> - <td data-sourcepos="3:8-3:12">bim</td> - </tr> - </tbody> - </table> -04_10_00__leaf_blocks__tables_extension__002: - canonical: | - <table> - <thead> - <tr> - <th align="center">abc</th> - <th align="right">defghi</th> - </tr> - </thead> - <tbody> - <tr> - <td align="center">bar</td> - <td align="right">baz</td> - </tr> - </tbody> - </table> - static: |- - <table data-sourcepos="1:1-3:9" dir="auto"> - <thead> - <tr data-sourcepos="1:1-1:16"> - <th data-sourcepos="1:2-1:6" align="center">abc</th> - <th data-sourcepos="1:8-1:15" align="right">defghi</th> - </tr> - </thead> - <tbody> - <tr data-sourcepos="3:1-3:9"> - <td data-sourcepos="3:1-3:4" align="center">bar</td> - <td data-sourcepos="3:6-3:9" align="right">baz</td> - </tr> - </tbody> - </table> -04_10_00__leaf_blocks__tables_extension__003: - canonical: | - <table> - <thead> - <tr> - <th>f|oo</th> - </tr> - </thead> - <tbody> - <tr> - <td>b <code>|</code> az</td> - </tr> - <tr> - <td>b <strong>|</strong> im</td> - </tr> - </tbody> - </table> - static: |- - <table data-sourcepos="1:1-4:15" dir="auto"> - <thead> - <tr data-sourcepos="1:1-1:10"> - <th data-sourcepos="1:2-1:9">f|oo</th> - </tr> - </thead> - <tbody> - <tr data-sourcepos="3:1-3:13"> - <td data-sourcepos="3:2-3:12">b <code data-sourcepos="3:6-3:6">|</code> az</td> - </tr> - <tr data-sourcepos="4:1-4:15"> - <td data-sourcepos="4:2-4:14">b <strong data-sourcepos="4:5-4:9">|</strong> im</td> - </tr> - </tbody> - </table> -04_10_00__leaf_blocks__tables_extension__004: - canonical: | - <table> - <thead> - <tr> - <th>abc</th> - <th>def</th> - </tr> - </thead> - <tbody> - <tr> - <td>bar</td> - <td>baz</td> - </tr> - </tbody> - </table> - <blockquote> - <p>bar</p> - </blockquote> - static: |- - <table data-sourcepos="1:1-3:13" dir="auto"> - <thead> - <tr data-sourcepos="1:1-1:13"> - <th data-sourcepos="1:2-1:6">abc</th> - <th data-sourcepos="1:8-1:12">def</th> - </tr> - </thead> - <tbody> - <tr data-sourcepos="3:1-3:13"> - <td data-sourcepos="3:2-3:6">bar</td> - <td data-sourcepos="3:8-3:12">baz</td> - </tr> - </tbody> - </table> - <blockquote data-sourcepos="4:1-4:5" dir="auto"> - <p data-sourcepos="4:3-4:5">bar</p> - </blockquote> -04_10_00__leaf_blocks__tables_extension__005: - canonical: | - <table> - <thead> - <tr> - <th>abc</th> - <th>def</th> - </tr> - </thead> - <tbody> - <tr> - <td>bar</td> - <td>baz</td> - </tr> - <tr> - <td>bar</td> - <td></td> - </tr> - </tbody> - </table> - <p>bar</p> - static: |- - <table data-sourcepos="1:1-4:3" dir="auto"> - <thead> - <tr data-sourcepos="1:1-1:13"> - <th data-sourcepos="1:2-1:6">abc</th> - <th data-sourcepos="1:8-1:12">def</th> - </tr> - </thead> - <tbody> - <tr data-sourcepos="3:1-3:13"> - <td data-sourcepos="3:2-3:6">bar</td> - <td data-sourcepos="3:8-3:12">baz</td> - </tr> - <tr data-sourcepos="4:1-4:3"> - <td data-sourcepos="4:1-4:3">bar</td> - <td data-sourcepos="4:3-4:0"></td> - </tr> - </tbody> - </table> - <p data-sourcepos="6:1-6:3" dir="auto">bar</p> -04_10_00__leaf_blocks__tables_extension__006: - canonical: | - <p>| abc | def | - | --- | - | bar |</p> - static: |- - <p data-sourcepos="1:1-3:7" dir="auto">| abc | def | - | --- | - | bar |</p> -04_10_00__leaf_blocks__tables_extension__007: - canonical: | - <table> - <thead> - <tr> - <th>abc</th> - <th>def</th> - </tr> - </thead> - <tbody> - <tr> - <td>bar</td> - <td></td> - </tr> - <tr> - <td>bar</td> - <td>baz</td> - </tr> - </tbody> - </table> - static: |- - <table data-sourcepos="1:1-4:19" dir="auto"> - <thead> - <tr data-sourcepos="1:1-1:13"> - <th data-sourcepos="1:2-1:6">abc</th> - <th data-sourcepos="1:8-1:12">def</th> - </tr> - </thead> - <tbody> - <tr data-sourcepos="3:1-3:7"> - <td data-sourcepos="3:2-3:6">bar</td> - <td data-sourcepos="3:6-3:0"></td> - </tr> - <tr data-sourcepos="4:1-4:19"> - <td data-sourcepos="4:2-4:6">bar</td> - <td data-sourcepos="4:8-4:12">baz</td> - </tr> - </tbody> - </table> -04_10_00__leaf_blocks__tables_extension__008: - canonical: | - <table> - <thead> - <tr> - <th>abc</th> - <th>def</th> - </tr> - </thead> - </table> - static: |- - <table data-sourcepos="1:1-2:13" dir="auto"> - <thead> - <tr data-sourcepos="1:1-1:13"> - <th data-sourcepos="1:2-1:6">abc</th> - <th data-sourcepos="1:8-1:12">def</th> - </tr> - </thead> - </table> -05_01_00__container_blocks__block_quotes__001: - canonical: | - <blockquote> - <h1>Foo</h1> - <p>bar - baz</p> - </blockquote> - static: |- - <blockquote data-sourcepos="1:1-3:5" dir="auto"> - <h1 data-sourcepos="1:3-1:7"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>Foo</h1> - <p data-sourcepos="2:3-3:5">bar - baz</p> - </blockquote> -05_01_00__container_blocks__block_quotes__002: - canonical: | - <blockquote> - <h1>Foo</h1> - <p>bar - baz</p> - </blockquote> - static: |- - <blockquote data-sourcepos="1:1-3:5" dir="auto"> - <h1 data-sourcepos="1:2-1:6"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>Foo</h1> - <p data-sourcepos="2:2-3:5">bar - baz</p> - </blockquote> -05_01_00__container_blocks__block_quotes__003: - canonical: | - <blockquote> - <h1>Foo</h1> - <p>bar - baz</p> - </blockquote> - static: |- - <blockquote data-sourcepos="1:4-3:6" dir="auto"> - <h1 data-sourcepos="1:6-1:10"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>Foo</h1> - <p data-sourcepos="2:6-3:6">bar - baz</p> - </blockquote> -05_01_00__container_blocks__block_quotes__004: - canonical: | - <pre><code>> # Foo - > bar - > baz - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:5-3:9" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> - <copy-code></copy-code> - </div> -05_01_00__container_blocks__block_quotes__005: - canonical: | - <blockquote> - <h1>Foo</h1> - <p>bar - baz</p> - </blockquote> - static: |- - <blockquote data-sourcepos="1:1-3:3" dir="auto"> - <h1 data-sourcepos="1:3-1:7"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>Foo</h1> - <p data-sourcepos="2:3-3:3">bar - baz</p> - </blockquote> -05_01_00__container_blocks__block_quotes__006: - canonical: | - <blockquote> - <p>bar - baz - foo</p> - </blockquote> - static: |- - <blockquote data-sourcepos="1:1-3:5" dir="auto"> - <p data-sourcepos="1:3-3:5">bar - baz - foo</p> - </blockquote> -05_01_00__container_blocks__block_quotes__007: - canonical: | - <blockquote> - <p>foo</p> - </blockquote> - <hr /> - static: |- - <blockquote data-sourcepos="1:1-1:5" dir="auto"> - <p data-sourcepos="1:3-1:5">foo</p> - </blockquote> - <hr data-sourcepos="2:1-2:3"> -05_01_00__container_blocks__block_quotes__008: - canonical: | - <blockquote> - <ul> - <li>foo</li> - </ul> - </blockquote> - <ul> - <li>bar</li> - </ul> - static: |- - <blockquote data-sourcepos="1:1-1:7" dir="auto"> - <ul data-sourcepos="1:3-1:7"> - <li data-sourcepos="1:3-1:7">foo</li> - </ul> - </blockquote> - <ul data-sourcepos="2:1-2:5" dir="auto"> - <li data-sourcepos="2:1-2:5">bar</li> - </ul> -05_01_00__container_blocks__block_quotes__009: - canonical: | - <blockquote> - <pre><code>foo - </code></pre> - </blockquote> - <pre><code>bar - </code></pre> - static: |- - <blockquote data-sourcepos="1:1-1:9" dir="auto"> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:7-1:9" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span></code></pre> - <copy-code></copy-code> - </div> - </blockquote> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="2:5-2:7" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">bar</span></code></pre> - <copy-code></copy-code> - </div> -05_01_00__container_blocks__block_quotes__010: - canonical: | - <blockquote> - <pre><code></code></pre> - </blockquote> - <p>foo</p> - <pre><code></code></pre> - static: |- - <blockquote data-sourcepos="1:1-1:5" dir="auto"> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:3-2:3" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code></code></pre> - <copy-code></copy-code> - </div> - </blockquote> - <p data-sourcepos="2:1-2:3" dir="auto">foo</p> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="3:1-3:3" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code></code></pre> - <copy-code></copy-code> - </div> -05_01_00__container_blocks__block_quotes__011: - canonical: | - <blockquote> - <p>foo - - bar</p> - </blockquote> - static: |- - <blockquote data-sourcepos="1:1-2:9" dir="auto"> - <p data-sourcepos="1:3-2:9">foo - - bar</p> - </blockquote> -05_01_00__container_blocks__block_quotes__012: - canonical: | - <blockquote> - </blockquote> - static: |- - <blockquote data-sourcepos="1:1-1:1" dir="auto"> - </blockquote> -05_01_00__container_blocks__block_quotes__013: - canonical: | - <blockquote> - </blockquote> - static: |- - <blockquote data-sourcepos="1:1-3:2" dir="auto"> - </blockquote> -05_01_00__container_blocks__block_quotes__014: - canonical: | - <blockquote> - <p>foo</p> - </blockquote> - static: |- - <blockquote data-sourcepos="1:1-3:3" dir="auto"> - <p data-sourcepos="2:3-2:5">foo</p> - </blockquote> -05_01_00__container_blocks__block_quotes__015: - canonical: | - <blockquote> - <p>foo</p> - </blockquote> - <blockquote> - <p>bar</p> - </blockquote> - static: |- - <blockquote data-sourcepos="1:1-1:5" dir="auto"> - <p data-sourcepos="1:3-1:5">foo</p> - </blockquote> - <blockquote data-sourcepos="3:1-3:5" dir="auto"> - <p data-sourcepos="3:3-3:5">bar</p> - </blockquote> -05_01_00__container_blocks__block_quotes__016: - canonical: | - <blockquote> - <p>foo - bar</p> - </blockquote> - static: |- - <blockquote data-sourcepos="1:1-2:5" dir="auto"> - <p data-sourcepos="1:3-2:5">foo - bar</p> - </blockquote> -05_01_00__container_blocks__block_quotes__017: - canonical: | - <blockquote> - <p>foo</p> - <p>bar</p> - </blockquote> - static: |- - <blockquote data-sourcepos="1:1-3:5" dir="auto"> - <p data-sourcepos="1:3-1:5">foo</p> - <p data-sourcepos="3:3-3:5">bar</p> - </blockquote> -05_01_00__container_blocks__block_quotes__018: - canonical: | - <p>foo</p> - <blockquote> - <p>bar</p> - </blockquote> - static: |- - <p data-sourcepos="1:1-1:3" dir="auto">foo</p> - <blockquote data-sourcepos="2:1-2:5" dir="auto"> - <p data-sourcepos="2:3-2:5">bar</p> - </blockquote> -05_01_00__container_blocks__block_quotes__019: - canonical: | - <blockquote> - <p>aaa</p> - </blockquote> - <hr /> - <blockquote> - <p>bbb</p> - </blockquote> - static: |- - <blockquote data-sourcepos="1:1-1:5" dir="auto"> - <p data-sourcepos="1:3-1:5">aaa</p> - </blockquote> - <hr data-sourcepos="2:1-2:3"> - <blockquote data-sourcepos="3:1-3:5" dir="auto"> - <p data-sourcepos="3:3-3:5">bbb</p> - </blockquote> -05_01_00__container_blocks__block_quotes__020: - canonical: | - <blockquote> - <p>bar - baz</p> - </blockquote> - static: |- - <blockquote data-sourcepos="1:1-2:3" dir="auto"> - <p data-sourcepos="1:3-2:3">bar - baz</p> - </blockquote> -05_01_00__container_blocks__block_quotes__021: - canonical: | - <blockquote> - <p>bar</p> - </blockquote> - <p>baz</p> - static: |- - <blockquote data-sourcepos="1:1-1:5" dir="auto"> - <p data-sourcepos="1:3-1:5">bar</p> - </blockquote> - <p data-sourcepos="3:1-3:3" dir="auto">baz</p> -05_01_00__container_blocks__block_quotes__022: - canonical: | - <blockquote> - <p>bar</p> - </blockquote> - <p>baz</p> - static: |- - <blockquote data-sourcepos="1:1-2:1" dir="auto"> - <p data-sourcepos="1:3-1:5">bar</p> - </blockquote> - <p data-sourcepos="3:1-3:3" dir="auto">baz</p> -05_01_00__container_blocks__block_quotes__023: - canonical: | - <blockquote> - <blockquote> - <blockquote> - <p>foo - bar</p> - </blockquote> - </blockquote> - </blockquote> - static: |- - <blockquote data-sourcepos="1:1-2:3" dir="auto"> - <blockquote data-sourcepos="1:3-2:3"> - <blockquote data-sourcepos="1:5-2:3"> - <p data-sourcepos="1:7-2:3">foo - bar</p> - </blockquote> - </blockquote> - </blockquote> -05_01_00__container_blocks__block_quotes__024: - canonical: | - <blockquote> - <blockquote> - <blockquote> - <p>foo - bar - baz</p> - </blockquote> - </blockquote> - </blockquote> - static: |- - <blockquote data-sourcepos="1:1-3:5" dir="auto"> - <blockquote data-sourcepos="1:2-3:5"> - <blockquote data-sourcepos="1:3-3:5"> - <p data-sourcepos="1:5-3:5">foo - bar - baz</p> - </blockquote> - </blockquote> - </blockquote> -05_01_00__container_blocks__block_quotes__025: - canonical: | - <blockquote> - <pre><code>code - </code></pre> - </blockquote> - <blockquote> - <p>not code</p> - </blockquote> - static: |- - <blockquote data-sourcepos="1:1-1:10" dir="auto"> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:7-1:10" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">code</span></code></pre> - <copy-code></copy-code> - </div> - </blockquote> - <blockquote data-sourcepos="3:1-3:13" dir="auto"> - <p data-sourcepos="3:6-3:13">not code</p> - </blockquote> -05_02_00__container_blocks__list_items__001: - canonical: | - <p>A paragraph - with two lines.</p> - <pre><code>indented code - </code></pre> - <blockquote> - <p>A block quote.</p> - </blockquote> - static: |- - <p data-sourcepos="1:1-2:15" dir="auto">A paragraph - with two lines.</p> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="4:5-5:0" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">indented code</span></code></pre> - <copy-code></copy-code> - </div> - <blockquote data-sourcepos="6:1-6:16" dir="auto"> - <p data-sourcepos="6:3-6:16">A block quote.</p> - </blockquote> -05_02_00__container_blocks__list_items__002: - canonical: | - <ol> - <li> - <p>A paragraph - with two lines.</p> - <pre><code>indented code - </code></pre> - <blockquote> - <p>A block quote.</p> - </blockquote> - </li> - </ol> - static: |- - <ol data-sourcepos="1:1-6:20" dir="auto"> - <li data-sourcepos="1:1-6:20"> - <p data-sourcepos="1:5-2:19">A paragraph - with two lines.</p> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="4:9-5:0" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">indented code</span></code></pre> - <copy-code></copy-code> - </div> - <blockquote data-sourcepos="6:5-6:20"> - <p data-sourcepos="6:7-6:20">A block quote.</p> - </blockquote> - </li> - </ol> -05_02_00__container_blocks__list_items__003: - canonical: | - <ul> - <li>one</li> - </ul> - <p>two</p> - static: |- - <ul data-sourcepos="1:1-2:0" dir="auto"> - <li data-sourcepos="1:1-2:0">one</li> - </ul> - <p data-sourcepos="3:2-3:4" dir="auto">two</p> -05_02_00__container_blocks__list_items__004: - canonical: | - <ul> - <li> - <p>one</p> - <p>two</p> - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-3:5" dir="auto"> - <li data-sourcepos="1:1-3:5"> - <p data-sourcepos="1:3-1:5">one</p> - <p data-sourcepos="3:3-3:5">two</p> - </li> - </ul> -05_02_00__container_blocks__list_items__005: - canonical: | - <ul> - <li>one</li> - </ul> - <pre><code> two - </code></pre> - static: |- - <ul data-sourcepos="1:2-2:0" dir="auto"> - <li data-sourcepos="1:2-2:0">one</li> - </ul> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="3:5-3:8" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> two</span></code></pre> - <copy-code></copy-code> - </div> -05_02_00__container_blocks__list_items__006: - canonical: | - <ul> - <li> - <p>one</p> - <p>two</p> - </li> - </ul> - static: |- - <ul data-sourcepos="1:2-3:9" dir="auto"> - <li data-sourcepos="1:2-3:9"> - <p data-sourcepos="1:7-1:9">one</p> - <p data-sourcepos="3:7-3:9">two</p> - </li> - </ul> -05_02_00__container_blocks__list_items__007: - canonical: | - <blockquote> - <blockquote> - <ol> - <li> - <p>one</p> - <p>two</p> - </li> - </ol> - </blockquote> - </blockquote> - static: |- - <blockquote data-sourcepos="1:4-3:10" dir="auto"> - <blockquote data-sourcepos="1:6-3:10"> - <ol data-sourcepos="1:8-3:10"> - <li data-sourcepos="1:8-3:10"> - <p data-sourcepos="1:12-1:14">one</p> - <p data-sourcepos="3:8-3:10">two</p> - </li> - </ol> - </blockquote> - </blockquote> -05_02_00__container_blocks__list_items__008: - canonical: | - <blockquote> - <blockquote> - <ul> - <li>one</li> - </ul> - <p>two</p> - </blockquote> - </blockquote> - static: |- - <blockquote data-sourcepos="1:1-3:10" dir="auto"> - <blockquote data-sourcepos="1:2-3:10"> - <ul data-sourcepos="1:3-2:2"> - <li data-sourcepos="1:3-2:2">one</li> - </ul> - <p data-sourcepos="3:8-3:10">two</p> - </blockquote> - </blockquote> -05_02_00__container_blocks__list_items__009: - canonical: | - <p>-one</p> - <p>2.two</p> - static: |- - <p data-sourcepos="1:1-1:4" dir="auto">-one</p> - <p data-sourcepos="3:1-3:5" dir="auto">2.two</p> -05_02_00__container_blocks__list_items__010: - canonical: | - <ul> - <li> - <p>foo</p> - <p>bar</p> - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-4:5" dir="auto"> - <li data-sourcepos="1:1-4:5"> - <p data-sourcepos="1:3-1:5">foo</p> - <p data-sourcepos="4:3-4:5">bar</p> - </li> - </ul> -05_02_00__container_blocks__list_items__011: - canonical: | - <ol> - <li> - <p>foo</p> - <pre><code>bar - </code></pre> - <p>baz</p> - <blockquote> - <p>bam</p> - </blockquote> - </li> - </ol> - static: |- - <ol data-sourcepos="1:1-9:9" dir="auto"> - <li data-sourcepos="1:1-9:9"> - <p data-sourcepos="1:5-1:7">foo</p> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="3:5-5:7" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">bar</span></code></pre> - <copy-code></copy-code> - </div> - <p data-sourcepos="7:5-7:7">baz</p> - <blockquote data-sourcepos="9:5-9:9"> - <p data-sourcepos="9:7-9:9">bam</p> - </blockquote> - </li> - </ol> -05_02_00__container_blocks__list_items__012: - canonical: | - <ul> - <li> - <p>Foo</p> - <pre><code>bar - - - baz - </code></pre> - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-6:9" dir="auto"> - <li data-sourcepos="1:1-6:9"> - <p data-sourcepos="1:3-1:5">Foo</p> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="3:7-6:9" class="code highlight js-syntax-highlight language-plaintext" 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"></span> - <span id="LC4" class="line" lang="plaintext">baz</span></code></pre> - <copy-code></copy-code> - </div> - </li> - </ul> -05_02_00__container_blocks__list_items__013: - canonical: | - <ol start="123456789"> - <li>ok</li> - </ol> - static: |- - <ol data-sourcepos="1:1-1:13" start="123456789" dir="auto"> - <li data-sourcepos="1:1-1:13">ok</li> - </ol> -05_02_00__container_blocks__list_items__014: - canonical: | - <p>1234567890. not ok</p> - static: |- - <p data-sourcepos="1:1-1:18" dir="auto">1234567890. not ok</p> -05_02_00__container_blocks__list_items__015: - canonical: | - <ol start="0"> - <li>ok</li> - </ol> - static: |- - <ol data-sourcepos="1:1-1:5" start="0" dir="auto"> - <li data-sourcepos="1:1-1:5">ok</li> - </ol> -05_02_00__container_blocks__list_items__016: - canonical: | - <ol start="3"> - <li>ok</li> - </ol> - static: |- - <ol data-sourcepos="1:1-1:7" start="3" dir="auto"> - <li data-sourcepos="1:1-1:7">ok</li> - </ol> -05_02_00__container_blocks__list_items__017: - canonical: | - <p>-1. not ok</p> - static: |- - <p data-sourcepos="1:1-1:10" dir="auto">-1. not ok</p> -05_02_00__container_blocks__list_items__018: - canonical: | - <ul> - <li> - <p>foo</p> - <pre><code>bar - </code></pre> - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-3:9" dir="auto"> - <li data-sourcepos="1:1-3:9"> - <p data-sourcepos="1:3-1:5">foo</p> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="3:7-3:9" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">bar</span></code></pre> - <copy-code></copy-code> - </div> - </li> - </ul> -05_02_00__container_blocks__list_items__019: - canonical: | - <ol start="10"> - <li> - <p>foo</p> - <pre><code>bar - </code></pre> - </li> - </ol> - static: |- - <ol data-sourcepos="1:3-3:14" start="10" dir="auto"> - <li data-sourcepos="1:3-3:14"> - <p data-sourcepos="1:8-1:10">foo</p> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="3:12-3:14" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">bar</span></code></pre> - <copy-code></copy-code> - </div> - </li> - </ol> -05_02_00__container_blocks__list_items__020: - canonical: | - <pre><code>indented code - </code></pre> - <p>paragraph</p> - <pre><code>more code - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:5-2:0" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">indented code</span></code></pre> - <copy-code></copy-code> - </div> - <p data-sourcepos="3:1-3:9" dir="auto">paragraph</p> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="5:5-5:13" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">more code</span></code></pre> - <copy-code></copy-code> - </div> -05_02_00__container_blocks__list_items__021: - canonical: | - <ol> - <li> - <pre><code>indented code - </code></pre> - <p>paragraph</p> - <pre><code>more code - </code></pre> - </li> - </ol> - static: |- - <ol data-sourcepos="1:1-5:16" dir="auto"> - <li data-sourcepos="1:1-5:16"> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:8-2:0" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">indented code</span></code></pre> - <copy-code></copy-code> - </div> - <p data-sourcepos="3:4-3:12">paragraph</p> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="5:8-5:16" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">more code</span></code></pre> - <copy-code></copy-code> - </div> - </li> - </ol> -05_02_00__container_blocks__list_items__022: - canonical: | - <ol> - <li> - <pre><code> indented code - </code></pre> - <p>paragraph</p> - <pre><code>more code - </code></pre> - </li> - </ol> - static: |- - <ol data-sourcepos="1:1-5:16" dir="auto"> - <li data-sourcepos="1:1-5:16"> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:8-2:0" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> indented code</span></code></pre> - <copy-code></copy-code> - </div> - <p data-sourcepos="3:4-3:12">paragraph</p> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="5:8-5:16" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">more code</span></code></pre> - <copy-code></copy-code> - </div> - </li> - </ol> -05_02_00__container_blocks__list_items__023: - canonical: | - <p>foo</p> - <p>bar</p> - static: |- - <p data-sourcepos="1:4-1:6" dir="auto">foo</p> - <p data-sourcepos="3:1-3:3" dir="auto">bar</p> -05_02_00__container_blocks__list_items__024: - canonical: | - <ul> - <li>foo</li> - </ul> - <p>bar</p> - static: |- - <ul data-sourcepos="1:1-2:0" dir="auto"> - <li data-sourcepos="1:1-2:0">foo</li> - </ul> - <p data-sourcepos="3:3-3:5" dir="auto">bar</p> -05_02_00__container_blocks__list_items__025: - canonical: | - <ul> - <li> - <p>foo</p> - <p>bar</p> - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-3:6" dir="auto"> - <li data-sourcepos="1:1-3:6"> - <p data-sourcepos="1:4-1:6">foo</p> - <p data-sourcepos="3:4-3:6">bar</p> - </li> - </ul> -05_02_00__container_blocks__list_items__026: - canonical: | - <ul> - <li>foo</li> - <li> - <pre><code>bar - </code></pre> - </li> - <li> - <pre><code>baz - </code></pre> - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-8:9" dir="auto"> - <li data-sourcepos="1:1-2:5">foo</li> - <li data-sourcepos="3:1-6:5"> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="4:3-6:5" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">bar</span></code></pre> - <copy-code></copy-code> - </div> - </li> - <li data-sourcepos="7:1-8:9"> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="8:7-8:9" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">baz</span></code></pre> - <copy-code></copy-code> - </div> - </li> - </ul> -05_02_00__container_blocks__list_items__027: - canonical: | - <ul> - <li>foo</li> - </ul> - static: |- - <ul data-sourcepos="1:1-2:5" dir="auto"> - <li data-sourcepos="1:1-2:5">foo</li> - </ul> -05_02_00__container_blocks__list_items__028: - canonical: | - <ul> - <li></li> - </ul> - <p>foo</p> - static: |- - <ul data-sourcepos="1:1-2:0" dir="auto"> - <li data-sourcepos="1:1-1:1"> - </li> - </ul> - <p data-sourcepos="3:3-3:5" dir="auto">foo</p> -05_02_00__container_blocks__list_items__029: - canonical: | - <ul> - <li>foo</li> - <li></li> - <li>bar</li> - </ul> - static: |- - <ul data-sourcepos="1:1-3:5" dir="auto"> - <li data-sourcepos="1:1-1:5">foo</li> - <li data-sourcepos="2:1-2:1"> - </li> - <li data-sourcepos="3:1-3:5">bar</li> - </ul> -05_02_00__container_blocks__list_items__030: - canonical: | - <ul> - <li>foo</li> - <li></li> - <li>bar</li> - </ul> - static: |- - <ul data-sourcepos="1:1-3:5" dir="auto"> - <li data-sourcepos="1:1-1:5">foo</li> - <li data-sourcepos="2:1-2:4"> - </li> - <li data-sourcepos="3:1-3:5">bar</li> - </ul> -05_02_00__container_blocks__list_items__031: - canonical: | - <ol> - <li>foo</li> - <li></li> - <li>bar</li> - </ol> - static: |- - <ol data-sourcepos="1:1-3:6" dir="auto"> - <li data-sourcepos="1:1-1:6">foo</li> - <li data-sourcepos="2:1-2:2"> - </li> - <li data-sourcepos="3:1-3:6">bar</li> - </ol> -05_02_00__container_blocks__list_items__032: - canonical: | - <ul> - <li></li> - </ul> - static: |- - <ul data-sourcepos="1:1-1:1" dir="auto"> - <li data-sourcepos="1:1-1:1"> - </li> - </ul> -05_02_00__container_blocks__list_items__033: - canonical: | - <p>foo - *</p> - <p>foo - 1.</p> - static: |- - <p data-sourcepos="1:1-2:1" dir="auto">foo - *</p> - <p data-sourcepos="4:1-5:2" dir="auto">foo - 1.</p> -05_02_00__container_blocks__list_items__034: - canonical: | - <ol> - <li> - <p>A paragraph - with two lines.</p> - <pre><code>indented code - </code></pre> - <blockquote> - <p>A block quote.</p> - </blockquote> - </li> - </ol> - static: |- - <ol data-sourcepos="1:2-6:21" dir="auto"> - <li data-sourcepos="1:2-6:21"> - <p data-sourcepos="1:6-2:20">A paragraph - with two lines.</p> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="4:10-5:0" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">indented code</span></code></pre> - <copy-code></copy-code> - </div> - <blockquote data-sourcepos="6:6-6:21"> - <p data-sourcepos="6:8-6:21">A block quote.</p> - </blockquote> - </li> - </ol> -05_02_00__container_blocks__list_items__035: - canonical: | - <ol> - <li> - <p>A paragraph - with two lines.</p> - <pre><code>indented code - </code></pre> - <blockquote> - <p>A block quote.</p> - </blockquote> - </li> - </ol> - static: |- - <ol data-sourcepos="1:3-6:22" dir="auto"> - <li data-sourcepos="1:3-6:22"> - <p data-sourcepos="1:7-2:21">A paragraph - with two lines.</p> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="4:11-5:0" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">indented code</span></code></pre> - <copy-code></copy-code> - </div> - <blockquote data-sourcepos="6:7-6:22"> - <p data-sourcepos="6:9-6:22">A block quote.</p> - </blockquote> - </li> - </ol> -05_02_00__container_blocks__list_items__036: - canonical: | - <ol> - <li> - <p>A paragraph - with two lines.</p> - <pre><code>indented code - </code></pre> - <blockquote> - <p>A block quote.</p> - </blockquote> - </li> - </ol> - static: |- - <ol data-sourcepos="1:4-6:23" dir="auto"> - <li data-sourcepos="1:4-6:23"> - <p data-sourcepos="1:8-2:22">A paragraph - with two lines.</p> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="4:12-5:0" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">indented code</span></code></pre> - <copy-code></copy-code> - </div> - <blockquote data-sourcepos="6:8-6:23"> - <p data-sourcepos="6:10-6:23">A block quote.</p> - </blockquote> - </li> - </ol> -05_02_00__container_blocks__list_items__037: - canonical: | - <pre><code>1. A paragraph - with two lines. - - indented code - - > A block quote. - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:5-6:24" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> - <copy-code></copy-code> - </div> -05_02_00__container_blocks__list_items__038: - canonical: | - <ol> - <li> - <p>A paragraph - with two lines.</p> - <pre><code>indented code - </code></pre> - <blockquote> - <p>A block quote.</p> - </blockquote> - </li> - </ol> - static: |- - <ol data-sourcepos="1:3-6:22" dir="auto"> - <li data-sourcepos="1:3-6:22"> - <p data-sourcepos="1:7-2:15">A paragraph - with two lines.</p> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="4:11-5:0" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">indented code</span></code></pre> - <copy-code></copy-code> - </div> - <blockquote data-sourcepos="6:7-6:22"> - <p data-sourcepos="6:9-6:22">A block quote.</p> - </blockquote> - </li> - </ol> -05_02_00__container_blocks__list_items__039: - canonical: | - <ol> - <li>A paragraph - with two lines.</li> - </ol> - static: |- - <ol data-sourcepos="1:3-2:19" dir="auto"> - <li data-sourcepos="1:3-2:19">A paragraph - with two lines.</li> - </ol> -05_02_00__container_blocks__list_items__040: - canonical: | - <blockquote> - <ol> - <li> - <blockquote> - <p>Blockquote - continued here.</p> - </blockquote> - </li> - </ol> - </blockquote> - static: |- - <blockquote data-sourcepos="1:1-2:15" dir="auto"> - <ol data-sourcepos="1:3-2:15"> - <li data-sourcepos="1:3-2:15"> - <blockquote data-sourcepos="1:6-2:15"> - <p data-sourcepos="1:8-2:15">Blockquote - continued here.</p> - </blockquote> - </li> - </ol> - </blockquote> -05_02_00__container_blocks__list_items__041: - canonical: | - <blockquote> - <ol> - <li> - <blockquote> - <p>Blockquote - continued here.</p> - </blockquote> - </li> - </ol> - </blockquote> - static: |- - <blockquote data-sourcepos="1:1-2:17" dir="auto"> - <ol data-sourcepos="1:3-2:17"> - <li data-sourcepos="1:3-2:17"> - <blockquote data-sourcepos="1:6-2:17"> - <p data-sourcepos="1:8-2:17">Blockquote - continued here.</p> - </blockquote> - </li> - </ol> - </blockquote> -05_02_00__container_blocks__list_items__042: - canonical: | - <ul> - <li>foo - <ul> - <li>bar - <ul> - <li>baz - <ul> - <li>boo</li> - </ul> - </li> - </ul> - </li> - </ul> - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-4:11" dir="auto"> - <li data-sourcepos="1:1-4:11">foo - <ul data-sourcepos="2:3-4:11"> - <li data-sourcepos="2:3-4:11">bar - <ul data-sourcepos="3:5-4:11"> - <li data-sourcepos="3:5-4:11">baz - <ul data-sourcepos="4:7-4:11"> - <li data-sourcepos="4:7-4:11">boo</li> - </ul> - </li> - </ul> - </li> - </ul> - </li> - </ul> -05_02_00__container_blocks__list_items__043: - canonical: | - <ul> - <li>foo</li> - <li>bar</li> - <li>baz</li> - <li>boo</li> - </ul> - static: |- - <ul data-sourcepos="1:1-4:8" dir="auto"> - <li data-sourcepos="1:1-1:5">foo</li> - <li data-sourcepos="2:2-2:6">bar</li> - <li data-sourcepos="3:3-3:7">baz</li> - <li data-sourcepos="4:4-4:8">boo</li> - </ul> -05_02_00__container_blocks__list_items__044: - canonical: | - <ol start="10"> - <li>foo - <ul> - <li>bar</li> - </ul> - </li> - </ol> - static: |- - <ol data-sourcepos="1:1-2:9" start="10" dir="auto"> - <li data-sourcepos="1:1-2:9">foo - <ul data-sourcepos="2:5-2:9"> - <li data-sourcepos="2:5-2:9">bar</li> - </ul> - </li> - </ol> -05_02_00__container_blocks__list_items__045: - canonical: | - <ol start="10"> - <li>foo</li> - </ol> - <ul> - <li>bar</li> - </ul> - static: |- - <ol data-sourcepos="1:1-1:7" start="10" dir="auto"> - <li data-sourcepos="1:1-1:7">foo</li> - </ol> - <ul data-sourcepos="2:4-2:8" dir="auto"> - <li data-sourcepos="2:4-2:8">bar</li> - </ul> -05_02_00__container_blocks__list_items__046: - canonical: | - <ul> - <li> - <ul> - <li>foo</li> - </ul> - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-1:7" dir="auto"> - <li data-sourcepos="1:1-1:7"> - <ul data-sourcepos="1:3-1:7"> - <li data-sourcepos="1:3-1:7">foo</li> - </ul> - </li> - </ul> -05_02_00__container_blocks__list_items__047: - canonical: | - <ol> - <li> - <ul> - <li> - <ol start="2"> - <li>foo</li> - </ol> - </li> - </ul> - </li> - </ol> - static: |- - <ol data-sourcepos="1:1-1:11" dir="auto"> - <li data-sourcepos="1:1-1:11"> - <ul data-sourcepos="1:4-1:11"> - <li data-sourcepos="1:4-1:11"> - <ol data-sourcepos="1:6-1:11" start="2"> - <li data-sourcepos="1:6-1:11">foo</li> - </ol> - </li> - </ul> - </li> - </ol> -05_02_00__container_blocks__list_items__048: - canonical: | - <ul> - <li> - <h1>Foo</h1> - </li> - <li> - <h2>Bar</h2> - baz</li> - </ul> - static: |- - <ul data-sourcepos="1:1-4:5" dir="auto"> - <li data-sourcepos="1:1-1:7"> - <h1 data-sourcepos="1:3-1:7"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>Foo</h1> - </li> - <li data-sourcepos="2:1-4:5"> - <h2 data-sourcepos="2:3-3:5"> - <a href="#bar" aria-hidden="true" class="anchor" id="user-content-bar"></a>Bar</h2> - baz</li> - </ul> -05_04_00__container_blocks__lists__001: - canonical: | - <ul> - <li>foo</li> - <li>bar</li> - </ul> - <ul> - <li>baz</li> - </ul> - static: |- - <ul data-sourcepos="1:1-2:5" dir="auto"> - <li data-sourcepos="1:1-1:5">foo</li> - <li data-sourcepos="2:1-2:5">bar</li> - </ul> - <ul data-sourcepos="3:1-3:5" dir="auto"> - <li data-sourcepos="3:1-3:5">baz</li> - </ul> -05_04_00__container_blocks__lists__002: - canonical: | - <ol> - <li>foo</li> - <li>bar</li> - </ol> - <ol start="3"> - <li>baz</li> - </ol> - static: |- - <ol data-sourcepos="1:1-2:6" dir="auto"> - <li data-sourcepos="1:1-1:6">foo</li> - <li data-sourcepos="2:1-2:6">bar</li> - </ol> - <ol data-sourcepos="3:1-3:6" start="3" dir="auto"> - <li data-sourcepos="3:1-3:6">baz</li> - </ol> -05_04_00__container_blocks__lists__003: - canonical: | - <p>Foo</p> - <ul> - <li>bar</li> - <li>baz</li> - </ul> - static: |- - <p data-sourcepos="1:1-1:3" dir="auto">Foo</p> - <ul data-sourcepos="2:1-3:5" dir="auto"> - <li data-sourcepos="2:1-2:5">bar</li> - <li data-sourcepos="3:1-3:5">baz</li> - </ul> -05_04_00__container_blocks__lists__004: - canonical: | - <p>The number of windows in my house is - 14. The number of doors is 6.</p> - static: |- - <p data-sourcepos="1:1-2:30" dir="auto">The number of windows in my house is - 14. The number of doors is 6.</p> -05_04_00__container_blocks__lists__005: - canonical: | - <p>The number of windows in my house is</p> - <ol> - <li>The number of doors is 6.</li> - </ol> - static: |- - <p data-sourcepos="1:1-1:36" dir="auto">The number of windows in my house is</p> - <ol data-sourcepos="2:1-2:29" dir="auto"> - <li data-sourcepos="2:1-2:29">The number of doors is 6.</li> - </ol> -05_04_00__container_blocks__lists__006: - canonical: | - <ul> - <li> - <p>foo</p> - </li> - <li> - <p>bar</p> - </li> - <li> - <p>baz</p> - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-6:5" dir="auto"> - <li data-sourcepos="1:1-2:0"> - <p data-sourcepos="1:3-1:5">foo</p> - </li> - <li data-sourcepos="3:1-5:0"> - <p data-sourcepos="3:3-3:5">bar</p> - </li> - <li data-sourcepos="6:1-6:5"> - <p data-sourcepos="6:3-6:5">baz</p> - </li> - </ul> -05_04_00__container_blocks__lists__007: - canonical: | - <ul> - <li>foo - <ul> - <li>bar - <ul> - <li> - <p>baz</p> - <p>bim</p> - </li> - </ul> - </li> - </ul> - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-6:9" dir="auto"> - <li data-sourcepos="1:1-6:9">foo - <ul data-sourcepos="2:3-6:9"> - <li data-sourcepos="2:3-6:9">bar - <ul data-sourcepos="3:5-6:9"> - <li data-sourcepos="3:5-6:9"> - <p data-sourcepos="3:7-3:9">baz</p> - <p data-sourcepos="6:7-6:9">bim</p> - </li> - </ul> - </li> - </ul> - </li> - </ul> -05_04_00__container_blocks__lists__008: - canonical: | - <ul> - <li>foo</li> - <li>bar</li> - </ul> - <!-- --> - <ul> - <li>baz</li> - <li>bim</li> - </ul> - static: |- - <ul data-sourcepos="1:1-3:0" dir="auto"> - <li data-sourcepos="1:1-1:5">foo</li> - <li data-sourcepos="2:1-3:0">bar</li> - </ul> - <!-- --> - <ul data-sourcepos="6:1-7:5" dir="auto"> - <li data-sourcepos="6:1-6:5">baz</li> - <li data-sourcepos="7:1-7:5">bim</li> - </ul> -05_04_00__container_blocks__lists__009: - canonical: | - <ul> - <li> - <p>foo</p> - <p>notcode</p> - </li> - <li> - <p>foo</p> - </li> - </ul> - <!-- --> - <pre><code>code - </code></pre> - static: |- - <ul data-sourcepos="1:1-6:0" dir="auto"> - <li data-sourcepos="1:1-4:0"> - <p data-sourcepos="1:5-1:7">foo</p> - <p data-sourcepos="3:5-3:11">notcode</p> - </li> - <li data-sourcepos="5:1-6:0"> - <p data-sourcepos="5:5-5:7">foo</p> - </li> - </ul> - <!-- --> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="9:5-9:8" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">code</span></code></pre> - <copy-code></copy-code> - </div> -05_04_00__container_blocks__lists__010: - canonical: | - <ul> - <li>a</li> - <li>b</li> - <li>c</li> - <li>d</li> - <li>e</li> - <li>f</li> - <li>g</li> - </ul> - static: |- - <ul data-sourcepos="1:1-7:3" dir="auto"> - <li data-sourcepos="1:1-1:3">a</li> - <li data-sourcepos="2:2-2:4">b</li> - <li data-sourcepos="3:3-3:5">c</li> - <li data-sourcepos="4:4-4:6">d</li> - <li data-sourcepos="5:3-5:5">e</li> - <li data-sourcepos="6:2-6:4">f</li> - <li data-sourcepos="7:1-7:3">g</li> - </ul> -05_04_00__container_blocks__lists__011: - canonical: | - <ol> - <li> - <p>a</p> - </li> - <li> - <p>b</p> - </li> - <li> - <p>c</p> - </li> - </ol> - static: |- - <ol data-sourcepos="1:1-5:7" dir="auto"> - <li data-sourcepos="1:1-2:0"> - <p data-sourcepos="1:4-1:4">a</p> - </li> - <li data-sourcepos="3:3-4:0"> - <p data-sourcepos="3:6-3:6">b</p> - </li> - <li data-sourcepos="5:4-5:7"> - <p data-sourcepos="5:7-5:7">c</p> - </li> - </ol> -05_04_00__container_blocks__lists__012: - canonical: | - <ul> - <li>a</li> - <li>b</li> - <li>c</li> - <li>d - - e</li> - </ul> - static: |- - <ul data-sourcepos="1:1-5:7" dir="auto"> - <li data-sourcepos="1:1-1:3">a</li> - <li data-sourcepos="2:2-2:4">b</li> - <li data-sourcepos="3:3-3:5">c</li> - <li data-sourcepos="4:4-5:7">d - - e</li> - </ul> -05_04_00__container_blocks__lists__013: - canonical: | - <ol> - <li> - <p>a</p> - </li> - <li> - <p>b</p> - </li> - </ol> - <pre><code>3. c - </code></pre> - static: |- - <ol data-sourcepos="1:1-4:0" dir="auto"> - <li data-sourcepos="1:1-2:0"> - <p data-sourcepos="1:4-1:4">a</p> - </li> - <li data-sourcepos="3:3-4:0"> - <p data-sourcepos="3:6-3:6">b</p> - </li> - </ol> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="5:5-5:8" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">3. c</span></code></pre> - <copy-code></copy-code> - </div> -05_04_00__container_blocks__lists__014: - canonical: | - <ul> - <li> - <p>a</p> - </li> - <li> - <p>b</p> - </li> - <li> - <p>c</p> - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-4:3" dir="auto"> - <li data-sourcepos="1:1-1:3"> - <p data-sourcepos="1:3-1:3">a</p> - </li> - <li data-sourcepos="2:1-3:0"> - <p data-sourcepos="2:3-2:3">b</p> - </li> - <li data-sourcepos="4:1-4:3"> - <p data-sourcepos="4:3-4:3">c</p> - </li> - </ul> -05_04_00__container_blocks__lists__015: - canonical: | - <ul> - <li> - <p>a</p> - </li> - <li></li> - <li> - <p>c</p> - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-4:3" dir="auto"> - <li data-sourcepos="1:1-1:3"> - <p data-sourcepos="1:3-1:3">a</p> - </li> - <li data-sourcepos="2:1-2:1"> - </li> - <li data-sourcepos="4:1-4:3"> - <p data-sourcepos="4:3-4:3">c</p> - </li> - </ul> -05_04_00__container_blocks__lists__016: - canonical: | - <ul> - <li> - <p>a</p> - </li> - <li> - <p>b</p> - <p>c</p> - </li> - <li> - <p>d</p> - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-5:3" dir="auto"> - <li data-sourcepos="1:1-1:3"> - <p data-sourcepos="1:3-1:3">a</p> - </li> - <li data-sourcepos="2:1-4:3"> - <p data-sourcepos="2:3-2:3">b</p> - <p data-sourcepos="4:3-4:3">c</p> - </li> - <li data-sourcepos="5:1-5:3"> - <p data-sourcepos="5:3-5:3">d</p> - </li> - </ul> -05_04_00__container_blocks__lists__017: - canonical: | - <ul> - <li> - <p>a</p> - </li> - <li> - <p>b</p> - </li> - <li> - <p>d</p> - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-5:3" dir="auto"> - <li data-sourcepos="1:1-1:3"> - <p data-sourcepos="1:3-1:3">a</p> - </li> - <li data-sourcepos="2:1-4:13"> - <p data-sourcepos="2:3-2:3">b</p> - </li> - <li data-sourcepos="5:1-5:3"> - <p data-sourcepos="5:3-5:3">d</p> - </li> - </ul> -05_04_00__container_blocks__lists__018: - canonical: | - <ul> - <li>a</li> - <li> - <pre><code>b - - - </code></pre> - </li> - <li>c</li> - </ul> - static: |- - <ul data-sourcepos="1:1-7:3" dir="auto"> - <li data-sourcepos="1:1-1:3">a</li> - <li data-sourcepos="2:1-6:5"> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="2:3-6:5" class="code highlight js-syntax-highlight language-plaintext" 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"></span></code></pre> - <copy-code></copy-code> - </div> - </li> - <li data-sourcepos="7:1-7:3">c</li> - </ul> -05_04_00__container_blocks__lists__019: - canonical: | - <ul> - <li>a - <ul> - <li> - <p>b</p> - <p>c</p> - </li> - </ul> - </li> - <li>d</li> - </ul> - static: |- - <ul data-sourcepos="1:1-5:3" dir="auto"> - <li data-sourcepos="1:1-4:5">a - <ul data-sourcepos="2:3-4:5"> - <li data-sourcepos="2:3-4:5"> - <p data-sourcepos="2:5-2:5">b</p> - <p data-sourcepos="4:5-4:5">c</p> - </li> - </ul> - </li> - <li data-sourcepos="5:1-5:3">d</li> - </ul> -05_04_00__container_blocks__lists__020: - canonical: | - <ul> - <li>a - <blockquote> - <p>b</p> - </blockquote> - </li> - <li>c</li> - </ul> - static: |- - <ul data-sourcepos="1:1-4:3" dir="auto"> - <li data-sourcepos="1:1-3:3">a - <blockquote data-sourcepos="2:3-3:3"> - <p data-sourcepos="2:5-2:5">b</p> - </blockquote> - </li> - <li data-sourcepos="4:1-4:3">c</li> - </ul> -05_04_00__container_blocks__lists__021: - canonical: | - <ul> - <li>a - <blockquote> - <p>b</p> - </blockquote> - <pre><code>c - </code></pre> - </li> - <li>d</li> - </ul> - static: |- - <ul data-sourcepos="1:1-6:3" dir="auto"> - <li data-sourcepos="1:1-5:5">a - <blockquote data-sourcepos="2:3-2:5"> - <p data-sourcepos="2:5-2:5">b</p> - </blockquote> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="3:3-5:5" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">c</span></code></pre> - <copy-code></copy-code> - </div> - </li> - <li data-sourcepos="6:1-6:3">d</li> - </ul> -05_04_00__container_blocks__lists__022: - canonical: | - <ul> - <li>a</li> - </ul> - static: |- - <ul data-sourcepos="1:1-1:3" dir="auto"> - <li data-sourcepos="1:1-1:3">a</li> - </ul> -05_04_00__container_blocks__lists__023: - canonical: | - <ul> - <li>a - <ul> - <li>b</li> - </ul> - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-2:5" dir="auto"> - <li data-sourcepos="1:1-2:5">a - <ul data-sourcepos="2:3-2:5"> - <li data-sourcepos="2:3-2:5">b</li> - </ul> - </li> - </ul> -05_04_00__container_blocks__lists__024: - canonical: | - <ol> - <li> - <pre><code>foo - </code></pre> - <p>bar</p> - </li> - </ol> - static: |- - <ol data-sourcepos="1:1-5:6" dir="auto"> - <li data-sourcepos="1:1-5:6"> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:4-3:6" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span></code></pre> - <copy-code></copy-code> - </div> - <p data-sourcepos="5:4-5:6">bar</p> - </li> - </ol> -05_04_00__container_blocks__lists__025: - canonical: | - <ul> - <li> - <p>foo</p> - <ul> - <li>bar</li> - </ul> - <p>baz</p> - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-4:5" dir="auto"> - <li data-sourcepos="1:1-4:5"> - <p data-sourcepos="1:3-1:5">foo</p> - <ul data-sourcepos="2:3-3:0"> - <li data-sourcepos="2:3-3:0">bar</li> - </ul> - <p data-sourcepos="4:3-4:5">baz</p> - </li> - </ul> -05_04_00__container_blocks__lists__026: - canonical: | - <ul> - <li> - <p>a</p> - <ul> - <li>b</li> - <li>c</li> - </ul> - </li> - <li> - <p>d</p> - <ul> - <li>e</li> - <li>f</li> - </ul> - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-7:5" dir="auto"> - <li data-sourcepos="1:1-4:0"> - <p data-sourcepos="1:3-1:3">a</p> - <ul data-sourcepos="2:3-4:0"> - <li data-sourcepos="2:3-2:5">b</li> - <li data-sourcepos="3:3-4:0">c</li> - </ul> - </li> - <li data-sourcepos="5:1-7:5"> - <p data-sourcepos="5:3-5:3">d</p> - <ul data-sourcepos="6:3-7:5"> - <li data-sourcepos="6:3-6:5">e</li> - <li data-sourcepos="7:3-7:5">f</li> - </ul> - </li> - </ul> -06_01_00__inlines__001: - canonical: | - <p><code>hi</code>lo`</p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto"><code data-sourcepos="1:2-1:3">hi</code>lo`</p> -06_02_00__inlines__backslash_escapes__001: - canonical: | - <p>!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~</p> - static: |- - <p data-sourcepos="1:1-1:64" dir="auto"><span data-escaped-char data-sourcepos="1:1-1:2">!</span>"<span data-escaped-char data-sourcepos="1:5-1:6">#</span><span data-escaped-char data-sourcepos="1:7-1:8">$</span><span data-escaped-char data-sourcepos="1:9-1:10">%</span><span data-escaped-char data-sourcepos="1:11-1:12">&</span>'()*+,-./:;<=>?<span data-escaped-char data-sourcepos="1:43-1:44">@</span>[\]<span data-escaped-char data-sourcepos="1:51-1:52">^</span>_`{|}<span data-escaped-char data-sourcepos="1:63-1:64">~</span></p> -06_02_00__inlines__backslash_escapes__002: - canonical: "<p>\\\t\\A\\a\\ \\3\\φ\\«</p>\n" - static: "<p data-sourcepos=\"1:1-1:16\" dir=\"auto\">\\\t\\A\\a\\ \\3\\φ\\«</p>" -06_02_00__inlines__backslash_escapes__003: - canonical: | - <p>*not emphasized* - <br/> not a tag - [not a link](/foo) - `not code` - 1. not a list - * not a list - # not a heading - [foo]: /url "not a reference" - &ouml; not a character entity</p> - static: |- - <p data-sourcepos="1:1-9:30" dir="auto">*not emphasized* - <br/> not a tag - [not a link](/foo) - `not code` - 1. not a list - * not a list - <span data-escaped-char data-sourcepos="7:1-7:2">#</span> not a heading - [foo]: /url "not a reference" - <span data-escaped-char data-sourcepos="9:1-9:2">&</span>ouml; not a character entity</p> -06_02_00__inlines__backslash_escapes__004: - canonical: | - <p>\<em>emphasis</em></p> - static: |- - <p data-sourcepos="1:1-1:12" dir="auto">\<em data-sourcepos="1:3-1:12">emphasis</em></p> -06_02_00__inlines__backslash_escapes__005: - canonical: | - <p>foo<br /> - bar</p> - static: |- - <p data-sourcepos="1:1-2:3" dir="auto">foo<br data-sourcepos="1:4-1:5"> - bar</p> -06_02_00__inlines__backslash_escapes__006: - canonical: | - <p><code>\[\`</code></p> - static: |- - <p data-sourcepos="1:1-1:10" dir="auto"><code data-sourcepos="1:3-1:8">\[\`</code></p> -06_02_00__inlines__backslash_escapes__007: - canonical: | - <pre><code>\[\] - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:5-1:8" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\[\]</span></code></pre> - <copy-code></copy-code> - </div> -06_02_00__inlines__backslash_escapes__008: - canonical: | - <pre><code>\[\] - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-3:3" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\[\]</span></code></pre> - <copy-code></copy-code> - </div> -06_02_00__inlines__backslash_escapes__009: - canonical: | - <p><a href="http://example.com?find=%5C*">http://example.com?find=\*</a></p> - static: |- - <p data-sourcepos="1:1-1:28" dir="auto"><a data-sourcepos="1:2-1:29" href="http://example.com?find=%5C*" rel="nofollow noreferrer noopener" target="_blank">http://example.com?find=\*</a></p> -06_02_00__inlines__backslash_escapes__010: - canonical: | - <a href="/bar\/)"> - static: |- - <a href="/bar\/)" rel="nofollow noreferrer noopener" target="_blank"></a> -06_02_00__inlines__backslash_escapes__011: - canonical: | - <p><a href="/bar*" title="ti*tle">foo</a></p> - static: |- - <p data-sourcepos="1:1-1:23" dir="auto"><a data-sourcepos="1:1-1:23" href="/bar*" title="ti*tle">foo</a></p> -06_02_00__inlines__backslash_escapes__012: - canonical: | - <p><a href="/bar*" title="ti*tle">foo</a></p> - static: |- - <p data-sourcepos="1:1-1:5" dir="auto"><a data-sourcepos="1:1-1:5" href="/bar*" title="ti*tle">foo</a></p> -06_02_00__inlines__backslash_escapes__013: - canonical: | - <pre><code class="language-foo+bar">foo - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-3:3" data-canonical-lang="foo+bar" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span></code></pre> - <copy-code></copy-code> - </div> -06_03_00__inlines__entity_and_numeric_character_references__001: - canonical: | - <p> & © Æ ÄŽ - ¾ â„‹ â…† - ∲ ≧̸</p> - static: |- - <p data-sourcepos="1:1-3:32" dir="auto"> & © Æ ÄŽ - ¾ â„‹ â…† - ∲ ≧̸</p> -06_03_00__inlines__entity_and_numeric_character_references__002: - canonical: | - <p># Ó’ Ï ï¿½</p> - static: |- - <p data-sourcepos="1:1-1:25" dir="auto"># Ó’ Ï ï¿½</p> -06_03_00__inlines__entity_and_numeric_character_references__003: - canonical: | - <p>" à´† ಫ</p> - static: |- - <p data-sourcepos="1:1-1:22" dir="auto">" à´† ಫ</p> -06_03_00__inlines__entity_and_numeric_character_references__004: - canonical: | - <p>&nbsp &x; &#; &#x; - &#987654321; - &#abcdef0; - &ThisIsNotDefined; &hi?;</p> - static: |- - <p data-sourcepos="1:1-4:24" dir="auto">&nbsp &x; &#; &#x; - &#987654321; - &#abcdef0; - &ThisIsNotDefined; &hi?;</p> -06_03_00__inlines__entity_and_numeric_character_references__005: - canonical: | - <p>&copy</p> - static: |- - <p data-sourcepos="1:1-1:5" dir="auto">&copy</p> -06_03_00__inlines__entity_and_numeric_character_references__006: - canonical: | - <p>&MadeUpEntity;</p> - static: |- - <p data-sourcepos="1:1-1:14" dir="auto">&MadeUpEntity;</p> -06_03_00__inlines__entity_and_numeric_character_references__007: - canonical: | - <a href="öö.html"> - static: |- - <a href="%C3%B6%C3%B6.html" rel="nofollow noreferrer noopener" target="_blank"></a> -06_03_00__inlines__entity_and_numeric_character_references__008: - canonical: | - <p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p> - static: |- - <p data-sourcepos="1:1-1:37" dir="auto"><a data-sourcepos="1:1-1:37" href="/f%C3%B6%C3%B6" title="föö">foo</a></p> -06_03_00__inlines__entity_and_numeric_character_references__009: - canonical: | - <p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p> - static: |- - <p data-sourcepos="1:1-1:5" dir="auto"><a data-sourcepos="1:1-1:5" href="/f%C3%B6%C3%B6" title="föö">foo</a></p> -06_03_00__inlines__entity_and_numeric_character_references__010: - canonical: | - <pre><code class="language-föö">foo - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-3:3" data-canonical-lang="föö" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo</span></code></pre> - <copy-code></copy-code> - </div> -06_03_00__inlines__entity_and_numeric_character_references__011: - canonical: | - <p><code>f&ouml;&ouml;</code></p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto"><code data-sourcepos="1:2-1:14">f&ouml;&ouml;</code></p> -06_03_00__inlines__entity_and_numeric_character_references__012: - canonical: | - <pre><code>f&ouml;f&ouml; - </code></pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:5-1:18" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">f&ouml;f&ouml;</span></code></pre> - <copy-code></copy-code> - </div> -06_03_00__inlines__entity_and_numeric_character_references__013: - canonical: | - <p>*foo* - <em>foo</em></p> - static: |- - <p data-sourcepos="1:1-2:5" dir="auto">*foo* - <em data-sourcepos="2:1-2:5">foo</em></p> -06_03_00__inlines__entity_and_numeric_character_references__014: - canonical: | - <p>* foo</p> - <ul> - <li>foo</li> - </ul> - static: |- - <p data-sourcepos="1:1-1:9" dir="auto">* foo</p> - <ul data-sourcepos="3:1-3:5" dir="auto"> - <li data-sourcepos="3:1-3:5">foo</li> - </ul> -06_03_00__inlines__entity_and_numeric_character_references__015: - canonical: | - <p>foo - - bar</p> - static: |- - <p data-sourcepos="1:1-1:16" dir="auto">foo - - bar</p> -06_03_00__inlines__entity_and_numeric_character_references__016: - canonical: "<p>\tfoo</p>\n" - static: "<p data-sourcepos=\"1:1-1:7\" dir=\"auto\">\tfoo</p>" -06_03_00__inlines__entity_and_numeric_character_references__017: - canonical: | - <p>[a](url "tit")</p> - static: |- - <p data-sourcepos="1:1-1:24" dir="auto"><a data-sourcepos="1:1-1:14" href="url" title="tit">a</a></p> -06_04_00__inlines__code_spans__001: - canonical: | - <p><code>foo</code></p> - static: |- - <p data-sourcepos="1:1-1:5" dir="auto"><code data-sourcepos="1:2-1:4">foo</code></p> -06_04_00__inlines__code_spans__002: - canonical: | - <p><code>foo ` bar</code></p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto"><code data-sourcepos="1:3-1:13">foo ` bar</code></p> -06_04_00__inlines__code_spans__003: - canonical: | - <p><code>``</code></p> - static: |- - <p data-sourcepos="1:1-1:6" dir="auto"><code data-sourcepos="1:2-1:5">``</code></p> -06_04_00__inlines__code_spans__004: - canonical: | - <p><code> `` </code></p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto"><code data-sourcepos="1:2-1:7"> `` </code></p> -06_04_00__inlines__code_spans__005: - canonical: | - <p><code> a</code></p> - static: |- - <p data-sourcepos="1:1-1:4" dir="auto"><code data-sourcepos="1:2-1:3"> a</code></p> -06_04_00__inlines__code_spans__006: - canonical: | - <p><code> b </code></p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto"><code data-sourcepos="1:2-1:6"> b </code></p> -06_04_00__inlines__code_spans__007: - canonical: | - <p><code> </code> - <code> </code></p> - static: |- - <p data-sourcepos="1:1-2:4" dir="auto"><code data-sourcepos="1:2-1:3"> </code> - <code data-sourcepos="2:2-2:3"> </code></p> -06_04_00__inlines__code_spans__008: - canonical: | - <p><code>foo bar baz</code></p> - static: |- - <p data-sourcepos="1:1-5:2" dir="auto"><code data-sourcepos="1:3-5:0">foo bar baz</code></p> -06_04_00__inlines__code_spans__009: - canonical: | - <p><code>foo </code></p> - static: |- - <p data-sourcepos="1:1-3:2" dir="auto"><code data-sourcepos="1:3-3:0">foo </code></p> -06_04_00__inlines__code_spans__010: - canonical: | - <p><code>foo bar baz</code></p> - static: |- - <p data-sourcepos="1:1-2:4" dir="auto"><code data-sourcepos="1:2-2:3">foo bar baz</code></p> -06_04_00__inlines__code_spans__011: - canonical: | - <p><code>foo\</code>bar`</p> - static: |- - <p data-sourcepos="1:1-1:10" dir="auto"><code data-sourcepos="1:2-1:5">foo\</code>bar`</p> -06_04_00__inlines__code_spans__012: - canonical: | - <p><code>foo`bar</code></p> - static: |- - <p data-sourcepos="1:1-1:11" dir="auto"><code data-sourcepos="1:3-1:9">foo`bar</code></p> -06_04_00__inlines__code_spans__013: - canonical: | - <p><code>foo `` bar</code></p> - static: |- - <p data-sourcepos="1:1-1:14" dir="auto"><code data-sourcepos="1:2-1:13">foo `` bar</code></p> -06_04_00__inlines__code_spans__014: - canonical: | - <p>*foo<code>*</code></p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto">*foo<code data-sourcepos="1:6-1:6">*</code></p> -06_04_00__inlines__code_spans__015: - canonical: | - <p>[not a <code>link](/foo</code>)</p> - static: |- - <p data-sourcepos="1:1-1:20" dir="auto">[not a <code data-sourcepos="1:9-1:18">link](/foo</code>)</p> -06_04_00__inlines__code_spans__016: - canonical: | - <p><code><a href="</code>">`</p> - static: |- - <p data-sourcepos="1:1-1:14" dir="auto"><code data-sourcepos="1:2-1:10"><a href="</code>">`</p> -06_04_00__inlines__code_spans__017: - canonical: | - <p><a href="`">`</p> - static: |- - <p data-sourcepos="1:1-1:13" dir="auto"><a href="`" rel="nofollow noreferrer noopener" target="_blank">`</a></p> -06_04_00__inlines__code_spans__018: - canonical: | - <p><code><http://foo.bar.</code>baz>`</p> - static: |- - <p data-sourcepos="1:1-1:23" dir="auto"><code data-sourcepos="1:2-1:17"><http://foo.bar.</code>baz>`</p> -06_04_00__inlines__code_spans__019: - canonical: | - <p><a href="http://foo.bar.%60baz">http://foo.bar.`baz</a>`</p> - static: |- - <p data-sourcepos="1:1-1:22" dir="auto"><a data-sourcepos="1:2-1:22" href="http://foo.bar.%60baz" rel="nofollow noreferrer noopener" target="_blank">http://foo.bar.`baz</a>`</p> -06_04_00__inlines__code_spans__020: - canonical: | - <p>```foo``</p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto">```foo``</p> -06_04_00__inlines__code_spans__021: - canonical: | - <p>`foo</p> - static: |- - <p data-sourcepos="1:1-1:4" dir="auto">`foo</p> -06_04_00__inlines__code_spans__022: - canonical: | - <p>`foo<code>bar</code></p> - static: |- - <p data-sourcepos="1:1-1:11" dir="auto">`foo<code data-sourcepos="1:7-1:9">bar</code></p> -06_05_00__inlines__emphasis_and_strong_emphasis__001: - canonical: | - <p><em>foo bar</em></p> - static: |- - <p data-sourcepos="1:1-1:9" dir="auto"><em data-sourcepos="1:1-1:9">foo bar</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__002: - canonical: | - <p>a * foo bar*</p> - static: |- - <p data-sourcepos="1:1-1:12" dir="auto">a * foo bar*</p> -06_05_00__inlines__emphasis_and_strong_emphasis__003: - canonical: | - <p>a*"foo"*</p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto">a*"foo"*</p> -06_05_00__inlines__emphasis_and_strong_emphasis__004: - canonical: | - <p>* a *</p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto">* a *</p> -06_05_00__inlines__emphasis_and_strong_emphasis__005: - canonical: | - <p>foo<em>bar</em></p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto">foo<em data-sourcepos="1:4-1:8">bar</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__006: - canonical: | - <p>5<em>6</em>78</p> - static: |- - <p data-sourcepos="1:1-1:6" dir="auto">5<em data-sourcepos="1:2-1:4">6</em>78</p> -06_05_00__inlines__emphasis_and_strong_emphasis__007: - canonical: | - <p><em>foo bar</em></p> - static: |- - <p data-sourcepos="1:1-1:9" dir="auto"><em data-sourcepos="1:1-1:9">foo bar</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__008: - canonical: | - <p>_ foo bar_</p> - static: |- - <p data-sourcepos="1:1-1:10" dir="auto">_ foo bar_</p> -06_05_00__inlines__emphasis_and_strong_emphasis__009: - canonical: | - <p>a_"foo"_</p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto">a_"foo"_</p> -06_05_00__inlines__emphasis_and_strong_emphasis__010: - canonical: | - <p>foo_bar_</p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto">foo_bar_</p> -06_05_00__inlines__emphasis_and_strong_emphasis__011: - canonical: | - <p>5_6_78</p> - static: |- - <p data-sourcepos="1:1-1:6" dir="auto">5_6_78</p> -06_05_00__inlines__emphasis_and_strong_emphasis__012: - canonical: | - <p>приÑтанÑм_ÑтремÑÑ‚ÑÑ_</p> - static: |- - <p data-sourcepos="1:1-1:38" dir="auto">приÑтанÑм_ÑтремÑÑ‚ÑÑ_</p> -06_05_00__inlines__emphasis_and_strong_emphasis__013: - canonical: | - <p>aa_"bb"_cc</p> - static: |- - <p data-sourcepos="1:1-1:10" dir="auto">aa_"bb"_cc</p> -06_05_00__inlines__emphasis_and_strong_emphasis__014: - canonical: | - <p>foo-<em>(bar)</em></p> - static: |- - <p data-sourcepos="1:1-1:11" dir="auto">foo-<em data-sourcepos="1:5-1:11">(bar)</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__015: - canonical: | - <p>_foo*</p> - static: |- - <p data-sourcepos="1:1-1:5" dir="auto">_foo*</p> -06_05_00__inlines__emphasis_and_strong_emphasis__016: - canonical: | - <p>*foo bar *</p> - static: |- - <p data-sourcepos="1:1-1:10" dir="auto">*foo bar *</p> -06_05_00__inlines__emphasis_and_strong_emphasis__017: - canonical: | - <p>*foo bar - *</p> - static: |- - <p data-sourcepos="1:1-2:1" dir="auto">*foo bar - *</p> -06_05_00__inlines__emphasis_and_strong_emphasis__018: - canonical: | - <p>*(*foo)</p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto">*(*foo)</p> -06_05_00__inlines__emphasis_and_strong_emphasis__019: - canonical: | - <p><em>(<em>foo</em>)</em></p> - static: |- - <p data-sourcepos="1:1-1:9" dir="auto"><em data-sourcepos="1:1-1:9">(<em data-sourcepos="1:3-1:7">foo</em>)</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__020: - canonical: | - <p><em>foo</em>bar</p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto"><em data-sourcepos="1:1-1:5">foo</em>bar</p> -06_05_00__inlines__emphasis_and_strong_emphasis__021: - canonical: | - <p>_foo bar _</p> - static: |- - <p data-sourcepos="1:1-1:10" dir="auto">_foo bar _</p> -06_05_00__inlines__emphasis_and_strong_emphasis__022: - canonical: | - <p>_(_foo)</p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto">_(_foo)</p> -06_05_00__inlines__emphasis_and_strong_emphasis__023: - canonical: | - <p><em>(<em>foo</em>)</em></p> - static: |- - <p data-sourcepos="1:1-1:9" dir="auto"><em data-sourcepos="1:1-1:9">(<em data-sourcepos="1:3-1:7">foo</em>)</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__024: - canonical: | - <p>_foo_bar</p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto">_foo_bar</p> -06_05_00__inlines__emphasis_and_strong_emphasis__025: - canonical: | - <p>_приÑтанÑм_ÑтремÑÑ‚ÑÑ</p> - static: |- - <p data-sourcepos="1:1-1:38" dir="auto">_приÑтанÑм_ÑтремÑÑ‚ÑÑ</p> -06_05_00__inlines__emphasis_and_strong_emphasis__026: - canonical: | - <p><em>foo_bar_baz</em></p> - static: |- - <p data-sourcepos="1:1-1:13" dir="auto"><em data-sourcepos="1:1-1:13">foo_bar_baz</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__027: - canonical: | - <p><em>(bar)</em>.</p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto"><em data-sourcepos="1:1-1:7">(bar)</em>.</p> -06_05_00__inlines__emphasis_and_strong_emphasis__028: - canonical: | - <p><strong>foo bar</strong></p> - static: |- - <p data-sourcepos="1:1-1:11" dir="auto"><strong data-sourcepos="1:1-1:11">foo bar</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__029: - canonical: | - <p>** foo bar**</p> - static: |- - <p data-sourcepos="1:1-1:12" dir="auto">** foo bar**</p> -06_05_00__inlines__emphasis_and_strong_emphasis__030: - canonical: | - <p>a**"foo"**</p> - static: |- - <p data-sourcepos="1:1-1:10" dir="auto">a**"foo"**</p> -06_05_00__inlines__emphasis_and_strong_emphasis__031: - canonical: | - <p>foo<strong>bar</strong></p> - static: |- - <p data-sourcepos="1:1-1:10" dir="auto">foo<strong data-sourcepos="1:4-1:10">bar</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__032: - canonical: | - <p><strong>foo bar</strong></p> - static: |- - <p data-sourcepos="1:1-1:11" dir="auto"><strong data-sourcepos="1:1-1:11">foo bar</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__033: - canonical: | - <p>__ foo bar__</p> - static: |- - <p data-sourcepos="1:1-1:12" dir="auto">__ foo bar__</p> -06_05_00__inlines__emphasis_and_strong_emphasis__034: - canonical: | - <p>__ - foo bar__</p> - static: |- - <p data-sourcepos="1:1-2:9" dir="auto">__ - foo bar__</p> -06_05_00__inlines__emphasis_and_strong_emphasis__035: - canonical: | - <p>a__"foo"__</p> - static: |- - <p data-sourcepos="1:1-1:10" dir="auto">a__"foo"__</p> -06_05_00__inlines__emphasis_and_strong_emphasis__036: - canonical: | - <p>foo__bar__</p> - static: |- - <p data-sourcepos="1:1-1:10" dir="auto">foo__bar__</p> -06_05_00__inlines__emphasis_and_strong_emphasis__037: - canonical: | - <p>5__6__78</p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto">5__6__78</p> -06_05_00__inlines__emphasis_and_strong_emphasis__038: - canonical: | - <p>приÑтанÑм__ÑтремÑÑ‚ÑÑ__</p> - static: |- - <p data-sourcepos="1:1-1:40" dir="auto">приÑтанÑм__ÑтремÑÑ‚ÑÑ__</p> -06_05_00__inlines__emphasis_and_strong_emphasis__039: - canonical: | - <p><strong>foo, <strong>bar</strong>, baz</strong></p> - static: |- - <p data-sourcepos="1:1-1:21" dir="auto"><strong data-sourcepos="1:1-1:21">foo, bar, baz</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__040: - canonical: | - <p>foo-<strong>(bar)</strong></p> - static: |- - <p data-sourcepos="1:1-1:13" dir="auto">foo-<strong data-sourcepos="1:5-1:13">(bar)</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__041: - canonical: | - <p>**foo bar **</p> - static: |- - <p data-sourcepos="1:1-1:12" dir="auto">**foo bar **</p> -06_05_00__inlines__emphasis_and_strong_emphasis__042: - canonical: | - <p>**(**foo)</p> - static: |- - <p data-sourcepos="1:1-1:9" dir="auto">**(**foo)</p> -06_05_00__inlines__emphasis_and_strong_emphasis__043: - canonical: | - <p><em>(<strong>foo</strong>)</em></p> - static: |- - <p data-sourcepos="1:1-1:11" dir="auto"><em data-sourcepos="1:1-1:11">(<strong data-sourcepos="1:3-1:9">foo</strong>)</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__044: - canonical: | - <p><strong>Gomphocarpus (<em>Gomphocarpus physocarpus</em>, syn. - <em>Asclepias physocarpa</em>)</strong></p> - static: |- - <p data-sourcepos="1:1-2:25" dir="auto"><strong data-sourcepos="1:1-2:25">Gomphocarpus (<em data-sourcepos="1:17-1:42">Gomphocarpus physocarpus</em>, syn. - <em data-sourcepos="2:1-2:22">Asclepias physocarpa</em>)</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__045: - canonical: | - <p><strong>foo "<em>bar</em>" foo</strong></p> - static: |- - <p data-sourcepos="1:1-1:19" dir="auto"><strong data-sourcepos="1:1-1:19">foo "<em data-sourcepos="1:8-1:12">bar</em>" foo</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__046: - canonical: | - <p><strong>foo</strong>bar</p> - static: |- - <p data-sourcepos="1:1-1:10" dir="auto"><strong data-sourcepos="1:1-1:7">foo</strong>bar</p> -06_05_00__inlines__emphasis_and_strong_emphasis__047: - canonical: | - <p>__foo bar __</p> - static: |- - <p data-sourcepos="1:1-1:12" dir="auto">__foo bar __</p> -06_05_00__inlines__emphasis_and_strong_emphasis__048: - canonical: | - <p>__(__foo)</p> - static: |- - <p data-sourcepos="1:1-1:9" dir="auto">__(__foo)</p> -06_05_00__inlines__emphasis_and_strong_emphasis__049: - canonical: | - <p><em>(<strong>foo</strong>)</em></p> - static: |- - <p data-sourcepos="1:1-1:11" dir="auto"><em data-sourcepos="1:1-1:11">(<strong data-sourcepos="1:3-1:9">foo</strong>)</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__050: - canonical: | - <p>__foo__bar</p> - static: |- - <p data-sourcepos="1:1-1:10" dir="auto">__foo__bar</p> -06_05_00__inlines__emphasis_and_strong_emphasis__051: - canonical: | - <p>__приÑтанÑм__ÑтремÑÑ‚ÑÑ</p> - static: |- - <p data-sourcepos="1:1-1:40" dir="auto">__приÑтанÑм__ÑтремÑÑ‚ÑÑ</p> -06_05_00__inlines__emphasis_and_strong_emphasis__052: - canonical: | - <p><strong>foo__bar__baz</strong></p> - static: |- - <p data-sourcepos="1:1-1:17" dir="auto"><strong data-sourcepos="1:1-1:17">foo__bar__baz</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__053: - canonical: | - <p><strong>(bar)</strong>.</p> - static: |- - <p data-sourcepos="1:1-1:10" dir="auto"><strong data-sourcepos="1:1-1:9">(bar)</strong>.</p> -06_05_00__inlines__emphasis_and_strong_emphasis__054: - canonical: | - <p><em>foo <a href="/url">bar</a></em></p> - static: |- - <p data-sourcepos="1:1-1:17" dir="auto"><em data-sourcepos="1:1-1:17">foo <a data-sourcepos="1:6-1:16" href="/url">bar</a></em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__055: - canonical: | - <p><em>foo - bar</em></p> - static: |- - <p data-sourcepos="1:1-2:4" dir="auto"><em data-sourcepos="1:1-2:4">foo - bar</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__056: - canonical: | - <p><em>foo <strong>bar</strong> baz</em></p> - static: |- - <p data-sourcepos="1:1-1:17" dir="auto"><em data-sourcepos="1:1-1:17">foo <strong data-sourcepos="1:6-1:12">bar</strong> baz</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__057: - canonical: | - <p><em>foo <em>bar</em> baz</em></p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto"><em data-sourcepos="1:1-1:15">foo <em data-sourcepos="1:6-1:10">bar</em> baz</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__058: - canonical: | - <p><em><em>foo</em> bar</em></p> - static: |- - <p data-sourcepos="1:1-1:11" dir="auto"><em data-sourcepos="1:1-1:11"><em data-sourcepos="1:1-1:6">foo</em> bar</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__059: - canonical: | - <p><em>foo <em>bar</em></em></p> - static: |- - <p data-sourcepos="1:1-1:11" dir="auto"><em data-sourcepos="1:1-1:11">foo <em data-sourcepos="1:6-1:11">bar</em></em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__060: - canonical: | - <p><em>foo <strong>bar</strong> baz</em></p> - static: |- - <p data-sourcepos="1:1-1:17" dir="auto"><em data-sourcepos="1:1-1:17">foo <strong data-sourcepos="1:6-1:12">bar</strong> baz</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__061: - canonical: | - <p><em>foo<strong>bar</strong>baz</em></p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto"><em data-sourcepos="1:1-1:15">foo<strong data-sourcepos="1:5-1:11">bar</strong>baz</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__062: - canonical: | - <p><em>foo**bar</em></p> - static: |- - <p data-sourcepos="1:1-1:10" dir="auto"><em data-sourcepos="1:1-1:10">foo**bar</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__063: - canonical: | - <p><em><strong>foo</strong> bar</em></p> - static: |- - <p data-sourcepos="1:1-1:13" dir="auto"><em data-sourcepos="1:1-1:13"><strong data-sourcepos="1:1-1:8">foo</strong> bar</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__064: - canonical: | - <p><em>foo <strong>bar</strong></em></p> - static: |- - <p data-sourcepos="1:1-1:13" dir="auto"><em data-sourcepos="1:1-1:13">foo <strong data-sourcepos="1:6-1:13">bar</strong></em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__065: - canonical: | - <p><em>foo<strong>bar</strong></em></p> - static: |- - <p data-sourcepos="1:1-1:12" dir="auto"><em data-sourcepos="1:1-1:12">foo<strong data-sourcepos="1:5-1:12">bar</strong></em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__066: - canonical: | - <p>foo<em><strong>bar</strong></em>baz</p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto">foo<em data-sourcepos="1:4-1:12"><strong data-sourcepos="1:4-1:12">bar</strong></em>baz</p> -06_05_00__inlines__emphasis_and_strong_emphasis__067: - canonical: | - <p>foo<strong><strong><strong>bar</strong></strong></strong>***baz</p> - static: |- - <p data-sourcepos="1:1-1:24" dir="auto">foo<strong data-sourcepos="1:4-1:21">bar</strong>***baz</p> -06_05_00__inlines__emphasis_and_strong_emphasis__068: - canonical: | - <p><em>foo <strong>bar <em>baz</em> bim</strong> bop</em></p> - static: |- - <p data-sourcepos="1:1-1:27" dir="auto"><em data-sourcepos="1:1-1:27">foo <strong data-sourcepos="1:6-1:22">bar <em data-sourcepos="1:12-1:16">baz</em> bim</strong> bop</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__069: - canonical: | - <p><em>foo <a href="/url"><em>bar</em></a></em></p> - static: |- - <p data-sourcepos="1:1-1:19" dir="auto"><em data-sourcepos="1:1-1:19">foo <a data-sourcepos="1:6-1:18" href="/url"><em data-sourcepos="1:7-1:11">bar</em></a></em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__070: - canonical: | - <p>** is not an empty emphasis</p> - static: |- - <p data-sourcepos="1:1-1:27" dir="auto">** is not an empty emphasis</p> -06_05_00__inlines__emphasis_and_strong_emphasis__071: - canonical: | - <p>**** is not an empty strong emphasis</p> - static: |- - <p data-sourcepos="1:1-1:36" dir="auto">**** is not an empty strong emphasis</p> -06_05_00__inlines__emphasis_and_strong_emphasis__072: - canonical: | - <p><strong>foo <a href="/url">bar</a></strong></p> - static: |- - <p data-sourcepos="1:1-1:19" dir="auto"><strong data-sourcepos="1:1-1:19">foo <a data-sourcepos="1:7-1:17" href="/url">bar</a></strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__073: - canonical: | - <p><strong>foo - bar</strong></p> - static: |- - <p data-sourcepos="1:1-2:5" dir="auto"><strong data-sourcepos="1:1-2:5">foo - bar</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__074: - canonical: | - <p><strong>foo <em>bar</em> baz</strong></p> - static: |- - <p data-sourcepos="1:1-1:17" dir="auto"><strong data-sourcepos="1:1-1:17">foo <em data-sourcepos="1:7-1:11">bar</em> baz</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__075: - canonical: | - <p><strong>foo <strong>bar</strong> baz</strong></p> - static: |- - <p data-sourcepos="1:1-1:19" dir="auto"><strong data-sourcepos="1:1-1:19">foo bar baz</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__076: - canonical: | - <p><strong><strong>foo</strong> bar</strong></p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto"><strong data-sourcepos="1:1-1:15">foo bar</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__077: - canonical: | - <p><strong>foo <strong>bar</strong></strong></p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto"><strong data-sourcepos="1:1-1:15">foo bar</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__078: - canonical: | - <p><strong>foo <em>bar</em> baz</strong></p> - static: |- - <p data-sourcepos="1:1-1:17" dir="auto"><strong data-sourcepos="1:1-1:17">foo <em data-sourcepos="1:7-1:11">bar</em> baz</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__079: - canonical: | - <p><strong>foo<em>bar</em>baz</strong></p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto"><strong data-sourcepos="1:1-1:15">foo<em data-sourcepos="1:6-1:10">bar</em>baz</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__080: - canonical: | - <p><strong><em>foo</em> bar</strong></p> - static: |- - <p data-sourcepos="1:1-1:13" dir="auto"><strong data-sourcepos="1:1-1:13"><em data-sourcepos="1:1-1:7">foo</em> bar</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__081: - canonical: | - <p><strong>foo <em>bar</em></strong></p> - static: |- - <p data-sourcepos="1:1-1:13" dir="auto"><strong data-sourcepos="1:1-1:13">foo <em data-sourcepos="1:7-1:13">bar</em></strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__082: - canonical: | - <p><strong>foo <em>bar <strong>baz</strong> - bim</em> bop</strong></p> - static: |- - <p data-sourcepos="1:1-2:10" dir="auto"><strong data-sourcepos="1:1-2:10">foo <em data-sourcepos="1:7-2:4">bar <strong data-sourcepos="1:12-1:18">baz</strong> - bim</em> bop</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__083: - canonical: | - <p><strong>foo <a href="/url"><em>bar</em></a></strong></p> - static: |- - <p data-sourcepos="1:1-1:21" dir="auto"><strong data-sourcepos="1:1-1:21">foo <a data-sourcepos="1:7-1:19" href="/url"><em data-sourcepos="1:8-1:12">bar</em></a></strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__084: - canonical: | - <p>__ is not an empty emphasis</p> - static: |- - <p data-sourcepos="1:1-1:27" dir="auto">__ is not an empty emphasis</p> -06_05_00__inlines__emphasis_and_strong_emphasis__085: - canonical: | - <p>____ is not an empty strong emphasis</p> - static: |- - <p data-sourcepos="1:1-1:36" dir="auto">____ is not an empty strong emphasis</p> -06_05_00__inlines__emphasis_and_strong_emphasis__086: - canonical: | - <p>foo ***</p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto">foo ***</p> -06_05_00__inlines__emphasis_and_strong_emphasis__087: - canonical: | - <p>foo <em>*</em></p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto">foo <em data-sourcepos="1:5-1:8">*</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__088: - canonical: | - <p>foo <em>_</em></p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto">foo <em data-sourcepos="1:5-1:7">_</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__089: - canonical: | - <p>foo *****</p> - static: |- - <p data-sourcepos="1:1-1:9" dir="auto">foo *****</p> -06_05_00__inlines__emphasis_and_strong_emphasis__090: - canonical: | - <p>foo <strong>*</strong></p> - static: |- - <p data-sourcepos="1:1-1:10" dir="auto">foo <strong data-sourcepos="1:5-1:10">*</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__091: - canonical: | - <p>foo <strong>_</strong></p> - static: |- - <p data-sourcepos="1:1-1:9" dir="auto">foo <strong data-sourcepos="1:5-1:9">_</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__092: - canonical: | - <p>*<em>foo</em></p> - static: |- - <p data-sourcepos="1:1-1:6" dir="auto">*<em data-sourcepos="1:1-1:6">foo</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__093: - canonical: | - <p><em>foo</em>*</p> - static: |- - <p data-sourcepos="1:1-1:6" dir="auto"><em data-sourcepos="1:1-1:6">foo</em>*</p> -06_05_00__inlines__emphasis_and_strong_emphasis__094: - canonical: | - <p>*<strong>foo</strong></p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto">*<strong data-sourcepos="1:1-1:8">foo</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__095: - canonical: | - <p>***<em>foo</em></p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto">***<em data-sourcepos="1:1-1:8">foo</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__096: - canonical: | - <p><strong>foo</strong>*</p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto"><strong data-sourcepos="1:1-1:8">foo</strong>*</p> -06_05_00__inlines__emphasis_and_strong_emphasis__097: - canonical: | - <p><em>foo</em>***</p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto"><em data-sourcepos="1:1-1:8">foo</em>***</p> -06_05_00__inlines__emphasis_and_strong_emphasis__098: - canonical: | - <p>foo ___</p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto">foo ___</p> -06_05_00__inlines__emphasis_and_strong_emphasis__099: - canonical: | - <p>foo <em>_</em></p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto">foo <em data-sourcepos="1:5-1:8">_</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__100: - canonical: | - <p>foo <em>*</em></p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto">foo <em data-sourcepos="1:5-1:7">*</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__101: - canonical: | - <p>foo _____</p> - static: |- - <p data-sourcepos="1:1-1:9" dir="auto">foo _____</p> -06_05_00__inlines__emphasis_and_strong_emphasis__102: - canonical: | - <p>foo <strong>_</strong></p> - static: |- - <p data-sourcepos="1:1-1:10" dir="auto">foo <strong data-sourcepos="1:5-1:10">_</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__103: - canonical: | - <p>foo <strong>*</strong></p> - static: |- - <p data-sourcepos="1:1-1:9" dir="auto">foo <strong data-sourcepos="1:5-1:9">*</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__104: - canonical: | - <p>_<em>foo</em></p> - static: |- - <p data-sourcepos="1:1-1:6" dir="auto">_<em data-sourcepos="1:1-1:6">foo</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__105: - canonical: | - <p><em>foo</em>_</p> - static: |- - <p data-sourcepos="1:1-1:6" dir="auto"><em data-sourcepos="1:1-1:6">foo</em>_</p> -06_05_00__inlines__emphasis_and_strong_emphasis__106: - canonical: | - <p>_<strong>foo</strong></p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto">_<strong data-sourcepos="1:1-1:8">foo</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__107: - canonical: | - <p>___<em>foo</em></p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto">___<em data-sourcepos="1:1-1:8">foo</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__108: - canonical: | - <p><strong>foo</strong>_</p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto"><strong data-sourcepos="1:1-1:8">foo</strong>_</p> -06_05_00__inlines__emphasis_and_strong_emphasis__109: - canonical: | - <p><em>foo</em>___</p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto"><em data-sourcepos="1:1-1:8">foo</em>___</p> -06_05_00__inlines__emphasis_and_strong_emphasis__110: - canonical: | - <p><strong>foo</strong></p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto"><strong data-sourcepos="1:1-1:7">foo</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__111: - canonical: | - <p><em><em>foo</em></em></p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto"><em data-sourcepos="1:1-1:7"><em data-sourcepos="1:2-1:6">foo</em></em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__112: - canonical: | - <p><strong>foo</strong></p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto"><strong data-sourcepos="1:1-1:7">foo</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__113: - canonical: | - <p><em><em>foo</em></em></p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto"><em data-sourcepos="1:1-1:7"><em data-sourcepos="1:2-1:6">foo</em></em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__114: - canonical: | - <p><strong><strong>foo</strong></strong></p> - static: |- - <p data-sourcepos="1:1-1:11" dir="auto"><strong data-sourcepos="1:1-1:11">foo</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__115: - canonical: | - <p><strong><strong>foo</strong></strong></p> - static: |- - <p data-sourcepos="1:1-1:11" dir="auto"><strong data-sourcepos="1:1-1:11">foo</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__116: - canonical: | - <p><strong><strong><strong>foo</strong></strong></strong></p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto"><strong data-sourcepos="1:1-1:15">foo</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__117: - canonical: | - <p><em><strong>foo</strong></em></p> - static: |- - <p data-sourcepos="1:1-1:9" dir="auto"><em data-sourcepos="1:1-1:9"><strong data-sourcepos="1:1-1:9">foo</strong></em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__118: - canonical: | - <p><em><strong><strong>foo</strong></strong></em></p> - static: |- - <p data-sourcepos="1:1-1:13" dir="auto"><em data-sourcepos="1:1-1:13"><strong data-sourcepos="1:1-1:13">foo</strong></em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__119: - canonical: | - <p><em>foo _bar</em> baz_</p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto"><em data-sourcepos="1:1-1:10">foo _bar</em> baz_</p> -06_05_00__inlines__emphasis_and_strong_emphasis__120: - canonical: | - <p><em>foo <strong>bar *baz bim</strong> bam</em></p> - static: |- - <p data-sourcepos="1:1-1:26" dir="auto"><em data-sourcepos="1:1-1:26">foo <strong data-sourcepos="1:6-1:21">bar *baz bim</strong> bam</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__121: - canonical: | - <p>**foo <strong>bar baz</strong></p> - static: |- - <p data-sourcepos="1:1-1:17" dir="auto">**foo <strong data-sourcepos="1:7-1:17">bar baz</strong></p> -06_05_00__inlines__emphasis_and_strong_emphasis__122: - canonical: | - <p>*foo <em>bar baz</em></p> - static: |- - <p data-sourcepos="1:1-1:14" dir="auto">*foo <em data-sourcepos="1:6-1:14">bar baz</em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__123: - canonical: | - <p>*<a href="/url">bar*</a></p> - static: |- - <p data-sourcepos="1:1-1:13" dir="auto">*<a data-sourcepos="1:2-1:13" href="/url">bar*</a></p> -06_05_00__inlines__emphasis_and_strong_emphasis__124: - canonical: | - <p>_foo <a href="/url">bar_</a></p> - static: |- - <p data-sourcepos="1:1-1:17" dir="auto">_foo <a data-sourcepos="1:6-1:17" href="/url">bar_</a></p> -06_05_00__inlines__emphasis_and_strong_emphasis__125: - canonical: | - <p>*<img src="foo" title="*"/></p> - static: |- - <p data-sourcepos="1:1-1:27" dir="auto">*<a class="no-attachment-icon" href="foo" target="_blank" rel="noopener noreferrer"><img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" title="*" decoding="async" class="lazy" data-src="foo"></a></p> -06_05_00__inlines__emphasis_and_strong_emphasis__126: - canonical: | - <p>**<a href="**"></p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto">**<a href="**"></a></p> -06_05_00__inlines__emphasis_and_strong_emphasis__127: - canonical: | - <p>__<a href="__"></p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto">__<a href="__"></a></p> -06_05_00__inlines__emphasis_and_strong_emphasis__128: - canonical: | - <p><em>a <code>*</code></em></p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto"><em data-sourcepos="1:1-1:7">a <code data-sourcepos="1:5-1:5">*</code></em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__129: - canonical: | - <p><em>a <code>_</code></em></p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto"><em data-sourcepos="1:1-1:7">a <code data-sourcepos="1:5-1:5">_</code></em></p> -06_05_00__inlines__emphasis_and_strong_emphasis__130: - canonical: | - <p>**a<a href="http://foo.bar/?q=**">http://foo.bar/?q=**</a></p> - static: |- - <p data-sourcepos="1:1-1:25" dir="auto">**a<a data-sourcepos="1:5-1:26" href="http://foo.bar/?q=**" rel="nofollow noreferrer noopener" target="_blank">http://foo.bar/?q=**</a></p> -06_05_00__inlines__emphasis_and_strong_emphasis__131: - canonical: | - <p>__a<a href="http://foo.bar/?q=__">http://foo.bar/?q=__</a></p> - static: |- - <p data-sourcepos="1:1-1:25" dir="auto">__a<a data-sourcepos="1:5-1:26" href="http://foo.bar/?q=__" rel="nofollow noreferrer noopener" target="_blank">http://foo.bar/?q=__</a></p> -06_06_00__inlines__strikethrough_extension__001: - canonical: | - <p><del>Hi</del> Hello, world!</p> - static: |- - <p data-sourcepos="1:1-1:20" dir="auto"><del data-sourcepos="1:1-1:6">Hi</del> Hello, world!</p> -06_06_00__inlines__strikethrough_extension__002: - canonical: | - <p>This ~~has a</p> - <p>new paragraph~~.</p> - static: |- - <p data-sourcepos="1:1-1:12" dir="auto">This ~~has a</p> - <p data-sourcepos="3:1-3:16" dir="auto">new paragraph~~.</p> -06_07_00__inlines__links__001: - canonical: | - <p><a href="/uri" title="title">link</a></p> - static: |- - <p data-sourcepos="1:1-1:20" dir="auto"><a data-sourcepos="1:1-1:20" href="/uri" title="title">link</a></p> -06_07_00__inlines__links__002: - canonical: | - <p><a href="/uri">link</a></p> - static: |- - <p data-sourcepos="1:1-1:12" dir="auto"><a data-sourcepos="1:1-1:12" href="/uri">link</a></p> -06_07_00__inlines__links__003: - canonical: | - <p><a href="">link</a></p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto"><a data-sourcepos="1:1-1:8" href="">link</a></p> -06_07_00__inlines__links__004: - canonical: | - <p><a href="">link</a></p> - static: |- - <p data-sourcepos="1:1-1:10" dir="auto"><a data-sourcepos="1:1-1:10" href="">link</a></p> -06_07_00__inlines__links__005: - canonical: | - <p>[link](/my uri)</p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto"><a data-sourcepos="1:1-1:17" href="/my%20uri">link</a></p> -06_07_00__inlines__links__006: - canonical: | - <p><a href="/my%20uri">link</a></p> - static: |- - <p data-sourcepos="1:1-1:17" dir="auto"><a data-sourcepos="1:1-1:17" href="/my%20uri">link</a></p> -06_07_00__inlines__links__007: - canonical: | - <p>[link](foo - bar)</p> - static: |- - <p data-sourcepos="1:1-2:4" dir="auto">[link](foo - bar)</p> -06_07_00__inlines__links__008: - canonical: | - <p>[link](<foo - bar>)</p> - static: |- - <p data-sourcepos="1:1-2:5" dir="auto">[link]()</p> -06_07_00__inlines__links__009: - canonical: | - <p><a href="b)c">a</a></p> - static: |- - <p data-sourcepos="1:1-1:10" dir="auto"><a data-sourcepos="1:1-1:10" href="b)c">a</a></p> -06_07_00__inlines__links__010: - canonical: | - <p>[link](<foo>)</p> - static: |- - <p data-sourcepos="1:1-1:14" dir="auto">[link](<foo>)</p> -06_07_00__inlines__links__011: - canonical: | - <p>[a](<b)c - [a](<b)c> - [a](<b>c)</p> - static: |- - <p data-sourcepos="1:1-3:9" dir="auto"><a data-sourcepos="1:1-1:10" href="%3Cb">a</a>c - <a data-sourcepos="1:1-1:10" href="%3Cb">a</a>c> - [a](<b>c)</b></p> -06_07_00__inlines__links__012: - canonical: | - <p><a href="(foo)">link</a></p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto"><a data-sourcepos="1:1-1:15" href="(foo)">link</a></p> -06_07_00__inlines__links__013: - canonical: | - <p><a href="foo(and(bar))">link</a></p> - static: |- - <p data-sourcepos="1:1-1:21" dir="auto"><a data-sourcepos="1:1-1:21" href="foo(and(bar))">link</a></p> -06_07_00__inlines__links__014: - canonical: | - <p><a href="foo(and(bar)">link</a></p> - static: |- - <p data-sourcepos="1:1-1:23" dir="auto"><a data-sourcepos="1:1-1:23" href="foo(and(bar)">link</a></p> -06_07_00__inlines__links__015: - canonical: | - <p><a href="foo(and(bar)">link</a></p> - static: |- - <p data-sourcepos="1:1-1:22" dir="auto"><a data-sourcepos="1:1-1:22" href="foo(and(bar)">link</a></p> -06_07_00__inlines__links__016: - canonical: | - <p><a href="foo):">link</a></p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto"><a data-sourcepos="1:1-1:15">link</a></p> -06_07_00__inlines__links__017: - canonical: | - <p><a href="#fragment">link</a></p> - <p><a href="http://example.com#fragment">link</a></p> - <p><a href="http://example.com?foo=3#frag">link</a></p> - static: |- - <p data-sourcepos="1:1-1:17" dir="auto"><a data-sourcepos="1:1-1:17" href="#fragment">link</a></p> - <p data-sourcepos="3:1-3:35" dir="auto"><a data-sourcepos="3:1-3:35" href="http://example.com#fragment" rel="nofollow noreferrer noopener" target="_blank">link</a></p> - <p data-sourcepos="5:1-5:37" dir="auto"><a data-sourcepos="5:1-5:37" href="http://example.com?foo=3#frag" rel="nofollow noreferrer noopener" target="_blank">link</a></p> -06_07_00__inlines__links__018: - canonical: | - <p><a href="foo%5Cbar">link</a></p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto"><a data-sourcepos="1:1-1:15" href="foo%5Cbar">link</a></p> -06_07_00__inlines__links__019: - canonical: | - <p><a href="foo%20b%C3%A4">link</a></p> - static: |- - <p data-sourcepos="1:1-1:21" dir="auto"><a data-sourcepos="1:1-1:21" href="foo%20b%C3%A4">link</a></p> -06_07_00__inlines__links__020: - canonical: | - <p><a href="%22title%22">link</a></p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto"><a data-sourcepos="1:1-1:15" href="%22title%22">link</a></p> -06_07_00__inlines__links__021: - canonical: | - <p><a href="/url" title="title">link</a> - <a href="/url" title="title">link</a> - <a href="/url" title="title">link</a></p> - static: |- - <p data-sourcepos="1:1-3:20" dir="auto"><a data-sourcepos="1:1-1:20" href="/url" title="title">link</a> - <a data-sourcepos="2:1-2:20" href="/url" title="title">link</a> - <a data-sourcepos="3:1-3:20" href="/url" title="title">link</a></p> -06_07_00__inlines__links__022: - canonical: | - <p><a href="/url" title="title """>link</a></p> - static: |- - <p data-sourcepos="1:1-1:29" dir="auto"><a data-sourcepos="1:1-1:29" href="/url" title='title ""'>link</a></p> -06_07_00__inlines__links__023: - canonical: | - <p><a href="/url%C2%A0%22title%22">link</a></p> - static: |- - <p data-sourcepos="1:1-1:21" dir="auto"><a data-sourcepos="1:1-1:21" href="/url%C2%A0%22title%22">link</a></p> -06_07_00__inlines__links__024: - canonical: | - <p>[link](/url "title "and" title")</p> - static: |- - <p data-sourcepos="1:1-1:32" dir="auto">[link](/url "title "and" title")</p> -06_07_00__inlines__links__025: - canonical: | - <p><a href="/url" title="title "and" title">link</a></p> - static: |- - <p data-sourcepos="1:1-1:32" dir="auto"><a data-sourcepos="1:1-1:32" href="/url" title='title "and" title'>link</a></p> -06_07_00__inlines__links__026: - canonical: | - <p><a href="/uri" title="title">link</a></p> - static: |- - <p data-sourcepos="1:1-2:12" dir="auto"><a data-sourcepos="1:1-1:25" href="/uri" title="title">link</a></p> -06_07_00__inlines__links__027: - canonical: | - <p>[link] (/uri)</p> - static: |- - <p data-sourcepos="1:1-1:13" dir="auto">[link] (/uri)</p> -06_07_00__inlines__links__028: - canonical: | - <p><a href="/uri">link [foo [bar]]</a></p> - static: |- - <p data-sourcepos="1:1-1:24" dir="auto"><a data-sourcepos="1:1-1:24" href="/uri">link [foo [bar]]</a></p> -06_07_00__inlines__links__029: - canonical: | - <p>[link] bar](/uri)</p> - static: |- - <p data-sourcepos="1:1-1:17" dir="auto">[link] bar](/uri)</p> -06_07_00__inlines__links__030: - canonical: | - <p>[link <a href="/uri">bar</a></p> - static: |- - <p data-sourcepos="1:1-1:17" dir="auto">[link <a data-sourcepos="1:7-1:17" href="/uri">bar</a></p> -06_07_00__inlines__links__031: - canonical: | - <p><a href="/uri">link [bar</a></p> - static: |- - <p data-sourcepos="1:1-1:18" dir="auto"><a data-sourcepos="1:1-1:18" href="/uri">link [bar</a></p> -06_07_00__inlines__links__032: - canonical: | - <p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p> - static: |- - <p data-sourcepos="1:1-1:30" dir="auto"><a data-sourcepos="1:1-1:30" href="/uri">link <em data-sourcepos="1:7-1:23">foo <strong data-sourcepos="1:12-1:18">bar</strong> <code data-sourcepos="1:21-1:21">#</code></em></a></p> -06_07_00__inlines__links__033: - canonical: | - <p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p> - static: |- - <p data-sourcepos="1:1-1:25" dir="auto"><a data-sourcepos="1:1-1:25" href="/uri"><img data-sourcepos="1:2-1:18" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="moon" decoding="async" class="lazy" data-src="moon.jpg"></a></p> -06_07_00__inlines__links__034: - canonical: | - <p>[foo <a href="/uri">bar</a>](/uri)</p> - static: |- - <p data-sourcepos="1:1-1:23" dir="auto">[foo <a data-sourcepos="1:6-1:16" href="/uri">bar</a>](/uri)</p> -06_07_00__inlines__links__035: - canonical: | - <p>[foo <em>[bar <a href="/uri">baz</a>](/uri)</em>](/uri)</p> - static: |- - <p data-sourcepos="1:1-1:37" dir="auto">[foo <em data-sourcepos="1:6-1:30">[bar <a data-sourcepos="1:12-1:22" href="/uri">baz</a>](/uri)</em>](/uri)</p> -06_07_00__inlines__links__036: - canonical: | - <p><img src="uri3" alt="[foo](uri2)" /></p> - static: |- - <p data-sourcepos="1:1-1:28" dir="auto"><a class="no-attachment-icon" href="uri3" target="_blank" rel="noopener noreferrer"><img data-sourcepos="1:1-1:28" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="[foo](uri2)" decoding="async" class="lazy" data-src="uri3"></a></p> -06_07_00__inlines__links__037: - canonical: | - <p>*<a href="/uri">foo*</a></p> - static: |- - <p data-sourcepos="1:1-1:13" dir="auto">*<a data-sourcepos="1:2-1:13" href="/uri">foo*</a></p> -06_07_00__inlines__links__038: - canonical: | - <p><a href="baz*">foo *bar</a></p> - static: |- - <p data-sourcepos="1:1-1:16" dir="auto"><a data-sourcepos="1:1-1:16" href="baz*">foo *bar</a></p> -06_07_00__inlines__links__039: - canonical: | - <p><em>foo [bar</em> baz]</p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto"><em data-sourcepos="1:1-1:10">foo [bar</em> baz]</p> -06_07_00__inlines__links__040: - canonical: | - <p>[foo <bar attr="](baz)"></p> - static: |- - <p data-sourcepos="1:1-1:24" dir="auto">[foo </p> -06_07_00__inlines__links__041: - canonical: | - <p>[foo<code>](/uri)</code></p> - static: |- - <p data-sourcepos="1:1-1:13" dir="auto">[foo<code data-sourcepos="1:6-1:12">](/uri)</code></p> -06_07_00__inlines__links__042: - canonical: | - <p>[foo<a href="http://example.com/?search=%5D(uri)">http://example.com/?search=](uri)</a></p> - static: |- - <p data-sourcepos="1:1-1:39" dir="auto">[foo<a data-sourcepos="1:6-1:40" href="http://example.com/?search=%5D(uri)" rel="nofollow noreferrer noopener" target="_blank">http://example.com/?search=](uri)</a></p> -06_07_00__inlines__links__043: - canonical: | - <p><a href="/url" title="title">foo</a></p> - static: |- - <p data-sourcepos="1:1-1:10" dir="auto"><a data-sourcepos="1:1-1:10" href="/url" title="title">foo</a></p> -06_07_00__inlines__links__044: - canonical: | - <p><a href="/uri">link [foo [bar]]</a></p> - static: |- - <p data-sourcepos="1:1-1:23" dir="auto"><a data-sourcepos="1:1-1:23" href="/uri">link [foo [bar]]</a></p> -06_07_00__inlines__links__045: - canonical: | - <p><a href="/uri">link [bar</a></p> - static: |- - <p data-sourcepos="1:1-1:17" dir="auto"><a data-sourcepos="1:1-1:17" href="/uri">link [bar</a></p> -06_07_00__inlines__links__046: - canonical: | - <p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p> - static: |- - <p data-sourcepos="1:1-1:29" dir="auto"><a data-sourcepos="1:1-1:29" href="/uri">link <em data-sourcepos="1:7-1:23">foo <strong data-sourcepos="1:12-1:18">bar</strong> <code data-sourcepos="1:21-1:21">#</code></em></a></p> -06_07_00__inlines__links__047: - canonical: | - <p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p> - static: |- - <p data-sourcepos="1:1-1:24" dir="auto"><a data-sourcepos="1:1-1:24" href="/uri"><img data-sourcepos="1:2-1:18" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="moon" decoding="async" class="lazy" data-src="moon.jpg"></a></p> -06_07_00__inlines__links__048: - canonical: | - <p>[foo <a href="/uri">bar</a>]<a href="/uri">ref</a></p> - static: |- - <p data-sourcepos="1:1-1:22" dir="auto">[foo <a data-sourcepos="1:6-1:16" href="/uri">bar</a>]<a data-sourcepos="1:18-1:22" href="/uri">ref</a></p> -06_07_00__inlines__links__049: - canonical: | - <p>[foo <em>bar <a href="/uri">baz</a></em>]<a href="/uri">ref</a></p> - static: |- - <p data-sourcepos="1:1-1:27" dir="auto">[foo <em data-sourcepos="1:6-1:21">bar <a data-sourcepos="1:11-1:20" href="/uri">baz</a></em>]<a data-sourcepos="1:23-1:27" href="/uri">ref</a></p> -06_07_00__inlines__links__050: - canonical: | - <p>*<a href="/uri">foo*</a></p> - static: |- - <p data-sourcepos="1:1-1:12" dir="auto">*<a data-sourcepos="1:2-1:12" href="/uri">foo*</a></p> -06_07_00__inlines__links__051: - canonical: | - <p><a href="/uri">foo *bar</a></p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto"><a data-sourcepos="1:1-1:15" href="/uri">foo *bar</a></p> -06_07_00__inlines__links__052: - canonical: | - <p>[foo <bar attr="][ref]"></p> - static: |- - <p data-sourcepos="1:1-1:24" dir="auto">[foo </p> -06_07_00__inlines__links__053: - canonical: | - <p>[foo<code>][ref]</code></p> - static: |- - <p data-sourcepos="1:1-1:12" dir="auto">[foo<code data-sourcepos="1:6-1:11">][ref]</code></p> -06_07_00__inlines__links__054: - canonical: | - <p>[foo<a href="http://example.com/?search=%5D%5Bref%5D">http://example.com/?search=][ref]</a></p> - static: |- - <p data-sourcepos="1:1-1:39" dir="auto">[foo<a data-sourcepos="1:6-1:40" href="http://example.com/?search=%5D%5Bref%5D" rel="nofollow noreferrer noopener" target="_blank">http://example.com/?search=][ref]</a></p> -06_07_00__inlines__links__055: - canonical: | - <p><a href="/url" title="title">foo</a></p> - static: |- - <p data-sourcepos="1:1-1:10" dir="auto"><a data-sourcepos="1:1-1:10" href="/url" title="title">foo</a></p> -06_07_00__inlines__links__056: - canonical: | - <p><a href="/url">Толпой</a> is a Russian word.</p> - static: |- - <p data-sourcepos="1:1-1:47" dir="auto"><a data-sourcepos="1:1-1:28" href="/url">Толпой</a> is a Russian word.</p> -06_07_00__inlines__links__057: - canonical: | - <p><a href="/url">Baz</a></p> - static: |- - <p data-sourcepos="4:1-4:14" dir="auto"><a data-sourcepos="4:1-4:14" href="/url">Baz</a></p> -06_07_00__inlines__links__058: - canonical: | - <p>[foo] <a href="/url" title="title">bar</a></p> - static: |- - <p data-sourcepos="1:1-1:11" dir="auto">[foo] <a data-sourcepos="1:7-1:11" href="/url" title="title">bar</a></p> -06_07_00__inlines__links__059: - canonical: | - <p>[foo] - <a href="/url" title="title">bar</a></p> - static: |- - <p data-sourcepos="1:1-2:5" dir="auto">[foo] - <a data-sourcepos="2:1-2:5" href="/url" title="title">bar</a></p> -06_07_00__inlines__links__060: - canonical: | - <p><a href="/url1">bar</a></p> - static: |- - <p data-sourcepos="5:1-5:10" dir="auto"><a data-sourcepos="5:1-5:10" href="/url1">bar</a></p> -06_07_00__inlines__links__061: - canonical: | - <p>[bar][foo!]</p> - static: |- - <p data-sourcepos="1:1-1:12" dir="auto">[bar][foo<span data-escaped-char data-sourcepos="1:10-1:11">!</span>]</p> -06_07_00__inlines__links__062: - canonical: | - <p>[foo][ref[]</p> - <p>[ref[]: /uri</p> - static: |- - <p data-sourcepos="1:1-1:11" dir="auto">[foo][ref[]</p> - <p data-sourcepos="3:1-3:12" dir="auto">[ref[]: /uri</p> -06_07_00__inlines__links__063: - canonical: | - <p>[foo][ref[bar]]</p> - <p>[ref[bar]]: /uri</p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto">[foo][ref[bar]]</p> - <p data-sourcepos="3:1-3:16" dir="auto">[ref[bar]]: /uri</p> -06_07_00__inlines__links__064: - canonical: | - <p>[[[foo]]]</p> - <p>[[[foo]]]: /url</p> - static: |- - <p data-sourcepos="1:1-1:9" dir="auto">[[[foo]]]</p> - <p data-sourcepos="3:1-3:15" dir="auto">[[[foo]]]: /url</p> -06_07_00__inlines__links__065: - canonical: | - <p><a href="/uri">foo</a></p> - static: |- - <p data-sourcepos="1:1-1:12" dir="auto"><a data-sourcepos="1:1-1:12" href="/uri">foo</a></p> -06_07_00__inlines__links__066: - canonical: | - <p><a href="/uri">bar\</a></p> - static: |- - <p data-sourcepos="3:1-3:7" dir="auto"><a data-sourcepos="3:1-3:7" href="/uri">bar\</a></p> -06_07_00__inlines__links__067: - canonical: | - <p>[]</p> - <p>[]: /uri</p> - static: |- - <p data-sourcepos="1:1-1:2" dir="auto">[]</p> - <p data-sourcepos="3:1-3:8" dir="auto">[]: /uri</p> -06_07_00__inlines__links__068: - canonical: | - <p>[ - ]</p> - <p>[ - ]: /uri</p> - static: |- - <p data-sourcepos="1:1-2:2" dir="auto">[ - ]</p> - <p data-sourcepos="4:1-5:8" dir="auto">[ - ]: /uri</p> -06_07_00__inlines__links__069: - canonical: | - <p><a href="/url" title="title">foo</a></p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto"><a data-sourcepos="1:1-1:7" href="/url" title="title">foo</a></p> -06_07_00__inlines__links__070: - canonical: | - <p><a href="/url" title="title"><em>foo</em> bar</a></p> - static: |- - <p data-sourcepos="1:1-1:13" dir="auto"><a data-sourcepos="1:1-1:13" href="/url" title="title"><em data-sourcepos="1:2-1:6">foo</em> bar</a></p> -06_07_00__inlines__links__071: - canonical: | - <p><a href="/url" title="title">Foo</a></p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto"><a data-sourcepos="1:1-1:7" href="/url" title="title">Foo</a></p> -06_07_00__inlines__links__072: - canonical: | - <p><a href="/url" title="title">foo</a> - []</p> - static: |- - <p data-sourcepos="1:1-2:2" dir="auto"><a data-sourcepos="1:1-1:5" href="/url" title="title">foo</a> - []</p> -06_07_00__inlines__links__073: - canonical: | - <p><a href="/url" title="title">foo</a></p> - static: |- - <p data-sourcepos="1:1-1:5" dir="auto"><a data-sourcepos="1:1-1:5" href="/url" title="title">foo</a></p> -06_07_00__inlines__links__074: - canonical: | - <p><a href="/url" title="title"><em>foo</em> bar</a></p> - static: |- - <p data-sourcepos="1:1-1:11" dir="auto"><a data-sourcepos="1:1-1:11" href="/url" title="title"><em data-sourcepos="1:2-1:6">foo</em> bar</a></p> -06_07_00__inlines__links__075: - canonical: | - <p>[<a href="/url" title="title"><em>foo</em> bar</a>]</p> - static: |- - <p data-sourcepos="1:1-1:13" dir="auto"><a data-sourcepos="1:1-1:13" href="*foo*%20bar" data-wikilink="true">*foo* bar</a></p> -06_07_00__inlines__links__076: - canonical: | - <p>[[bar <a href="/url">foo</a></p> - static: |- - <p data-sourcepos="1:1-1:11" dir="auto">[[bar <a data-sourcepos="1:7-1:11" href="/url">foo</a></p> -06_07_00__inlines__links__077: - canonical: | - <p><a href="/url" title="title">Foo</a></p> - static: |- - <p data-sourcepos="1:1-1:5" dir="auto"><a data-sourcepos="1:1-1:5" href="/url" title="title">Foo</a></p> -06_07_00__inlines__links__078: - canonical: | - <p><a href="/url">foo</a> bar</p> - static: |- - <p data-sourcepos="1:1-1:9" dir="auto"><a data-sourcepos="1:1-1:5" href="/url">foo</a> bar</p> -06_07_00__inlines__links__079: - canonical: | - <p>[foo]</p> - static: |- - <p data-sourcepos="1:1-1:6" dir="auto">[foo]</p> -06_07_00__inlines__links__080: - canonical: | - <p>*<a href="/url">foo*</a></p> - static: |- - <p data-sourcepos="3:1-3:7" dir="auto">*<a data-sourcepos="3:2-3:7" href="/url">foo*</a></p> -06_07_00__inlines__links__081: - canonical: | - <p><a href="/url2">foo</a></p> - static: |- - <p data-sourcepos="1:1-1:10" dir="auto"><a data-sourcepos="1:1-1:10" href="/url2">foo</a></p> -06_07_00__inlines__links__082: - canonical: | - <p><a href="/url1">foo</a></p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto"><a data-sourcepos="1:1-1:7" href="/url1">foo</a></p> -06_07_00__inlines__links__083: - canonical: | - <p><a href="">foo</a></p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto"><a data-sourcepos="1:1-1:7" href="">foo</a></p> -06_07_00__inlines__links__084: - canonical: | - <p><a href="/url1">foo</a>(not a link)</p> - static: |- - <p data-sourcepos="1:1-1:17" dir="auto"><a data-sourcepos="1:1-1:5" href="/url1">foo</a>(not a link)</p> -06_07_00__inlines__links__085: - canonical: | - <p>[foo]<a href="/url">bar</a></p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto">[foo]<a data-sourcepos="1:6-1:15" href="/url">bar</a></p> -06_07_00__inlines__links__086: - canonical: | - <p><a href="/url2">foo</a><a href="/url1">baz</a></p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto"><a data-sourcepos="1:1-1:10" href="/url2">foo</a><a data-sourcepos="1:11-1:15" href="/url1">baz</a></p> -06_07_00__inlines__links__087: - canonical: | - <p>[foo]<a href="/url1">bar</a></p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto">[foo]<a data-sourcepos="1:6-1:15" href="/url1">bar</a></p> -06_08_00__inlines__images__001: - canonical: | - <p><img src="/url" alt="foo" title="title" /></p> - static: |- - <p data-sourcepos="1:1-1:20" dir="auto"><a class="no-attachment-icon" href="/url" target="_blank" rel="noopener noreferrer"><img data-sourcepos="1:1-1:20" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo" title="title" decoding="async" class="lazy" data-src="/url"></a></p> -06_08_00__inlines__images__002: - canonical: | - <p><img src="train.jpg" alt="foo bar" title="train & tracks" /></p> - static: |- - <p data-sourcepos="1:1-1:12" dir="auto"><a class="no-attachment-icon" href="train.jpg" target="_blank" rel="noopener noreferrer"><img data-sourcepos="1:1-1:12" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo bar" title="train & tracks" decoding="async" class="lazy" data-src="train.jpg"></a></p> -06_08_00__inlines__images__003: - canonical: | - <p><img src="/url2" alt="foo bar" /></p> - static: |- - <p data-sourcepos="1:1-1:26" dir="auto"><a class="no-attachment-icon" href="/url2" target="_blank" rel="noopener noreferrer"><img data-sourcepos="1:1-1:26" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo bar" decoding="async" class="lazy" data-src="/url2"></a></p> -06_08_00__inlines__images__004: - canonical: | - <p><img src="/url2" alt="foo bar" /></p> - static: |- - <p data-sourcepos="1:1-1:25" dir="auto"><a class="no-attachment-icon" href="/url2" target="_blank" rel="noopener noreferrer"><img data-sourcepos="1:1-1:25" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo bar" decoding="async" class="lazy" data-src="/url2"></a></p> -06_08_00__inlines__images__005: - canonical: | - <p><img src="train.jpg" alt="foo bar" title="train & tracks" /></p> - static: |- - <p data-sourcepos="1:1-1:14" dir="auto"><a class="no-attachment-icon" href="train.jpg" target="_blank" rel="noopener noreferrer"><img data-sourcepos="1:1-1:14" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo bar" title="train & tracks" decoding="async" class="lazy" data-src="train.jpg"></a></p> -06_08_00__inlines__images__006: - canonical: | - <p><img src="train.jpg" alt="foo bar" title="train & tracks" /></p> - static: |- - <p data-sourcepos="1:1-1:20" dir="auto"><a class="no-attachment-icon" href="train.jpg" target="_blank" rel="noopener noreferrer"><img data-sourcepos="1:1-1:20" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo bar" title="train & tracks" decoding="async" class="lazy" data-src="train.jpg"></a></p> -06_08_00__inlines__images__007: - canonical: | - <p><img src="train.jpg" alt="foo" /></p> - static: |- - <p data-sourcepos="1:1-1:17" dir="auto"><a class="no-attachment-icon" href="train.jpg" target="_blank" rel="noopener noreferrer"><img data-sourcepos="1:1-1:17" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo" decoding="async" class="lazy" data-src="train.jpg"></a></p> -06_08_00__inlines__images__008: - canonical: | - <p>My <img src="/path/to/train.jpg" alt="foo bar" title="title" /></p> - static: |- - <p data-sourcepos="1:1-1:45" dir="auto">My <a class="no-attachment-icon" href="/path/to/train.jpg" target="_blank" rel="noopener noreferrer"><img data-sourcepos="1:4-1:45" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo bar" title="title" decoding="async" class="lazy" data-src="/path/to/train.jpg"></a></p> -06_08_00__inlines__images__009: - canonical: | - <p><img src="url" alt="foo" /></p> - static: |- - <p data-sourcepos="1:1-1:13" dir="auto"><a class="no-attachment-icon" href="url" target="_blank" rel="noopener noreferrer"><img data-sourcepos="1:1-1:13" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo" decoding="async" class="lazy" data-src="url"></a></p> -06_08_00__inlines__images__010: - canonical: | - <p><img src="/url" alt="" /></p> - static: |- - <p data-sourcepos="1:1-1:9" dir="auto"><a class="no-attachment-icon" href="/url" target="_blank" rel="noopener noreferrer"><img data-sourcepos="1:1-1:9" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="" decoding="async" class="lazy" data-src="/url"></a></p> -06_08_00__inlines__images__011: - canonical: | - <p><img src="/url" alt="foo" /></p> - static: |- - <p data-sourcepos="1:1-1:11" dir="auto"><a class="no-attachment-icon" href="/url" target="_blank" rel="noopener noreferrer"><img data-sourcepos="1:1-1:11" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo" decoding="async" class="lazy" data-src="/url"></a></p> -06_08_00__inlines__images__012: - canonical: | - <p><img src="/url" alt="foo" /></p> - static: |- - <p data-sourcepos="1:1-1:11" dir="auto"><a class="no-attachment-icon" href="/url" target="_blank" rel="noopener noreferrer"><img data-sourcepos="1:1-1:11" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo" decoding="async" class="lazy" data-src="/url"></a></p> -06_08_00__inlines__images__013: - canonical: | - <p><img src="/url" alt="foo" title="title" /></p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto"><a class="no-attachment-icon" href="/url" target="_blank" rel="noopener noreferrer"><img data-sourcepos="1:1-1:8" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo" title="title" decoding="async" class="lazy" data-src="/url"></a></p> -06_08_00__inlines__images__014: - canonical: | - <p><img src="/url" alt="foo bar" title="title" /></p> - static: |- - <p data-sourcepos="1:1-1:14" dir="auto"><a class="no-attachment-icon" href="/url" target="_blank" rel="noopener noreferrer"><img data-sourcepos="1:1-1:14" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo bar" title="title" decoding="async" class="lazy" data-src="/url"></a></p> -06_08_00__inlines__images__015: - canonical: | - <p><img src="/url" alt="Foo" title="title" /></p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto"><a class="no-attachment-icon" href="/url" target="_blank" rel="noopener noreferrer"><img data-sourcepos="1:1-1:8" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="Foo" title="title" decoding="async" class="lazy" data-src="/url"></a></p> -06_08_00__inlines__images__016: - canonical: | - <p><img src="/url" alt="foo" title="title" /> - []</p> - static: |- - <p data-sourcepos="1:1-2:2" dir="auto"><a class="no-attachment-icon" href="/url" target="_blank" rel="noopener noreferrer"><img data-sourcepos="1:1-1:6" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo" title="title" decoding="async" class="lazy" data-src="/url"></a> - []</p> -06_08_00__inlines__images__017: - canonical: | - <p><img src="/url" alt="foo" title="title" /></p> - static: |- - <p data-sourcepos="1:1-1:6" dir="auto"><a class="no-attachment-icon" href="/url" target="_blank" rel="noopener noreferrer"><img data-sourcepos="1:1-1:6" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo" title="title" decoding="async" class="lazy" data-src="/url"></a></p> -06_08_00__inlines__images__018: - canonical: | - <p><img src="/url" alt="foo bar" title="title" /></p> - static: |- - <p data-sourcepos="1:1-1:12" dir="auto"><a class="no-attachment-icon" href="/url" target="_blank" rel="noopener noreferrer"><img data-sourcepos="1:1-1:12" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="foo bar" title="title" decoding="async" class="lazy" data-src="/url"></a></p> -06_08_00__inlines__images__019: - canonical: | - <p>![[foo]]</p> - <p>[[foo]]: /url "title"</p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto">![[foo]]</p> - <p data-sourcepos="3:1-3:21" dir="auto"><a data-sourcepos="3:1-3:7" href="foo" data-wikilink="true">foo</a>: /url "title"</p> -06_08_00__inlines__images__020: - canonical: | - <p><img src="/url" alt="Foo" title="title" /></p> - static: |- - <p data-sourcepos="1:1-1:6" dir="auto"><a class="no-attachment-icon" href="/url" target="_blank" rel="noopener noreferrer"><img data-sourcepos="1:1-1:6" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="Foo" title="title" decoding="async" class="lazy" data-src="/url"></a></p> -06_08_00__inlines__images__021: - canonical: | - <p>![foo]</p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto">![foo]</p> -06_08_00__inlines__images__022: - canonical: | - <p>!<a href="/url" title="title">foo</a></p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto"><span data-escaped-char data-sourcepos="1:1-1:2">!</span><a data-sourcepos="1:3-1:7" href="/url" title="title">foo</a></p> -06_09_00__inlines__autolinks__001: - canonical: | - <p><a href="http://foo.bar.baz">http://foo.bar.baz</a></p> - static: |- - <p data-sourcepos="1:1-1:20" dir="auto"><a data-sourcepos="1:2-1:21" href="http://foo.bar.baz" rel="nofollow noreferrer noopener" target="_blank">http://foo.bar.baz</a></p> -06_09_00__inlines__autolinks__002: - canonical: | - <p><a href="http://foo.bar.baz/test?q=hello&id=22&boolean">http://foo.bar.baz/test?q=hello&id=22&boolean</a></p> - static: |- - <p data-sourcepos="1:1-1:47" dir="auto"><a data-sourcepos="1:2-1:48" href="http://foo.bar.baz/test?q=hello&id=22&boolean" rel="nofollow noreferrer noopener" target="_blank">http://foo.bar.baz/test?q=hello&id=22&boolean</a></p> -06_09_00__inlines__autolinks__003: - canonical: | - <p><a href="irc://foo.bar:2233/baz">irc://foo.bar:2233/baz</a></p> - static: |- - <p data-sourcepos="1:1-1:24" dir="auto"><a data-sourcepos="1:2-1:25" href="irc://foo.bar:2233/baz">irc://foo.bar:2233/baz</a></p> -06_09_00__inlines__autolinks__004: - canonical: | - <p><a href="MAILTO:FOO@BAR.BAZ">MAILTO:FOO@BAR.BAZ</a></p> - static: |- - <p data-sourcepos="1:1-1:20" dir="auto"><a data-sourcepos="1:2-1:21" href="mailto:FOO@BAR.BAZ">MAILTO:FOO@BAR.BAZ</a></p> -06_09_00__inlines__autolinks__005: - canonical: | - <p><a href="a+b+c:d">a+b+c:d</a></p> - static: |- - <p data-sourcepos="1:1-1:9" dir="auto"><a data-sourcepos="1:2-1:10" href="a+b+c:d">a+b+c:d</a></p> -06_09_00__inlines__autolinks__006: - canonical: | - <p><a href="made-up-scheme://foo,bar">made-up-scheme://foo,bar</a></p> - static: |- - <p data-sourcepos="1:1-1:26" dir="auto"><a data-sourcepos="1:2-1:27" href="made-up-scheme://foo,bar">made-up-scheme://foo,bar</a></p> -06_09_00__inlines__autolinks__007: - canonical: | - <p><a href="http://../">http://../</a></p> - static: |- - <p data-sourcepos="1:1-1:12" dir="auto"><a data-sourcepos="1:2-1:13" href="http://../" rel="nofollow noreferrer noopener" target="_blank">http://../</a></p> -06_09_00__inlines__autolinks__008: - canonical: | - <p><a href="localhost:5001/foo">localhost:5001/foo</a></p> - static: |- - <p data-sourcepos="1:1-1:20" dir="auto"><a data-sourcepos="1:2-1:21" href="localhost:5001/foo">localhost:5001/foo</a></p> -06_09_00__inlines__autolinks__009: - canonical: | - <p><http://foo.bar/baz bim></p> - static: |- - <p data-sourcepos="1:1-1:24" dir="auto"><<a href="http://foo.bar/baz" rel="nofollow noreferrer noopener" target="_blank">http://foo.bar/baz</a> bim></p> -06_09_00__inlines__autolinks__010: - canonical: | - <p><a href="http://example.com/%5C%5B%5C">http://example.com/\[\</a></p> - static: |- - <p data-sourcepos="1:1-1:24" dir="auto"><a data-sourcepos="1:2-1:25" href="http://example.com/%5C%5B%5C" rel="nofollow noreferrer noopener" target="_blank">http://example.com/\[\</a></p> -06_09_00__inlines__autolinks__011: - canonical: | - <p><a href="mailto:foo@bar.example.com">foo@bar.example.com</a></p> - static: |- - <p data-sourcepos="1:1-1:21" dir="auto"><a data-sourcepos="1:2-1:22" href="mailto:foo@bar.example.com">foo@bar.example.com</a></p> -06_09_00__inlines__autolinks__012: - canonical: | - <p><a href="mailto:foo+special@Bar.baz-bar0.com">foo+special@Bar.baz-bar0.com</a></p> - static: |- - <p data-sourcepos="1:1-1:30" dir="auto"><a data-sourcepos="1:2-1:31" href="mailto:foo+special@Bar.baz-bar0.com">foo+special@Bar.baz-bar0.com</a></p> -06_09_00__inlines__autolinks__013: - canonical: | - <p><foo+@bar.example.com></p> - static: |- - <p data-sourcepos="1:1-1:23" dir="auto"><foo+@bar.example.com></p> -06_09_00__inlines__autolinks__014: - canonical: | - <p><></p> - static: |- - <p data-sourcepos="1:1-1:2" dir="auto"><></p> -06_09_00__inlines__autolinks__015: - canonical: | - <p>< http://foo.bar ></p> - static: |- - <p data-sourcepos="1:1-1:18" dir="auto">< <a href="http://foo.bar" rel="nofollow noreferrer noopener" target="_blank">http://foo.bar</a> ></p> -06_09_00__inlines__autolinks__016: - canonical: | - <p><m:abc></p> - static: |- - <p data-sourcepos="1:1-1:7" dir="auto"><m:abc></p> -06_09_00__inlines__autolinks__017: - canonical: | - <p><foo.bar.baz></p> - static: |- - <p data-sourcepos="1:1-1:13" dir="auto"><foo.bar.baz></p> -06_09_00__inlines__autolinks__018: - canonical: | - <p>http://example.com</p> - static: |- - <p data-sourcepos="1:1-1:18" dir="auto"><a href="http://example.com" rel="nofollow noreferrer noopener" target="_blank">http://example.com</a></p> -06_09_00__inlines__autolinks__019: - canonical: | - <p>foo@bar.example.com</p> - static: |- - <p data-sourcepos="1:1-1:19" dir="auto"><a href="mailto:foo@bar.example.com">foo@bar.example.com</a></p> -06_10_00__inlines__autolinks_extension__001: - canonical: | - <p><a href="http://www.commonmark.org">www.commonmark.org</a></p> - static: |- - <p data-sourcepos="1:1-1:18" dir="auto"><a href="http://www.commonmark.org" rel="nofollow noreferrer noopener" target="_blank">www.commonmark.org</a></p> -06_10_00__inlines__autolinks_extension__002: - canonical: | - <p>Visit <a href="http://www.commonmark.org/help">www.commonmark.org/help</a> for more information.</p> - static: |- - <p data-sourcepos="1:1-1:51" dir="auto">Visit <a href="http://www.commonmark.org/help" rel="nofollow noreferrer noopener" target="_blank">www.commonmark.org/help</a> for more information.</p> -06_10_00__inlines__autolinks_extension__003: - canonical: | - <p>Visit <a href="http://www.commonmark.org">www.commonmark.org</a>.</p> - <p>Visit <a href="http://www.commonmark.org/a.b">www.commonmark.org/a.b</a>.</p> - static: |- - <p data-sourcepos="1:1-1:25" dir="auto">Visit <a href="http://www.commonmark.org" rel="nofollow noreferrer noopener" target="_blank">www.commonmark.org</a>.</p> - <p data-sourcepos="3:1-3:29" dir="auto">Visit <a href="http://www.commonmark.org/a.b" rel="nofollow noreferrer noopener" target="_blank">www.commonmark.org/a.b</a>.</p> -06_10_00__inlines__autolinks_extension__004: - canonical: | - <p><a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a></p> - <p><a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a>))</p> - <p>(<a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a>)</p> - <p>(<a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a></p> - static: |- - <p data-sourcepos="1:1-1:41" dir="auto"><a href="http://www.google.com/search?q=Markup+(business)" rel="nofollow noreferrer noopener" target="_blank">www.google.com/search?q=Markup+(business)</a></p> - <p data-sourcepos="3:1-3:43" dir="auto"><a href="http://www.google.com/search?q=Markup+(business)" rel="nofollow noreferrer noopener" target="_blank">www.google.com/search?q=Markup+(business)</a>))</p> - <p data-sourcepos="5:1-5:43" dir="auto">(<a href="http://www.google.com/search?q=Markup+(business)" rel="nofollow noreferrer noopener" target="_blank">www.google.com/search?q=Markup+(business)</a>)</p> - <p data-sourcepos="7:1-7:42" dir="auto">(<a href="http://www.google.com/search?q=Markup+(business)" rel="nofollow noreferrer noopener" target="_blank">www.google.com/search?q=Markup+(business)</a></p> -06_10_00__inlines__autolinks_extension__005: - canonical: | - <p><a href="http://www.google.com/search?q=(business))+ok">www.google.com/search?q=(business))+ok</a></p> - static: |- - <p data-sourcepos="1:1-1:38" dir="auto"><a href="http://www.google.com/search?q=(business))+ok" rel="nofollow noreferrer noopener" target="_blank">www.google.com/search?q=(business))+ok</a></p> -06_10_00__inlines__autolinks_extension__006: - canonical: | - <p><a href="http://www.google.com/search?q=commonmark&hl=en">www.google.com/search?q=commonmark&hl=en</a></p> - <p><a href="http://www.google.com/search?q=commonmark">www.google.com/search?q=commonmark</a>&hl;</p> - static: |- - <p data-sourcepos="1:1-1:40" dir="auto"><a href="http://www.google.com/search?q=commonmark&hl=en" rel="nofollow noreferrer noopener" target="_blank">www.google.com/search?q=commonmark&hl=en</a></p> - <p data-sourcepos="3:1-3:38" dir="auto"><a href="http://www.google.com/search?q=commonmark" rel="nofollow noreferrer noopener" target="_blank">www.google.com/search?q=commonmark</a>&hl;</p> -06_10_00__inlines__autolinks_extension__007: - canonical: | - <p><a href="http://www.commonmark.org/he">www.commonmark.org/he</a><lp</p> - static: |- - <p data-sourcepos="1:1-1:24" dir="auto"><a href="http://www.commonmark.org/he" rel="nofollow noreferrer noopener" target="_blank">www.commonmark.org/he</a><lp</p> -06_10_00__inlines__autolinks_extension__008: - canonical: | - <p><a href="http://commonmark.org">http://commonmark.org</a></p> - <p>(Visit <a href="https://encrypted.google.com/search?q=Markup+(business)">https://encrypted.google.com/search?q=Markup+(business)</a>)</p> - <p>Anonymous FTP is available at <a href="ftp://foo.bar.baz">ftp://foo.bar.baz</a>.</p> - static: |- - <p data-sourcepos="1:1-1:21" dir="auto"><a href="http://commonmark.org" rel="nofollow noreferrer noopener" target="_blank">http://commonmark.org</a></p> - <p data-sourcepos="3:1-3:63" dir="auto">(Visit <a href="https://encrypted.google.com/search?q=Markup+(business)" rel="nofollow noreferrer noopener" target="_blank">https://encrypted.google.com/search?q=Markup+(business)</a>)</p> - <p data-sourcepos="5:1-5:48" dir="auto">Anonymous FTP is available at <a href="ftp://foo.bar.baz/">ftp://foo.bar.baz</a>.</p> -06_10_00__inlines__autolinks_extension__009: - canonical: | - <p><a href="mailto:foo@bar.baz">foo@bar.baz</a></p> - static: |- - <p data-sourcepos="1:1-1:11" dir="auto"><a href="mailto:foo@bar.baz">foo@bar.baz</a></p> -06_10_00__inlines__autolinks_extension__010: - canonical: | - <p>hello@mail+xyz.example isn't valid, but <a href="mailto:hello+xyz@mail.example">hello+xyz@mail.example</a> is.</p> - static: |- - <p data-sourcepos="1:1-1:66" dir="auto">hello@mail+xyz.example isn't valid, but <a href="mailto:hello+xyz@mail.example">hello+xyz@mail.example</a> is.</p> -06_10_00__inlines__autolinks_extension__011: - canonical: | - <p><a href="mailto:a.b-c_d@a.b">a.b-c_d@a.b</a></p> - <p><a href="mailto:a.b-c_d@a.b">a.b-c_d@a.b</a>.</p> - <p>a.b-c_d@a.b-</p> - <p>a.b-c_d@a.b_</p> - static: |- - <p data-sourcepos="1:1-1:11" dir="auto"><a href="mailto:a.b-c_d@a.b">a.b-c_d@a.b</a></p> - <p data-sourcepos="3:1-3:12" dir="auto"><a href="mailto:a.b-c_d@a.b">a.b-c_d@a.b</a>.</p> - <p data-sourcepos="5:1-5:12" dir="auto">a.b-c_d@a.b-</p> - <p data-sourcepos="7:1-7:12" dir="auto">a.b-c_d@a.b_</p> -06_11_00__inlines__raw_html__001: - canonical: | - <p><a><bab><c2c></p> - static: |- - <p data-sourcepos="1:1-1:13" dir="auto"><a></a></p> -06_11_00__inlines__raw_html__002: - canonical: | - <p><a/><b2/></p> - static: |- - <p data-sourcepos="1:1-1:9" dir="auto"><a></a></p> -06_11_00__inlines__raw_html__003: - canonical: | - <p><a /><b2 - data="foo" ></p> - static: |- - <p data-sourcepos="1:1-2:12" dir="auto"><a></a></p> -06_11_00__inlines__raw_html__004: - canonical: | - <p><a foo="bar" bam = 'baz <em>"</em>' - _boolean zoop:33=zoop:33 /></p> - static: |- - <p data-sourcepos="1:1-2:27" dir="auto"><a></a></p> -06_11_00__inlines__raw_html__005: - canonical: | - <p>Foo <responsive-image src="foo.jpg" /></p> - static: |- - <p data-sourcepos="1:1-1:38" dir="auto">Foo </p> -06_11_00__inlines__raw_html__006: - canonical: | - <p><33> <__></p> - static: |- - <p data-sourcepos="1:1-1:9" dir="auto"><33> <__></p> -06_11_00__inlines__raw_html__007: - canonical: | - <p><a h*#ref="hi"></p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto"><a h*#ref="hi"></p> -06_11_00__inlines__raw_html__008: - canonical: | - <p><a href="hi'> <a href=hi'></p> - static: |- - <p data-sourcepos="1:1-1:26" dir="auto"><a href="hi'> <a href=hi'></p> -06_11_00__inlines__raw_html__009: - canonical: | - <p>< a>< - foo><bar/ > - <foo bar=baz - bim!bop /></p> - static: |- - <p data-sourcepos="1:1-4:10" dir="auto">< a>< - foo><bar/ > - <foo bar=baz - bim!bop /></p> -06_11_00__inlines__raw_html__010: - canonical: | - <p><a href='bar'title=title></p> - static: |- - <p data-sourcepos="1:1-1:25" dir="auto"><a href='bar'title=title></p> -06_11_00__inlines__raw_html__011: - canonical: | - <p></a></foo ></p> - static: |- - <p data-sourcepos="1:1-1:11" dir="auto"></p> -06_11_00__inlines__raw_html__012: - canonical: | - <p></a href="foo"></p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto"></a href="foo"></p> -06_11_00__inlines__raw_html__013: - canonical: | - <p>foo <!-- this is a - comment - with hyphen --></p> - static: |- - <p data-sourcepos="1:1-2:25" dir="auto">foo <!-- this is a - comment - with hyphen --></p> -06_11_00__inlines__raw_html__014: - canonical: | - <p>foo <!-- not a comment -- two hyphens --></p> - static: |- - <p data-sourcepos="1:1-1:41" dir="auto">foo <!-- not a comment -- two hyphens --></p> -06_11_00__inlines__raw_html__015: - canonical: | - <p>foo <!--> foo --></p> - <p>foo <!-- foo---></p> - static: |- - <p data-sourcepos="1:1-1:17" dir="auto">foo <!----> foo --></p> - <p data-sourcepos="3:1-3:16" dir="auto">foo <!-- foo---></p> -06_11_00__inlines__raw_html__016: - canonical: | - <p>foo <?php echo $a; ?></p> - static: |- - <p data-sourcepos="1:1-1:21" dir="auto">foo <?php echo $a; ?></p> -06_11_00__inlines__raw_html__017: - canonical: | - <p>foo <!ELEMENT br EMPTY></p> - static: |- - <p data-sourcepos="1:1-1:23" dir="auto">foo </p> -06_11_00__inlines__raw_html__018: - canonical: | - <p>foo <![CDATA[>&<]]></p> - static: |- - <p data-sourcepos="1:1-1:19" dir="auto">foo &<]]></p> -06_11_00__inlines__raw_html__019: - canonical: | - <p>foo <a href="ö"></p> - static: |- - <p data-sourcepos="1:1-1:21" dir="auto">foo <a href="%C3%B6" rel="nofollow noreferrer noopener" target="_blank"></a></p> -06_11_00__inlines__raw_html__020: - canonical: | - <p>foo <a href="\*"></p> - static: |- - <p data-sourcepos="1:1-1:17" dir="auto">foo <a href="\*" rel="nofollow noreferrer noopener" target="_blank"></a></p> -06_11_00__inlines__raw_html__021: - canonical: | - <p><a href="""></p> - static: |- - <p data-sourcepos="1:1-1:13" dir="auto"><a href="""></p> -06_12_00__inlines__disallowed_raw_html_extension__001: - canonical: | - <p><strong> <title> <style> <em></p> - <blockquote> - <xmp> is disallowed. <XMP> is also disallowed. - </blockquote> - static: |- - <p data-sourcepos="1:1-1:29" dir="auto"><strong> <em></p> - <blockquote> - <xmp> is disallowed. <XMP> is also disallowed. - </blockquote></strong></p> -06_13_00__inlines__hard_line_breaks__001: - canonical: | - <p>foo<br /> - baz</p> - static: |- - <p data-sourcepos="1:1-2:3" dir="auto">foo<br data-sourcepos="1:6-1:6"> - baz</p> -06_13_00__inlines__hard_line_breaks__002: - canonical: | - <p>foo<br /> - baz</p> - static: |- - <p data-sourcepos="1:1-2:3" dir="auto">foo<br data-sourcepos="1:4-1:5"> - baz</p> -06_13_00__inlines__hard_line_breaks__003: - canonical: | - <p>foo<br /> - baz</p> - static: |- - <p data-sourcepos="1:1-2:3" dir="auto">foo<br data-sourcepos="1:11-1:11"> - baz</p> -06_13_00__inlines__hard_line_breaks__004: - canonical: | - <p>foo<br /> - bar</p> - static: |- - <p data-sourcepos="1:1-2:8" dir="auto">foo<br data-sourcepos="1:6-1:6"> - bar</p> -06_13_00__inlines__hard_line_breaks__005: - canonical: | - <p>foo<br /> - bar</p> - static: |- - <p data-sourcepos="1:1-2:8" dir="auto">foo<br data-sourcepos="1:4-1:5"> - bar</p> -06_13_00__inlines__hard_line_breaks__006: - canonical: | - <p><em>foo<br /> - bar</em></p> - static: |- - <p data-sourcepos="1:1-2:4" dir="auto"><em data-sourcepos="1:1-2:4">foo<br data-sourcepos="1:7-1:7"> - bar</em></p> -06_13_00__inlines__hard_line_breaks__007: - canonical: | - <p><em>foo<br /> - bar</em></p> - static: |- - <p data-sourcepos="1:1-2:4" dir="auto"><em data-sourcepos="1:1-1:10">foo<br data-sourcepos="1:5-1:6"> - bar</em></p> -06_13_00__inlines__hard_line_breaks__008: - canonical: | - <p><code>code span</code></p> - static: |- - <p data-sourcepos="1:1-2:5" dir="auto"><code data-sourcepos="1:2-2:4">code span</code></p> -06_13_00__inlines__hard_line_breaks__009: - canonical: | - <p><code>code\ span</code></p> - static: |- - <p data-sourcepos="1:1-2:5" dir="auto"><code data-sourcepos="1:2-2:4">code\ span</code></p> -06_13_00__inlines__hard_line_breaks__010: - canonical: "<p><a href=\"foo \nbar\"></p>\n" - static: |- - <p data-sourcepos="1:1-2:5" dir="auto"><a href="foo%20%20%0Abar" rel="nofollow noreferrer noopener" target="_blank"></a></p> -06_13_00__inlines__hard_line_breaks__011: - canonical: | - <p><a href="foo\ - bar"></p> - static: |- - <p data-sourcepos="1:1-2:5" dir="auto"><a href="foo\%0Abar" rel="nofollow noreferrer noopener" target="_blank"></a></p> -06_13_00__inlines__hard_line_breaks__012: - canonical: | - <p>foo\</p> - static: |- - <p data-sourcepos="1:1-1:4" dir="auto">foo\</p> -06_13_00__inlines__hard_line_breaks__013: - canonical: | - <p>foo</p> - static: |- - <p data-sourcepos="1:1-1:5" dir="auto">foo</p> -06_13_00__inlines__hard_line_breaks__014: - canonical: | - <h3>foo\</h3> - static: |- - <h3 data-sourcepos="1:1-1:8" dir="auto"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>foo\</h3> -06_13_00__inlines__hard_line_breaks__015: - canonical: | - <h3>foo</h3> - static: |- - <h3 data-sourcepos="1:1-1:9" dir="auto"> - <a href="#foo" aria-hidden="true" class="anchor" id="user-content-foo"></a>foo</h3> -06_14_00__inlines__soft_line_breaks__001: - canonical: | - <p>foo - baz</p> - static: |- - <p data-sourcepos="1:1-2:3" dir="auto">foo - baz</p> -06_14_00__inlines__soft_line_breaks__002: - canonical: | - <p>foo - baz</p> - static: |- - <p data-sourcepos="1:1-2:4" dir="auto">foo - baz</p> -06_15_00__inlines__textual_content__001: - canonical: | - <p>hello $.;'there</p> - static: |- - <p data-sourcepos="1:1-1:15" dir="auto">hello $.;'there</p> -06_15_00__inlines__textual_content__002: - canonical: | - <p>Foo χÏῆν</p> - static: |- - <p data-sourcepos="1:1-1:13" dir="auto">Foo χÏῆν</p> -06_15_00__inlines__textual_content__003: - canonical: | - <p>Multiple spaces</p> - static: |- - <p data-sourcepos="1:1-1:19" dir="auto">Multiple spaces</p> -07_01_00__gitlab_official_specification_markdown__task_list_items__001: - canonical: | - <ul> - <li> - <task-button/> - <input type="checkbox" disabled/> - incomplete - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-1:16" class="task-list" dir="auto"> - <li data-sourcepos="1:1-1:16" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" disabled> incomplete</li> - </ul> -07_01_00__gitlab_official_specification_markdown__task_list_items__002: - canonical: | - <ul> - <li> - <task-button/> - <input type="checkbox" checked disabled/> - completed - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-1:15" class="task-list" dir="auto"> - <li data-sourcepos="1:1-1:15" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" checked disabled> completed</li> - </ul> -07_01_00__gitlab_official_specification_markdown__task_list_items__003: - canonical: | - <ul> - <li> - <task-button/> - <input type="checkbox" data-inapplicable disabled> - <s> - inapplicable - </s> - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-1:18" class="task-list" dir="auto"> - <li data-sourcepos="1:1-1:18" class="task-list-item inapplicable"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" data-inapplicable disabled> <s>inapplicable</s> - </li> - </ul> -07_01_00__gitlab_official_specification_markdown__task_list_items__004: - canonical: | - <ul> - <li> - <p> - <task-button/> - <input type="checkbox" data-inapplicable disabled> - <s> - inapplicable - </s> - </p> - <p> - text in loose list - </p> - </li> - </ul> - static: |- - <ul data-sourcepos="1:1-3:20" class="task-list" dir="auto"> - <li data-sourcepos="1:1-3:20" class="task-list-item inapplicable"> - <p data-sourcepos="1:3-1:18"><task-button></task-button><input type="checkbox" class="task-list-item-checkbox" data-inapplicable disabled> <s>inapplicable</s></p> - <p data-sourcepos="3:3-3:20">text in loose list</p> - </li> - </ul> -07_02_00__gitlab_official_specification_markdown__front_matter__001: - canonical: | - <pre> - <code> - title: YAML front matter - </code> - </pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-3:3" data-canonical-lang="yaml" data-lang-params="frontmatter" class="code highlight js-syntax-highlight language-yaml" v-pre="true"><code><span id="LC1" class="line" lang="yaml"><span class="na">title</span><span class="pi">:</span> <span class="s">YAML front matter</span></span></code></pre> - <copy-code></copy-code> - </div> -07_02_00__gitlab_official_specification_markdown__front_matter__002: - canonical: | - <pre> - <code> - title: TOML front matter - </code> - </pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-3:3" data-canonical-lang="toml" data-lang-params="frontmatter" class="code highlight js-syntax-highlight language-toml" v-pre="true"><code><span id="LC1" class="line" lang="toml"><span class="err">title:</span> <span class="err">TOML</span> <span class="err">front</span> <span class="err">matter</span></span></code></pre> - <copy-code></copy-code> - </div> -07_02_00__gitlab_official_specification_markdown__front_matter__003: - canonical: | - <pre> - <code> - { - "title": "JSON front matter" - } - </code> - </pre> - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-5:3" data-canonical-lang="json" data-lang-params="frontmatter" class="code highlight js-syntax-highlight language-json" v-pre="true"><code><span id="LC1" class="line" lang="json"><span class="p">{</span></span> - <span id="LC2" class="line" lang="json"><span class="w"> </span><span class="nl">"title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"JSON front matter"</span></span> - <span id="LC3" class="line" lang="json"><span class="p">}</span></span></code></pre> - <copy-code></copy-code> - </div> -07_02_00__gitlab_official_specification_markdown__front_matter__004: - canonical: | - <p>text</p> - <hr> - <h2>title: YAML front matter</h2> - static: |- - <p data-sourcepos="1:1-1:4" dir="auto">text</p> - <hr data-sourcepos="3:1-3:3"> - <h2 data-sourcepos="4:1-5:3" dir="auto"> - <a href="#title-yaml-front-matter" aria-hidden="true" class="anchor" id="user-content-title-yaml-front-matter"></a>title: YAML front matter</h2> -07_02_00__gitlab_official_specification_markdown__front_matter__005: - canonical: | - <hr> - <h2>title: YAML front matter</h2> - static: |- - <hr data-sourcepos="1:2-1:4"> - <h2 data-sourcepos="2:1-3:3" dir="auto"> - <a href="#title-yaml-front-matter" aria-hidden="true" class="anchor" id="user-content-title-yaml-front-matter"></a>title: YAML front matter</h2> -07_03_00__gitlab_official_specification_markdown__table_of_contents__001: - canonical: | - <nav> - <ul> - <li><a href="#heading-1">Heading 1</a></li> - <ul> - <li><a href="#heading-2">Heading 2</a></li> - </ul> - </ul> - </nav> - <h1>Heading 1</h1> - <h2>Heading 2</h2> - static: |- - <ul class="section-nav"><li> - <a href="#heading-1">Heading 1</a><ul><li><a href="#heading-2">Heading 2</a></li></ul> - </li></ul> - <h1 data-sourcepos="3:1-3:11" dir="auto"> - <a href="#heading-1" aria-hidden="true" class="anchor" id="user-content-heading-1"></a>Heading 1</h1> - <h2 data-sourcepos="5:1-5:12" dir="auto"> - <a href="#heading-2" aria-hidden="true" class="anchor" id="user-content-heading-2"></a>Heading 2</h2> -07_03_00__gitlab_official_specification_markdown__table_of_contents__002: - canonical: | - <nav> - <ul> - <li><a href="#heading-1">Heading 1</a></li> - <ul> - <li><a href="#heading-2">Heading 2</a></li> - </ul> - </ul> - </nav> - <h1>Heading 1</h1> - <h2>Heading 2</h2> - static: |- - <ul class="section-nav"><li> - <a href="#heading-1">Heading 1</a><ul><li><a href="#heading-2">Heading 2</a></li></ul> - </li></ul> - <h1 data-sourcepos="3:1-3:11" dir="auto"> - <a href="#heading-1" aria-hidden="true" class="anchor" id="user-content-heading-1"></a>Heading 1</h1> - <h2 data-sourcepos="5:1-5:12" dir="auto"> - <a href="#heading-2" aria-hidden="true" class="anchor" id="user-content-heading-2"></a>Heading 2</h2> -07_03_00__gitlab_official_specification_markdown__table_of_contents__003: - canonical: | - <p>[[<em>TOC</em>]]text</p> - <p>text[TOC]</p> - static: |- - <p data-sourcepos="1:1-2:4" dir="auto"><a data-sourcepos="1:1-1:9" href="_TOC_" data-wikilink="true">_TOC_</a> - text</p> - <p data-sourcepos="4:1-5:5" dir="auto">text - [TOC]</p> -07_03_00__gitlab_official_specification_markdown__table_of_contents__004: - canonical: | - <nav> - <ul> - <li><a href="#heading-1">Heading 1</a></li> - </ul> - </nav> - <h1>Heading 1</h1> - static: |- - <ul class="section-nav"><li><a href="#heading-1">Heading 1</a></li></ul> - <h1 data-sourcepos="3:1-3:11" dir="auto"> - <a href="#heading-1" aria-hidden="true" class="anchor" id="user-content-heading-1"></a>Heading 1</h1> -08_01_00__gitlab_internal_extension_markdown__audio__001: - canonical: | - <p><audio src="audio.oga" title="audio title"></audio></p> - static: |- - <p data-sourcepos="1:1-1:33" dir="auto"><span class="media-container audio-container"><audio src="audio.oga" controls="true" data-setup="{}" data-title="audio title"></audio><a href="audio.oga" target="_blank" rel="noopener noreferrer" title="Download 'audio title'">audio title</a></span></p> -08_01_00__gitlab_internal_extension_markdown__audio__002: - canonical: | - <p><audio src="audio.oga" title="audio title"></audio></p> - static: |- - <p data-sourcepos="3:1-3:15" dir="auto"><span class="media-container audio-container"><audio src="audio.oga" controls="true" data-setup="{}" data-title="audio title"></audio><a href="audio.oga" target="_blank" rel="noopener noreferrer" title="Download 'audio title'">audio title</a></span></p> -08_02_00__gitlab_internal_extension_markdown__video__001: - canonical: | - <p><video src="video.m4v" title="video title"></video></p> - static: |- - <p data-sourcepos="1:1-1:33" dir="auto"><span class="media-container video-container"><video src="video.m4v" controls="true" data-setup="{}" data-title="video title" preload="metadata"></video><a href="video.m4v" target="_blank" rel="noopener noreferrer" title="Download 'video title'">video title</a></span></p> -08_02_00__gitlab_internal_extension_markdown__video__002: - canonical: | - <p><video src="video.mov" title="video title"></video></p> - static: |- - <p data-sourcepos="3:1-3:15" dir="auto"><span class="media-container video-container"><video src="video.mov" controls="true" data-setup="{}" data-title="video title" preload="metadata"></video><a href="video.mov" target="_blank" rel="noopener noreferrer" title="Download 'video title'">video title</a></span></p> -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__001: - canonical: | - <p><a href="groups-test-file">groups-test-file</a></p> - static: |- - <p data-sourcepos="1:1-1:45" dir="auto"><a data-sourcepos="1:1-1:45" href="/-/group/66666/uploads/groups-test-file" data-canonical-src="/uploads/groups-test-file" data-link="true" class="gfm">groups-test-file</a></p> -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__002: - canonical: | - <p><a href="projects-test-file">projects-test-file</a></p> - static: |- - <p data-sourcepos="1:1-1:40" dir="auto"><a data-sourcepos="1:1-1:40" href="/glfm_group/glfm_project/-/blob/master/projects-test-file" class="gfm">projects-test-file</a></p> -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__003: - canonical: | - <p>This project snippet ID reference IS filtered: $88888</p> - static: |- - <p data-sourcepos="1:1-1:53" dir="auto">This project snippet ID reference IS filtered: <a href="/glfm_group/glfm_project/-/snippets/88888" data-reference-type="snippet" data-original="$88888" data-link="false" data-link-reference="false" data-snippet="88888" data-project="77777" data-container="body" data-placement="top" title="glfm_project_snippet" class="gfm gfm-snippet has-tooltip">$88888</a></p> -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__004: - canonical: | - <p>This personal snippet ID reference is not filtered: $99999</p> - static: |- - <p data-sourcepos="1:1-1:58" dir="auto">This personal snippet ID reference is not filtered: $99999</p> -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__005: - canonical: | - <p><a href="project-wikis-test-file">project-wikis-test-file</a></p> - static: |- - <p data-sourcepos="1:1-1:50" dir="auto"><a data-sourcepos="1:1-1:50" href="/glfm_group/glfm_project/-/wikis/project-wikis-test-file" data-canonical-src="project-wikis-test-file">project-wikis-test-file</a></p> -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__006: - canonical: | - <p><a href="group-wikis-test-file">group-wikis-test-file</a></p> - static: |- - <p data-sourcepos="1:1-1:46" dir="auto"><a data-sourcepos="1:1-1:46" href="/groups/glfm_group/-/wikis/group-wikis-test-file" data-canonical-src="group-wikis-test-file">group-wikis-test-file</a></p> -08_04_01__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_image_for_group__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <p data-sourcepos="1:1-1:69" dir="auto"><a class="no-attachment-icon gfm" href="/-/group/66666/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.png" target="_blank" rel="noopener noreferrer" data-canonical-src="/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.png" data-link="true"><img data-sourcepos="1:1-1:69" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="test-file" decoding="async" class="lazy gfm" data-src="/-/group/66666/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.png" data-canonical-src="/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.png"></a></p> -08_04_02__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_image_for_project__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <p data-sourcepos="1:1-1:69" dir="auto"><a class="no-attachment-icon gfm" href="/-/project/77777/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.png" target="_blank" rel="noopener noreferrer" data-canonical-src="/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.png" data-link="true"><img data-sourcepos="1:1-1:69" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="test-file" decoding="async" class="lazy gfm" data-src="/-/project/77777/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.png" data-canonical-src="/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.png"></a></p> -08_04_03__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_image_for_project_wiki__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <p data-sourcepos="1:1-1:27" dir="auto"><a class="no-attachment-icon" href="/glfm_group/glfm_project/-/wikis/test-file.png" target="_blank" rel="noopener noreferrer" data-canonical-src="test-file.png"><img data-sourcepos="1:1-1:27" alt="test-file" decoding="async" class="lazy" data-src="/glfm_group/glfm_project/-/wikis/test-file.png" data-canonical-src="test-file.png"></a></p> -08_04_04__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_link_for_group__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <p data-sourcepos="1:1-1:68" dir="auto"><a data-sourcepos="1:1-1:68" href="/-/group/66666/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.zip" data-canonical-src="/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.zip" data-link="true" class="gfm">test-file</a></p> -08_04_05__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_link_for_project__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <p data-sourcepos="1:1-1:68" dir="auto"><a data-sourcepos="1:1-1:68" href="/-/project/77777/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.zip" data-canonical-src="/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.zip" data-link="true" class="gfm">test-file</a></p> -08_04_06__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_link_for_project_wiki__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <p data-sourcepos="1:1-1:26" dir="auto"><a data-sourcepos="1:1-1:26" href="/glfm_group/glfm_project/-/wikis/test-file.zip" data-canonical-src="test-file.zip">test-file</a></p> -08_04_07__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_link_for_group_wiki__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <p data-sourcepos="1:1-1:26" dir="auto"><a data-sourcepos="1:1-1:26" href="/groups/glfm_group/-/wikis/test-file.zip" data-canonical-src="test-file.zip">test-file</a></p> -08_04_08__gitlab_internal_extension_markdown__migrated_golden_master_examples__audio__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <p data-sourcepos="1:1-1:46" dir="auto"><span class="media-container audio-container"><audio src="https://gitlab.com/gitlab.mp3" controls="true" data-setup="{}" data-title="Sample Audio"></audio><a href="https://gitlab.com/gitlab.mp3" target="_blank" rel="nofollow noreferrer noopener" title="Download 'Sample Audio'">Sample Audio</a></span></p> -08_04_09__gitlab_internal_extension_markdown__migrated_golden_master_examples__audio_and_video_in_lists__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <ul data-sourcepos="1:1-3:0" dir="auto"> - <li data-sourcepos="1:1-1:43"><span class="media-container audio-container"><audio src="https://gitlab.com/1.mp3" controls="true" data-setup="{}" data-title="Sample Audio"></audio><a href="https://gitlab.com/1.mp3" target="_blank" rel="nofollow noreferrer noopener" title="Download 'Sample Audio'">Sample Audio</a></span></li> - <li data-sourcepos="2:1-3:0"><span class="media-container video-container"><video src="https://gitlab.com/2.mp4" controls="true" data-setup="{}" data-title="Sample Video" preload="metadata"></video><a href="https://gitlab.com/2.mp4" target="_blank" rel="nofollow noreferrer noopener" title="Download 'Sample Video'">Sample Video</a></span></li> - </ul> - <ol data-sourcepos="4:1-6:0" dir="auto"> - <li data-sourcepos="4:1-4:44"><span class="media-container video-container"><video src="https://gitlab.com/1.mp4" controls="true" data-setup="{}" data-title="Sample Video" preload="metadata"></video><a href="https://gitlab.com/1.mp4" target="_blank" rel="nofollow noreferrer noopener" title="Download 'Sample Video'">Sample Video</a></span></li> - <li data-sourcepos="5:1-6:0"><span class="media-container audio-container"><audio src="https://gitlab.com/2.mp3" controls="true" data-setup="{}" data-title="Sample Audio"></audio><a href="https://gitlab.com/2.mp3" target="_blank" rel="nofollow noreferrer noopener" title="Download 'Sample Audio'">Sample Audio</a></span></li> - </ol> - <ul data-sourcepos="7:1-9:47" class="task-list" dir="auto"> - <li data-sourcepos="7:1-7:47" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" checked disabled> <span class="media-container audio-container"><audio src="https://gitlab.com/1.mp3" controls="true" data-setup="{}" data-title="Sample Audio"></audio><a href="https://gitlab.com/1.mp3" target="_blank" rel="nofollow noreferrer noopener" title="Download 'Sample Audio'">Sample Audio</a></span> - </li> - <li data-sourcepos="8:1-8:47" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" checked disabled> <span class="media-container audio-container"><audio src="https://gitlab.com/2.mp3" controls="true" data-setup="{}" data-title="Sample Audio"></audio><a href="https://gitlab.com/2.mp3" target="_blank" rel="nofollow noreferrer noopener" title="Download 'Sample Audio'">Sample Audio</a></span> - </li> - <li data-sourcepos="9:1-9:47" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" checked disabled> <span class="media-container video-container"><video src="https://gitlab.com/3.mp4" controls="true" data-setup="{}" data-title="Sample Video" preload="metadata"></video><a href="https://gitlab.com/3.mp4" target="_blank" rel="nofollow noreferrer noopener" title="Download 'Sample Video'">Sample Video</a></span> - </li> - </ul> -08_04_10__gitlab_internal_extension_markdown__migrated_golden_master_examples__blockquote__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <blockquote data-sourcepos="1:1-3:21" dir="auto"> - <p data-sourcepos="1:3-1:22">This is a blockquote</p> - <p data-sourcepos="3:3-3:21">This is another one</p> - </blockquote> -08_04_11__gitlab_internal_extension_markdown__migrated_golden_master_examples__bold__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <p data-sourcepos="1:1-1:8" dir="auto"><strong data-sourcepos="1:1-1:8">bold</strong></p> -08_04_12__gitlab_internal_extension_markdown__migrated_golden_master_examples__bullet_list_style_1__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <ul data-sourcepos="1:1-3:24" dir="auto"> - <li data-sourcepos="1:1-1:13">list item 1</li> - <li data-sourcepos="2:1-3:24">list item 2 - <ul data-sourcepos="3:3-3:24"> - <li data-sourcepos="3:3-3:24">embedded list item 3</li> - </ul> - </li> - </ul> -08_04_13__gitlab_internal_extension_markdown__migrated_golden_master_examples__bullet_list_style_2__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <ul data-sourcepos="1:1-3:24" dir="auto"> - <li data-sourcepos="1:1-1:13">list item 1</li> - <li data-sourcepos="2:1-3:24">list item 2 - <ul data-sourcepos="3:3-3:24"> - <li data-sourcepos="3:3-3:24">embedded list item 3</li> - </ul> - </li> - </ul> -08_04_14__gitlab_internal_extension_markdown__migrated_golden_master_examples__bullet_list_style_3__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <ul data-sourcepos="1:1-3:24" dir="auto"> - <li data-sourcepos="1:1-1:13">list item 1</li> - <li data-sourcepos="2:1-3:24">list item 2 - <ul data-sourcepos="3:3-3:24"> - <li data-sourcepos="3:3-3:24">embedded list item 3</li> - </ul> - </li> - </ul> -08_04_15__gitlab_internal_extension_markdown__migrated_golden_master_examples__code_block_javascript__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-3:3" data-canonical-lang="javascript" class="code highlight js-syntax-highlight language-javascript" v-pre="true"><code><span id="LC1" class="line" lang="javascript"> <span class="nx">console</span><span class="p">.</span><span class="nf">log</span><span class="p">(</span><span class="dl">'</span><span class="s1">hello world</span><span class="dl">'</span><span class="p">)</span></span></code></pre> - <copy-code></copy-code> - </div> -08_04_16__gitlab_internal_extension_markdown__migrated_golden_master_examples__code_block_plaintext__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-3:3" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> plaintext</span></code></pre> - <copy-code></copy-code> - </div> -08_04_17__gitlab_internal_extension_markdown__migrated_golden_master_examples__code_block_unknown__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-3:3" data-canonical-lang="foobar" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> custom_language = >> this <<</span></code></pre> - <copy-code></copy-code> - </div> -08_04_18__gitlab_internal_extension_markdown__migrated_golden_master_examples__color_chips__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <ul data-sourcepos="1:1-9:25" dir="auto"> - <li data-sourcepos="1:1-1:8"><code data-sourcepos="1:4-1:7">#F00<span class="gfm-color_chip"><span style="background-color: #F00;"></span></span></code></li> - <li data-sourcepos="2:1-2:9"><code data-sourcepos="2:4-2:8">#F00A<span class="gfm-color_chip"><span style="background-color: #F00A;"></span></span></code></li> - <li data-sourcepos="3:1-3:11"><code data-sourcepos="3:4-3:10">#FF0000<span class="gfm-color_chip"><span style="background-color: #FF0000;"></span></span></code></li> - <li data-sourcepos="4:1-4:13"><code data-sourcepos="4:4-4:12">#FF0000AA<span class="gfm-color_chip"><span style="background-color: #FF0000AA;"></span></span></code></li> - <li data-sourcepos="5:1-5:16"><code data-sourcepos="5:4-5:15">RGB(0,255,0)<span class="gfm-color_chip"><span style="background-color: RGB(0,255,0);"></span></span></code></li> - <li data-sourcepos="6:1-6:19"><code data-sourcepos="6:4-6:18">RGB(0%,100%,0%)<span class="gfm-color_chip"><span style="background-color: RGB(0%,100%,0%);"></span></span></code></li> - <li data-sourcepos="7:1-7:21"><code data-sourcepos="7:4-7:20">RGBA(0,255,0,0.3)<span class="gfm-color_chip"><span style="background-color: RGBA(0,255,0,0.3);"></span></span></code></li> - <li data-sourcepos="8:1-8:20"><code data-sourcepos="8:4-8:19">HSL(540,70%,50%)<span class="gfm-color_chip"><span style="background-color: HSL(540,70%,50%);"></span></span></code></li> - <li data-sourcepos="9:1-9:25"><code data-sourcepos="9:4-9:24">HSLA(540,70%,50%,0.3)<span class="gfm-color_chip"><span style="background-color: HSLA(540,70%,50%,0.3);"></span></span></code></li> - </ul> -08_04_19__gitlab_internal_extension_markdown__migrated_golden_master_examples__description_list__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <dl> - <dt>Frog</dt> - <dd>Wet green thing</dd> - <dt>Rabbit</dt> - <dd>Warm fluffy thing</dd> - <dt>Punt</dt> - <dd>Kick a ball</dd> - <dd>Take a bet</dd> - <dt>Color</dt> - <dt>Colour</dt> - <dd> - <p data-sourcepos="13:1-13:35">Any hue except <em data-sourcepos="13:16-13:22">white</em> or <strong data-sourcepos="13:27-13:35">black</strong></p> - </dd> - </dl> -08_04_20__gitlab_internal_extension_markdown__migrated_golden_master_examples__details__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <details> - <summary>This is the visible summary of the collapsible section</summary> - <ol data-sourcepos="4:1-6:0"> - <li data-sourcepos="4:1-4:21">collapsed markdown</li> - <li data-sourcepos="5:1-6:0">more collapsed markdown</li> - </ol> - </details> -08_04_21__gitlab_internal_extension_markdown__migrated_golden_master_examples__diagram_kroki_nomnoml__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-11:3" data-canonical-lang="nomnoml" class="code highlight js-syntax-highlight language-nomnoml" v-pre="true"><code><span id="LC1" class="line" lang="nomnoml"> #stroke: #a86128</span> - <span id="LC2" class="line" lang="nomnoml"> [<frame>Decorator pattern|</span> - <span id="LC3" class="line" lang="nomnoml"> [<abstract>Component||+ operation()]</span> - <span id="LC4" class="line" lang="nomnoml"> [Client] depends --> [Component]</span> - <span id="LC5" class="line" lang="nomnoml"> [Decorator|- next: Component]</span> - <span id="LC6" class="line" lang="nomnoml"> [Decorator] decorates -- [ConcreteComponent]</span> - <span id="LC7" class="line" lang="nomnoml"> [Component] <:- [Decorator]</span> - <span id="LC8" class="line" lang="nomnoml"> [Component] <:- [ConcreteComponent]</span> - <span id="LC9" class="line" lang="nomnoml"> ]</span></code></pre> - <copy-code></copy-code> - </div> -08_04_22__gitlab_internal_extension_markdown__migrated_golden_master_examples__diagram_plantuml__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-7:3" data-canonical-lang="plantuml" class="code highlight js-syntax-highlight language-plantuml" v-pre="true"><code><span id="LC1" class="line" lang="plantuml"> Alice -> Bob: Authentication Request</span> - <span id="LC2" class="line" lang="plantuml"> Bob --> Alice: Authentication Response</span> - <span id="LC3" class="line" lang="plantuml"></span> - <span id="LC4" class="line" lang="plantuml"> Alice -> Bob: Another authentication Request</span> - <span id="LC5" class="line" lang="plantuml"> Alice <-- Bob: Another authentication Response</span></code></pre> - <copy-code></copy-code> - </div> -08_04_23__gitlab_internal_extension_markdown__migrated_golden_master_examples__diagram_plantuml_unicode__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-3:3" data-canonical-lang="plantuml" class="code highlight js-syntax-highlight language-plantuml" v-pre="true"><code><span id="LC1" class="line" lang="plantuml">A -> B : Text with norwegian characters: æøå</span></code></pre> - <copy-code></copy-code> - </div> -08_04_24__gitlab_internal_extension_markdown__migrated_golden_master_examples__div__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <div>plain text</div> - <div> - <p data-sourcepos="4:1-4:43">just a plain ol' div, not much to <em data-sourcepos="4:35-4:42">expect</em>!</p> - </div> -08_04_25__gitlab_internal_extension_markdown__migrated_golden_master_examples__emoji__001: - canonical: | - TODO: Write canonical HTML for this example - static: "<p data-sourcepos=\"1:1-1:24\" dir=\"auto\"><gl-emoji title=\"sparkles\" - data-name=\"sparkles\" data-unicode-version=\"6.0\">✨</gl-emoji> <gl-emoji title=\"heavy - black heart\" data-name=\"heart\" data-unicode-version=\"1.1\">â¤</gl-emoji> <gl-emoji - title=\"hundred points symbol\" data-name=\"100\" data-unicode-version=\"6.0\">\U0001F4AF</gl-emoji></p>" -08_04_26__gitlab_internal_extension_markdown__migrated_golden_master_examples__emphasis__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <p data-sourcepos="1:1-1:17" dir="auto"><em data-sourcepos="1:1-1:17">emphasized text</em></p> -08_04_27__gitlab_internal_extension_markdown__migrated_golden_master_examples__figure__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <figure> - <p data-sourcepos="3:1-3:42"><a class="no-attachment-icon" href="elephant-sunset.jpg" target="_blank" rel="noopener noreferrer"><img data-sourcepos="3:1-3:42" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="Elephant at sunset" decoding="async" class="lazy" data-src="elephant-sunset.jpg"></a></p> - <figcaption>An elephant at sunset</figcaption> - </figure> - <figure> - <p data-sourcepos="9:1-9:44"><a class="no-attachment-icon" href="croc-crocs.jpg" target="_blank" rel="noopener noreferrer"><img data-sourcepos="9:1-9:44" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="A crocodile wearing crocs" decoding="async" class="lazy" data-src="croc-crocs.jpg"></a></p> - <figcaption> - <p data-sourcepos="13:1-13:28">A crocodile wearing <em data-sourcepos="13:21-13:27">crocs</em>!</p> - </figcaption> - </figure> -08_04_28__gitlab_internal_extension_markdown__migrated_golden_master_examples__footnotes__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <p data-sourcepos="1:1-1:46" dir="auto">A footnote reference tag looks like this: <sup data-sourcepos="1:43-1:46" class="footnote-ref"><a href="#fn-1-42" id="fnref-1-42" data-footnote-ref>1</a></sup></p> - <p data-sourcepos="3:1-3:63" dir="auto">This reference tag is a mix of letters and numbers. <sup data-sourcepos="3:53-3:63" class="footnote-ref"><a href="#fn-footnote-42" id="fnref-footnote-42" data-footnote-ref>2</a></sup></p> - <section data-sourcepos="5:1-6:0" data-footnotes class="footnotes"> - <ol> - <li data-sourcepos="5:1-6:0" id="fn-1-42"> - <p data-sourcepos="5:7-5:41">This is the text inside a footnote. <a href="#fnref-1-42" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1" class="footnote-backref"><gl-emoji title="leftwards arrow with hook" data-name="leftwards_arrow_with_hook" data-unicode-version="1.1">↩</gl-emoji></a></p> - </li> - <li data-sourcepos="7:1-7:38" id="fn-footnote-42"> - <p data-sourcepos="7:14-7:38">This is another footnote. <a href="#fnref-footnote-42" data-footnote-backref data-footnote-backref-idx="2" aria-label="Back to reference 2" class="footnote-backref"><gl-emoji title="leftwards arrow with hook" data-name="leftwards_arrow_with_hook" data-unicode-version="1.1">↩</gl-emoji></a></p> - </li> - </ol> - </section> -08_04_29__gitlab_internal_extension_markdown__migrated_golden_master_examples__frontmatter_json__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-5:3" data-canonical-lang="json" data-lang-params="frontmatter" class="code highlight js-syntax-highlight language-json" v-pre="true"><code><span id="LC1" class="line" lang="json"><span class="p">{</span></span> - <span id="LC2" class="line" lang="json"><span class="w"> </span><span class="nl">"title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Page title"</span></span> - <span id="LC3" class="line" lang="json"><span class="p">}</span></span></code></pre> - <copy-code></copy-code> - </div> -08_04_30__gitlab_internal_extension_markdown__migrated_golden_master_examples__frontmatter_toml__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-3:3" data-canonical-lang="toml" data-lang-params="frontmatter" class="code highlight js-syntax-highlight language-toml" v-pre="true"><code><span id="LC1" class="line" lang="toml"><span class="py">title</span> <span class="p">=</span> <span class="s">"Page title"</span></span></code></pre> - <copy-code></copy-code> - </div> -08_04_31__gitlab_internal_extension_markdown__migrated_golden_master_examples__frontmatter_yaml__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="1:1-3:3" data-canonical-lang="yaml" data-lang-params="frontmatter" class="code highlight js-syntax-highlight language-yaml" v-pre="true"><code><span id="LC1" class="line" lang="yaml"><span class="na">title</span><span class="pi">:</span> <span class="s">Page title</span></span></code></pre> - <copy-code></copy-code> - </div> -08_04_32__gitlab_internal_extension_markdown__migrated_golden_master_examples__hard_break__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <p data-sourcepos="1:1-2:10" dir="auto">This is a line after a<br data-sourcepos="1:23-1:24"> - hard break</p> -08_04_33__gitlab_internal_extension_markdown__migrated_golden_master_examples__headings__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <h1 data-sourcepos="1:1-1:11" dir="auto"> - <a href="#heading-1" aria-hidden="true" class="anchor" id="user-content-heading-1"></a>Heading 1</h1> - <h2 data-sourcepos="3:1-3:12" dir="auto"> - <a href="#heading-2" aria-hidden="true" class="anchor" id="user-content-heading-2"></a>Heading 2</h2> - <h3 data-sourcepos="5:1-5:13" dir="auto"> - <a href="#heading-3" aria-hidden="true" class="anchor" id="user-content-heading-3"></a>Heading 3</h3> - <h4 data-sourcepos="7:1-7:14" dir="auto"> - <a href="#heading-4" aria-hidden="true" class="anchor" id="user-content-heading-4"></a>Heading 4</h4> - <h5 data-sourcepos="9:1-9:15" dir="auto"> - <a href="#heading-5" aria-hidden="true" class="anchor" id="user-content-heading-5"></a>Heading 5</h5> - <h6 data-sourcepos="11:1-11:16" dir="auto"> - <a href="#heading-6" aria-hidden="true" class="anchor" id="user-content-heading-6"></a>Heading 6</h6> -08_04_34__gitlab_internal_extension_markdown__migrated_golden_master_examples__horizontal_rule__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <hr data-sourcepos="1:1-1:3"> -08_04_35__gitlab_internal_extension_markdown__migrated_golden_master_examples__html_marks__001: - canonical: | - TODO: Write canonical HTML for this example - static: "<ul data-sourcepos=\"1:1-15:130\" dir=\"auto\">\n<li data-sourcepos=\"1:1-1:48\">Content - editor is <del data-sourcepos=\"1:21-1:29\">great</del><ins>amazing</ins>.</li>\n<li - data-sourcepos=\"2:1-2:126\">If the changes <abbr title=\"Looks good to merge\">LGTM</abbr>, - please <abbr title=\"Merge when pipeline succeeds\">MWPS</abbr>.</li>\n<li data-sourcepos=\"3:1-3:288\">The - English song <q>Oh I do like to be beside the seaside</q> looks like this in Hebrew: - <span dir=\"rtl\">××”, ×× ×™ ×והב להיות ליד חוף ×”×™×</span>. In the computer's memory, - this is stored as <bdo dir=\"ltr\">××”, ×× ×™ ×והב להיות ליד חוף ×”×™×</bdo>.</li>\n<li - data-sourcepos=\"4:1-4:59\">\n<cite>The Scream</cite> by Edvard Munch. Painted - in 1893.</li>\n<li data-sourcepos=\"5:1-5:73\">\n<dfn>HTML</dfn> is the standard - markup language for creating web pages.</li>\n<li data-sourcepos=\"6:1-6:47\">Do - not forget to buy <mark>milk</mark> today.</li>\n<li data-sourcepos=\"7:1-7:64\">This - is a paragraph and <small>smaller text goes here</small>.</li>\n<li data-sourcepos=\"8:1-8:149\">The - concert starts at <time datetime=\"20:00\">20:00</time> and you'll be able to - enjoy the band for at least <time datetime=\"PT2H30M\">2h 30m</time>.</li>\n<li - data-sourcepos=\"9:1-9:62\">Press <kbd>Ctrl</kbd> + <kbd>C</kbd> to copy text - (Windows).</li>\n<li data-sourcepos=\"10:1-10:105\">WWF's goal is to: <q>Build - a future where people live in harmony with nature.</q> We hope they succeed.</li>\n<li - data-sourcepos=\"11:1-11:80\">The error occurred was: <samp>Keyboard not found. - Press F1 to continue.</samp>\n</li>\n<li data-sourcepos=\"12:1-12:136\">The area - of a triangle is: 1/2 x <var>b</var> x <var>h</var>, where <var>b</var> is the - base, and <var>h</var> is the vertical height.</li>\n<li data-sourcepos=\"13:1-13:35\"><ruby>æ¼¢<rt>ã„ㄢˋ</rt></ruby></li>\n<li - data-sourcepos=\"14:1-14:79\">C<sub>7</sub>H<sub>16</sub> + O<sub>2</sub> \t CO<sub>2</sub> - + H<sub>2</sub>O</li>\n<li data-sourcepos=\"15:1-15:130\">The <strong data-sourcepos=\"15:7-15:29\">Pythagorean - theorem</strong> is often expressed as <var>a<sup>2</sup></var> + <var>b<sup>2</sup></var> - = <var>c<sup>2</sup></var>\n</li>\n</ul>" -08_04_36__gitlab_internal_extension_markdown__migrated_golden_master_examples__image__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <p data-sourcepos="1:1-1:40" dir="auto"><a class="no-attachment-icon" href="https://gitlab.com/logo.png" target="_blank" rel="nofollow noreferrer noopener"><img data-sourcepos="1:1-1:40" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="alt text" decoding="async" class="lazy" data-src="https://gitlab.com/logo.png"></a></p> -08_04_37__gitlab_internal_extension_markdown__migrated_golden_master_examples__inline_code__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <p data-sourcepos="1:1-1:6" dir="auto"><code data-sourcepos="1:2-1:5">code</code></p> -08_04_38__gitlab_internal_extension_markdown__migrated_golden_master_examples__inline_diff__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <ul data-sourcepos="1:1-2:11" dir="auto"> - <li data-sourcepos="1:1-1:13"><span class="idiff left right deletion">deleted</span></li> - <li data-sourcepos="2:1-2:11"><span class="idiff left right addition">added</span></li> - </ul> -08_04_39__gitlab_internal_extension_markdown__migrated_golden_master_examples__label__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <p data-sourcepos="1:1-1:4" dir="auto">~bug</p> -08_04_40__gitlab_internal_extension_markdown__migrated_golden_master_examples__link__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <p data-sourcepos="1:1-1:28" dir="auto"><a data-sourcepos="1:1-1:28" href="https://gitlab.com" rel="nofollow noreferrer noopener" target="_blank">GitLab</a></p> -08_04_41__gitlab_internal_extension_markdown__migrated_golden_master_examples__math__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <p data-sourcepos="1:1-1:36" dir="auto">This math is inline <code data-math-style="inline" data-sourcepos="1:23-1:33" class="js-render-math">a^2+b^2=c^2</code>.</p> - <p data-sourcepos="3:1-3:27" dir="auto">This is on a separate line:</p> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-math-style="display" data-sourcepos="5:1-7:3" data-canonical-lang="math" class="js-render-math code highlight js-syntax-highlight language-math" v-pre="true"><code><span id="LC1" class="line" lang="math">a^2+b^2=c^2</span></code></pre> - <copy-code></copy-code> - </div> -08_04_42__gitlab_internal_extension_markdown__migrated_golden_master_examples__ordered_list__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <ol data-sourcepos="1:1-3:14" dir="auto"> - <li data-sourcepos="1:1-1:14">list item 1</li> - <li data-sourcepos="2:1-2:14">list item 2</li> - <li data-sourcepos="3:1-3:14">list item 3</li> - </ol> -08_04_43__gitlab_internal_extension_markdown__migrated_golden_master_examples__ordered_list_with_start_order__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <ol data-sourcepos="1:1-3:16" start="134" dir="auto"> - <li data-sourcepos="1:1-1:16">list item 1</li> - <li data-sourcepos="2:1-2:16">list item 2</li> - <li data-sourcepos="3:1-3:16">list item 3</li> - </ol> -08_04_44__gitlab_internal_extension_markdown__migrated_golden_master_examples__ordered_task_list__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <ol data-sourcepos="1:1-6:18" class="task-list" dir="auto"> - <li data-sourcepos="1:1-1:12" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" checked disabled> hello</li> - <li data-sourcepos="2:1-2:12" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" checked disabled> world</li> - <li data-sourcepos="3:1-6:18" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" disabled> example - <ol data-sourcepos="4:4-6:18" class="task-list"> - <li data-sourcepos="4:4-6:18" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" disabled> of nested - <ol data-sourcepos="5:7-6:18" class="task-list"> - <li data-sourcepos="5:7-5:22" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" checked disabled> task list</li> - <li data-sourcepos="6:7-6:18" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" disabled> items</li> - </ol> - </li> - </ol> - </li> - </ol> -08_04_45__gitlab_internal_extension_markdown__migrated_golden_master_examples__ordered_task_list_with_order__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <ol data-sourcepos="1:1-3:17" start="4893" class="task-list" dir="auto"> - <li data-sourcepos="1:1-1:15" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" checked disabled> hello</li> - <li data-sourcepos="2:1-2:15" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" checked disabled> world</li> - <li data-sourcepos="3:1-3:17" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" disabled> example</li> - </ol> -08_04_46__gitlab_internal_extension_markdown__migrated_golden_master_examples__reference_for_project_wiki__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <p data-sourcepos="1:1-1:98" dir="auto">Hi @gfm_user - thank you for reporting this ~"UX bug" (#1) we hope to fix it in %1.1 as part of !1</p> -08_04_47__gitlab_internal_extension_markdown__migrated_golden_master_examples__strike__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <p data-sourcepos="1:1-1:7" dir="auto"><del data-sourcepos="1:1-1:7">del</del></p> -08_04_48__gitlab_internal_extension_markdown__migrated_golden_master_examples__table__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <table data-sourcepos="1:1-4:35" dir="auto"> - <thead> - <tr data-sourcepos="1:1-1:19"> - <th data-sourcepos="1:2-1:9">header</th> - <th data-sourcepos="1:11-1:18">header</th> - </tr> - </thead> - <tbody> - <tr data-sourcepos="3:1-3:31"> - <td data-sourcepos="3:2-3:9"><code data-sourcepos="3:4-3:7">code</code></td> - <td data-sourcepos="3:11-3:30">cell with <strong data-sourcepos="3:22-3:29">bold</strong> - </td> - </tr> - <tr data-sourcepos="4:1-4:35"> - <td data-sourcepos="4:2-4:13"><del data-sourcepos="4:3-4:12">strike</del></td> - <td data-sourcepos="4:15-4:34">cell with <em data-sourcepos="4:26-4:33">italic</em> - </td> - </tr> - </tbody> - </table> - <h1 data-sourcepos="6:1-6:21" dir="auto"> - <a href="#content-after-table" aria-hidden="true" class="anchor" id="user-content-content-after-table"></a>content after table</h1> -08_04_49__gitlab_internal_extension_markdown__migrated_golden_master_examples__table_of_contents__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <ul class="section-nav"> - <li> - <a href="#lorem">Lorem</a><ul><li> - <a href="#ipsum">Ipsum</a><ul><li><a href="#dolar">Dolar</a></li></ul> - </li></ul> - </li> - <li> - <a href="#sit-amit">Sit amit</a><ul><li><a href="#i-dont-know">I don't know</a></li></ul> - </li> - </ul> - <h1 data-sourcepos="3:1-3:7" dir="auto"> - <a href="#lorem" aria-hidden="true" class="anchor" id="user-content-lorem"></a>Lorem</h1> - <p data-sourcepos="5:1-5:45" dir="auto">Well, that's just like... your opinion.. man.</p> - <h2 data-sourcepos="7:1-7:8" dir="auto"> - <a href="#ipsum" aria-hidden="true" class="anchor" id="user-content-ipsum"></a>Ipsum</h2> - <h3 data-sourcepos="9:1-9:9" dir="auto"> - <a href="#dolar" aria-hidden="true" class="anchor" id="user-content-dolar"></a>Dolar</h3> - <h1 data-sourcepos="11:1-11:10" dir="auto"> - <a href="#sit-amit" aria-hidden="true" class="anchor" id="user-content-sit-amit"></a>Sit amit</h1> - <h3 data-sourcepos="13:1-13:16" dir="auto"> - <a href="#i-dont-know" aria-hidden="true" class="anchor" id="user-content-i-dont-know"></a>I don't know</h3> -08_04_50__gitlab_internal_extension_markdown__migrated_golden_master_examples__task_list__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <ul data-sourcepos="1:1-6:15" class="task-list" dir="auto"> - <li data-sourcepos="1:1-1:11" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" checked disabled> hello</li> - <li data-sourcepos="2:1-2:11" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" checked disabled> world</li> - <li data-sourcepos="3:1-6:15" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" disabled> example - <ul data-sourcepos="4:3-6:15" class="task-list"> - <li data-sourcepos="4:3-6:15" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" disabled> of nested - <ul data-sourcepos="5:5-6:15" class="task-list"> - <li data-sourcepos="5:5-5:19" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" checked disabled> task list</li> - <li data-sourcepos="6:5-6:15" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" disabled> items</li> - </ul> - </li> - </ul> - </li> - </ul> -08_04_51__gitlab_internal_extension_markdown__migrated_golden_master_examples__video__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <p data-sourcepos="1:1-1:46" dir="auto"><span class="media-container video-container"><video src="https://gitlab.com/gitlab.mp4" controls="true" data-setup="{}" data-title="Sample Video" preload="metadata"></video><a href="https://gitlab.com/gitlab.mp4" target="_blank" rel="nofollow noreferrer noopener" title="Download 'Sample Video'">Sample Video</a></span></p> -08_04_52__gitlab_internal_extension_markdown__migrated_golden_master_examples__word_break__001: - canonical: | - TODO: Write canonical HTML for this example - static: |- - <p data-sourcepos="1:1-1:60" dir="auto">Fernstraßen<wbr>bau<wbr>privat<wbr>finanzierungs<wbr>gesetz</wbr></wbr></wbr></wbr></p> -08_05_00__gitlab_internal_extension_markdown__image_attributes__001: - canonical: | - <p><img src="https://gitlab.com/logo.png" width="100" height="100"></p> - static: |- - <p data-sourcepos="1:1-1:58" dir="auto"><a class="no-attachment-icon" href="https://gitlab.com/logo.png" target="_blank" rel="nofollow noreferrer noopener"><img data-sourcepos="1:1-1:32" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="" width="100" height="100" decoding="async" class="lazy" data-src="https://gitlab.com/logo.png"></a></p> -08_05_00__gitlab_internal_extension_markdown__image_attributes__002: - canonical: | - <p><img src="https://gitlab.com/logo.png" width="100%"></p> - static: |- - <p data-sourcepos="1:1-1:46" dir="auto"><a class="no-attachment-icon" href="https://gitlab.com/logo.png" target="_blank" rel="nofollow noreferrer noopener"><img data-sourcepos="1:1-1:32" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="" width="100%" decoding="async" class="lazy" data-src="https://gitlab.com/logo.png"></a></p> -08_05_00__gitlab_internal_extension_markdown__image_attributes__003: - canonical: | - <p><img src="https://gitlab.com/logo.png" height="100px"></p> - static: |- - <p data-sourcepos="1:1-1:48" dir="auto"><a class="no-attachment-icon" href="https://gitlab.com/logo.png" target="_blank" rel="nofollow noreferrer noopener"><img data-sourcepos="1:1-1:32" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="" height="100px" decoding="async" class="lazy" data-src="https://gitlab.com/logo.png"></a></p> -08_05_00__gitlab_internal_extension_markdown__image_attributes__004: - canonical: | - <p><img src="https://gitlab.com/logo.png" width="100" height="100"></p> - static: |- - <p data-sourcepos="1:1-1:60" dir="auto"><a class="no-attachment-icon" href="https://gitlab.com/logo.png" target="_blank" rel="nofollow noreferrer noopener"><img data-sourcepos="1:1-1:32" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="" width="100" height="100" decoding="async" class="lazy" data-src="https://gitlab.com/logo.png"></a></p> -08_05_00__gitlab_internal_extension_markdown__image_attributes__005: - canonical: | - <p><img src="https://gitlab.com/logo.png"> {width="100" height="100"}</p> - static: |- - <p data-sourcepos="1:1-1:59" dir="auto"><a class="no-attachment-icon" href="https://gitlab.com/logo.png" target="_blank" rel="nofollow noreferrer noopener"><img data-sourcepos="1:1-1:32" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="" decoding="async" class="lazy" data-src="https://gitlab.com/logo.png"></a> {width="100" height="100"}</p> -08_06_00__gitlab_internal_extension_markdown__footnotes__001: - canonical: | - <p> - footnote reference tag - <sup> - <a href="#fn-fortytwo-42" id="fnref-fortytwo-42" data-footnote-ref> - 1 - </a> - </sup> - </p> - <section data-footnotes> - <ol> - <li id="fn-fortytwo-42"> - <p> - footnote text - <a href="#fnref-fortytwo-42" data-footnote-backref> - </a> - </p> - </li> - </ol> - </section> - static: |- - <p data-sourcepos="1:1-1:34" dir="auto">footnote reference tag <sup data-sourcepos="1:24-1:34" class="footnote-ref"><a href="#fn-fortytwo-42" id="fnref-fortytwo-42" data-footnote-ref>1</a></sup></p> - <section data-sourcepos="3:1-3:26" data-footnotes class="footnotes"> - <ol> - <li data-sourcepos="3:1-3:26" id="fn-fortytwo-42"> - <p data-sourcepos="3:14-3:26">footnote text <a href="#fnref-fortytwo-42" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1" class="footnote-backref"><gl-emoji title="leftwards arrow with hook" data-name="leftwards_arrow_with_hook" data-unicode-version="1.1">↩</gl-emoji></a></p> - </li> - </ol> - </section> -09_00_00__gfm_undocumented_extensions_and_more_robust_test__footnotes__002: - canonical: | - <p>This is some text!<sup class="footnote-ref"><a href="#fn-1" id="fnref-1" data-footnote-ref>1</a></sup>. Other text.<sup class="footnote-ref"><a href="#fn-footnote" id="fnref-footnote" data-footnote-ref>2</a></sup>.</p> - <p>Here's a thing<sup class="footnote-ref"><a href="#fn-other-note" id="fnref-other-note" data-footnote-ref>3</a></sup>.</p> - <p>And another thing<sup class="footnote-ref"><a href="#fn-codeblock-note" id="fnref-codeblock-note" data-footnote-ref>4</a></sup>.</p> - <p>This doesn't have a referent[^nope].</p> - <p>Hi!</p> - <section class="footnotes" data-footnotes> - <ol> - <li id="fn-1"> - <p>Some <em>bolded</em> footnote definition. <a href="#fnref-1" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1">↩</a></p> - </li> - <li id="fn-footnote"> - <blockquote> - <p>Blockquotes can be in a footnote.</p> - </blockquote> - <pre><code>as well as code blocks - </code></pre> - <p>or, naturally, simple paragraphs. <a href="#fnref-footnote" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="2" aria-label="Back to reference 2">↩</a></p> - </li> - <li id="fn-other-note"> - <p>no code block here (spaces are stripped away) <a href="#fnref-other-note" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="3" aria-label="Back to reference 3">↩</a></p> - </li> - <li id="fn-codeblock-note"> - <pre><code>this is now a code block (8 spaces indentation) - </code></pre> - <a href="#fnref-codeblock-note" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="4" aria-label="Back to reference 4">↩</a> - </li> - </ol> - </section> - static: |- - <p data-sourcepos="1:1-1:47" dir="auto">This is some text!<sup data-sourcepos="1:19-1:22" class="footnote-ref"><a href="#fn-1-42" id="fnref-1-42" data-footnote-ref>1</a></sup>. Other text.<sup data-sourcepos="1:36-1:46" class="footnote-ref"><a href="#fn-footnote-42" id="fnref-footnote-42" data-footnote-ref>2</a></sup>.</p> - <p data-sourcepos="3:1-3:28" dir="auto">Here's a thing<sup data-sourcepos="3:15-3:27" class="footnote-ref"><a href="#fn-other-note-42" id="fnref-other-note-42" data-footnote-ref>3</a></sup>.</p> - <p data-sourcepos="5:1-5:35" dir="auto">And another thing<sup data-sourcepos="5:18-5:34" class="footnote-ref"><a href="#fn-codeblock-note-42" id="fnref-codeblock-note-42" data-footnote-ref>4</a></sup>.</p> - <p data-sourcepos="7:1-7:36" dir="auto">This doesn't have a referent[^nope].</p> - <p data-sourcepos="17:1-17:3" dir="auto">Hi!</p> - <section data-sourcepos="15:1-16:0" data-footnotes class="footnotes"> - <ol> - <li data-sourcepos="15:1-16:0" id="fn-1-42"> - <p data-sourcepos="15:7-15:40">Some <em data-sourcepos="15:12-15:19">bolded</em> footnote definition. <a href="#fnref-1-42" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1" class="footnote-backref"><gl-emoji title="leftwards arrow with hook" data-name="leftwards_arrow_with_hook" data-unicode-version="1.1">↩</gl-emoji></a></p> - </li> - <li data-sourcepos="19:1-25:0" id="fn-footnote-42"> - <blockquote data-sourcepos="20:5-20:39"> - <p data-sourcepos="20:7-20:39">Blockquotes can be in a footnote.</p> - </blockquote> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="22:9-23:0" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">as well as code blocks</span></code></pre> - <copy-code></copy-code> - </div> - <p data-sourcepos="24:5-24:37">or, naturally, simple paragraphs. <a href="#fnref-footnote-42" data-footnote-backref data-footnote-backref-idx="2" aria-label="Back to reference 2" class="footnote-backref"><gl-emoji title="leftwards arrow with hook" data-name="leftwards_arrow_with_hook" data-unicode-version="1.1">↩</gl-emoji></a></p> - </li> - <li data-sourcepos="10:1-11:0" id="fn-other-note-42"> - <p data-sourcepos="10:22-10:66">no code block here (spaces are stripped away) <a href="#fnref-other-note-42" data-footnote-backref data-footnote-backref-idx="3" aria-label="Back to reference 3" class="footnote-backref"><gl-emoji title="leftwards arrow with hook" data-name="leftwards_arrow_with_hook" data-unicode-version="1.1">↩</gl-emoji></a></p> - </li> - <li data-sourcepos="12:1-14:0" id="fn-codeblock-note-42"> - <div class="gl-relative markdown-code-block js-markdown-code"> - <pre data-sourcepos="13:9-14:0" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">this is now a code block (8 spaces indentation)</span></code></pre> - <copy-code></copy-code> - </div> - <a href="#fnref-codeblock-note-42" data-footnote-backref data-footnote-backref-idx="4" aria-label="Back to reference 4" class="footnote-backref"><gl-emoji title="leftwards arrow with hook" data-name="leftwards_arrow_with_hook" data-unicode-version="1.1">↩</gl-emoji></a> - </li> - </ol> - </section> -? 09_01_00__gfm_undocumented_extensions_and_more_robust_test__when_a_footnote_is_used_multiple_times,_we_insert_multiple_backrefs.__001 -: canonical: | - <p>This is some text. It has a footnote<sup class="footnote-ref"><a href="#fn-a-footnote" id="fnref-a-footnote" data-footnote-ref>1</a></sup>.</p> - <p>This footnote is referenced<sup class="footnote-ref"><a href="#fn-a-footnote" id="fnref-a-footnote-2" data-footnote-ref>1</a></sup> multiple times, in lots of different places.<sup class="footnote-ref"><a href="#fn-a-footnote" id="fnref-a-footnote-3" data-footnote-ref>1</a></sup></p> - <section class="footnotes" data-footnotes> - <ol> - <li id="fn-a-footnote"> - <p>This footnote definition should have three backrefs. <a href="#fnref-a-footnote" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1">↩</a> <a href="#fnref-a-footnote-2" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1-2" aria-label="Back to reference 1-2">↩<sup class="footnote-ref">2</sup></a> <a href="#fnref-a-footnote-3" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1-3" aria-label="Back to reference 1-3">↩<sup class="footnote-ref">3</sup></a></p> - </li> - </ol> - </section> - static: |- - <p data-sourcepos="1:1-1:50" dir="auto">This is some text. It has a footnote<sup data-sourcepos="1:37-1:49" class="footnote-ref"><a href="#fn-a-footnote-42" id="fnref-a-footnote-42" data-footnote-ref>1</a></sup>.</p> - <p data-sourcepos="3:1-3:98" dir="auto">This footnote is referenced<sup data-sourcepos="3:28-3:40"><a href="#fn-a-footnote" id="fnref-a-footnote-2" data-footnote-ref>1</a></sup> multiple times, in lots of different places.<sup data-sourcepos="3:86-3:98"><a href="#fn-a-footnote" id="fnref-a-footnote-3" data-footnote-ref>1</a></sup></p> - <section data-sourcepos="5:1-5:67" data-footnotes class="footnotes"> - <ol> - <li data-sourcepos="5:1-5:67" id="fn-a-footnote-42"> - <p data-sourcepos="5:16-5:67">This footnote definition should have three backrefs. <a href="#fnref-a-footnote-42" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1" class="footnote-backref"><gl-emoji title="leftwards arrow with hook" data-name="leftwards_arrow_with_hook" data-unicode-version="1.1">↩</gl-emoji></a> <a href="#fnref-a-footnote-2" data-footnote-backref data-footnote-backref-idx="1-2" aria-label="Back to reference 1-2"><gl-emoji title="leftwards arrow with hook" data-name="leftwards_arrow_with_hook" data-unicode-version="1.1">↩</gl-emoji><sup>2</sup></a> <a href="#fnref-a-footnote-3" data-footnote-backref data-footnote-backref-idx="1-3" aria-label="Back to reference 1-3"><gl-emoji title="leftwards arrow with hook" data-name="leftwards_arrow_with_hook" data-unicode-version="1.1">↩</gl-emoji><sup>3</sup></a></p> - </li> - </ol> - </section> -09_02_00__gfm_undocumented_extensions_and_more_robust_test__footnote_reference_labels_are_href_escaped__001: - canonical: | - <p>Hello<sup class="footnote-ref"><a href="#fn-%22%3E%3Cscript%3Ealert(1)%3C/script%3E" id="fnref-%22%3E%3Cscript%3Ealert(1)%3C/script%3E" data-footnote-ref>1</a></sup></p> - <section class="footnotes" data-footnotes> - <ol> - <li id="fn-%22%3E%3Cscript%3Ealert(1)%3C/script%3E"> - <p>pwned <a href="#fnref-%22%3E%3Cscript%3Ealert(1)%3C/script%3E" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1">↩</a></p> - </li> - </ol> - </section> - static: |- - <p data-sourcepos="1:1-1:35" dir="auto">Hello<sup data-sourcepos="1:6-1:35" class="footnote-ref"><a href="#fn-%22%3E%3Cscript%3Ealert(1)%3C/script%3E-42" id="fnref-%22%3E%3Cscript%3Ealert(1)%3C/script%3E-42" data-footnote-ref>1</a></sup></p> - <section data-sourcepos="3:1-3:37" data-footnotes class="footnotes"> - <ol> - <li data-sourcepos="3:1-3:37" id="fn-%22%3E%3Cscript%3Ealert(1)%3C/script%3E-42"> - <p data-sourcepos="3:33-3:37">pwned <a href="#fnref-%22%3E%3Cscript%3Ealert(1)%3C/script%3E-42" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1" class="footnote-backref"><gl-emoji title="leftwards arrow with hook" data-name="leftwards_arrow_with_hook" data-unicode-version="1.1">↩</gl-emoji></a></p> - </li> - </ol> - </section> -09_03_00__gfm_undocumented_extensions_and_more_robust_test__interop__001: - canonical: | - <p><del><a href="http://www.google.com">www.google.com</a></del></p> - <p><del><a href="http://google.com">http://google.com</a></del></p> - static: |- - <p data-sourcepos="1:1-1:18" dir="auto"><del data-sourcepos="1:1-1:18"><a href="http://www.google.com" rel="nofollow noreferrer noopener" target="_blank">www.google.com</a></del></p> - <p data-sourcepos="3:1-3:21" dir="auto"><del data-sourcepos="3:1-3:21"><a href="http://google.com" rel="nofollow noreferrer noopener" target="_blank">http://google.com</a></del></p> -09_03_00__gfm_undocumented_extensions_and_more_robust_test__interop__002: - canonical: | - <table> - <thead> - <tr> - <th>a</th> - <th>b</th> - </tr> - </thead> - <tbody> - <tr> - <td><a href="https://github.com">https://github.com</a> <a href="http://www.github.com">www.github.com</a></td> - <td><a href="http://pokemon.com">http://pokemon.com</a></td> - </tr> - </tbody> - </table> - static: |- - <table data-sourcepos="1:1-3:58" dir="auto"> - <thead> - <tr data-sourcepos="1:1-1:9"> - <th data-sourcepos="1:2-1:4">a</th> - <th data-sourcepos="1:6-1:8">b</th> - </tr> - </thead> - <tbody> - <tr data-sourcepos="3:1-3:58"> - <td data-sourcepos="3:2-3:36"> - <a href="https://github.com" rel="nofollow noreferrer noopener" target="_blank">https://github.com</a> <a href="http://www.github.com" rel="nofollow noreferrer noopener" target="_blank">www.github.com</a> - </td> - <td data-sourcepos="3:38-3:57"><a href="http://pokemon.com" rel="nofollow noreferrer noopener" target="_blank">http://pokemon.com</a></td> - </tr> - </tbody> - </table> -09_04_00__gfm_undocumented_extensions_and_more_robust_test__task_lists__001: - canonical: | - <ul> - <li><input type="checkbox" disabled="" /> foo</li> - <li><input type="checkbox" checked="" disabled="" /> bar</li> - </ul> - static: |- - <ul data-sourcepos="1:1-2:9" class="task-list" dir="auto"> - <li data-sourcepos="1:1-1:9" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" disabled> foo</li> - <li data-sourcepos="2:1-2:9" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" checked disabled> bar</li> - </ul> -09_04_00__gfm_undocumented_extensions_and_more_robust_test__task_lists__002: - canonical: | - <ul> - <li><input type="checkbox" checked="" disabled="" /> foo - <ul> - <li><input type="checkbox" disabled="" /> bar</li> - <li><input type="checkbox" checked="" disabled="" /> baz</li> - </ul> - </li> - <li><input type="checkbox" disabled="" /> bim</li> - </ul> - <p>Show a regular (non task) list to show that it has the same structure</p> - <ul> - <li>[@] foo - <ul> - <li>[@] bar</li> - <li>[@] baz</li> - </ul> - </li> - <li>[@] bim</li> - </ul> - static: |- - <ul data-sourcepos="1:1-5:0" class="task-list" dir="auto"> - <li data-sourcepos="1:1-3:11" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" checked disabled> foo - <ul data-sourcepos="2:3-3:11" class="task-list"> - <li data-sourcepos="2:3-2:11" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" disabled> bar</li> - <li data-sourcepos="3:3-3:11" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" checked disabled> baz</li> - </ul> - </li> - <li data-sourcepos="4:1-5:0" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" disabled> bim</li> - </ul> - <p data-sourcepos="6:1-6:69" dir="auto">Show a regular (non task) list to show that it has the same structure</p> - <ul data-sourcepos="7:1-10:9" dir="auto"> - <li data-sourcepos="7:1-9:11">[@] foo - <ul data-sourcepos="8:3-9:11"> - <li data-sourcepos="8:3-8:11">[@] bar</li> - <li data-sourcepos="9:3-9:11">[@] baz</li> - </ul> - </li> - <li data-sourcepos="10:1-10:9">[@] bim</li> - </ul> -09_04_00__gfm_undocumented_extensions_and_more_robust_test__task_lists__003: - canonical: | - <ul> - <li><input type="checkbox" checked="" disabled="" /> foo - <ul> - <li><input type="checkbox" disabled="" /> bar</li> - <li><input type="checkbox" checked="" disabled="" /> baz</li> - </ul> - </li> - <li><input type="checkbox" disabled="" /> bim</li> - </ul> - <p>Show a regular (non task) list to show that it has the same structure</p> - <ul> - <li>[@] foo - <ul> - <li>[@] bar</li> - <li>[@] baz</li> - </ul> - </li> - <li>[@] bim</li> - </ul> - static: |- - <ul data-sourcepos="1:1-5:0" class="task-list" dir="auto"> - <li data-sourcepos="1:1-3:13" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" checked disabled> foo - <ul data-sourcepos="2:5-3:13" class="task-list"> - <li data-sourcepos="2:5-2:13" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" disabled> bar</li> - <li data-sourcepos="3:5-3:13" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" checked disabled> baz</li> - </ul> - </li> - <li data-sourcepos="4:1-5:0" class="task-list-item"> - <task-button></task-button><input type="checkbox" class="task-list-item-checkbox" disabled> bim</li> - </ul> - <p data-sourcepos="6:1-6:69" dir="auto">Show a regular (non task) list to show that it has the same structure</p> - <ul data-sourcepos="7:1-10:9" dir="auto"> - <li data-sourcepos="7:1-9:13">[@] foo - <ul data-sourcepos="8:5-9:13"> - <li data-sourcepos="8:5-8:13">[@] bar</li> - <li data-sourcepos="9:5-9:13">[@] baz</li> - </ul> - </li> - <li data-sourcepos="10:1-10:9">[@] bim</li> - </ul> diff --git a/glfm_specification/output_example_snapshots/markdown.yml b/glfm_specification/output_example_snapshots/markdown.yml deleted file mode 100644 index 926df94e0f4774ef09ed1286998654fee5813b2e..0000000000000000000000000000000000000000 --- a/glfm_specification/output_example_snapshots/markdown.yml +++ /dev/null @@ -1,2630 +0,0 @@ ---- -02_01_00__preliminaries__tabs__001: "\tfoo\tbaz\t\tbim\n" -02_01_00__preliminaries__tabs__002: " \tfoo\tbaz\t\tbim\n" -02_01_00__preliminaries__tabs__003: " a\ta\n á½\ta\n" -02_01_00__preliminaries__tabs__004: " - foo\n\n\tbar\n" -02_01_00__preliminaries__tabs__005: "- foo\n\n\t\tbar\n" -02_01_00__preliminaries__tabs__006: ">\t\tfoo\n" -02_01_00__preliminaries__tabs__007: "-\t\tfoo\n" -02_01_00__preliminaries__tabs__008: " foo\n\tbar\n" -02_01_00__preliminaries__tabs__009: " - foo\n - bar\n\t - baz\n" -02_01_00__preliminaries__tabs__010: "#\tFoo\n" -02_01_00__preliminaries__tabs__011: "*\t*\t*\t\n" -03_01_00__blocks_and_inlines__precedence__001: | - - `one - - two` -04_01_00__leaf_blocks__thematic_breaks__001: | - *** - --- - ___ -04_01_00__leaf_blocks__thematic_breaks__002: | - +++ -04_01_00__leaf_blocks__thematic_breaks__003: | - === -04_01_00__leaf_blocks__thematic_breaks__004: | - -- - ** - __ -04_01_00__leaf_blocks__thematic_breaks__005: |2 - *** - *** - *** -04_01_00__leaf_blocks__thematic_breaks__006: |2 - *** -04_01_00__leaf_blocks__thematic_breaks__007: | - Foo - *** -04_01_00__leaf_blocks__thematic_breaks__008: | - _____________________________________ -04_01_00__leaf_blocks__thematic_breaks__009: |2 - - - - -04_01_00__leaf_blocks__thematic_breaks__010: |2 - ** * ** * ** * ** -04_01_00__leaf_blocks__thematic_breaks__011: | - - - - - -04_01_00__leaf_blocks__thematic_breaks__012: "- - - - \n" -04_01_00__leaf_blocks__thematic_breaks__013: | - _ _ _ _ a - - a------ - - ---a--- -04_01_00__leaf_blocks__thematic_breaks__014: |2 - *-* -04_01_00__leaf_blocks__thematic_breaks__015: | - - foo - *** - - bar -04_01_00__leaf_blocks__thematic_breaks__016: | - Foo - *** - bar -04_01_00__leaf_blocks__thematic_breaks__017: | - Foo - --- - bar -04_01_00__leaf_blocks__thematic_breaks__018: | - * Foo - * * * - * Bar -04_01_00__leaf_blocks__thematic_breaks__019: | - - Foo - - * * * -04_02_00__leaf_blocks__atx_headings__001: | - # foo - ## foo - ### foo - #### foo - ##### foo - ###### foo -04_02_00__leaf_blocks__atx_headings__002: | - ####### foo -04_02_00__leaf_blocks__atx_headings__003: | - #5 bolt - - #hashtag -04_02_00__leaf_blocks__atx_headings__004: | - \## foo -04_02_00__leaf_blocks__atx_headings__005: | - # foo *bar* \*baz\* -04_02_00__leaf_blocks__atx_headings__006: "# foo \n" -04_02_00__leaf_blocks__atx_headings__007: |2 - ### foo - ## foo - # foo -04_02_00__leaf_blocks__atx_headings__008: |2 - # foo -04_02_00__leaf_blocks__atx_headings__009: | - foo - # bar -04_02_00__leaf_blocks__atx_headings__010: | - ## foo ## - ### bar ### -04_02_00__leaf_blocks__atx_headings__011: | - # foo ################################## - ##### foo ## -04_02_00__leaf_blocks__atx_headings__012: "### foo ### \n" -04_02_00__leaf_blocks__atx_headings__013: | - ### foo ### b -04_02_00__leaf_blocks__atx_headings__014: | - # foo# -04_02_00__leaf_blocks__atx_headings__015: | - ### foo \### - ## foo #\## - # foo \# -04_02_00__leaf_blocks__atx_headings__016: | - **** - ## foo - **** -04_02_00__leaf_blocks__atx_headings__017: | - Foo bar - # baz - Bar foo -04_02_00__leaf_blocks__atx_headings__018: "## \n#\n### ###\n" -04_03_00__leaf_blocks__setext_headings__001: | - Foo *bar* - ========= - - Foo *bar* - --------- -04_03_00__leaf_blocks__setext_headings__002: | - Foo *bar - baz* - ==== -04_03_00__leaf_blocks__setext_headings__003: " Foo *bar\nbaz*\t\n====\n" -04_03_00__leaf_blocks__setext_headings__004: | - Foo - ------------------------- - - Foo - = -04_03_00__leaf_blocks__setext_headings__005: |2 - Foo - --- - - Foo - ----- - - Foo - === -04_03_00__leaf_blocks__setext_headings__006: |2 - Foo - --- - - Foo - --- -04_03_00__leaf_blocks__setext_headings__007: "Foo\n ---- \n" -04_03_00__leaf_blocks__setext_headings__008: | - Foo - --- -04_03_00__leaf_blocks__setext_headings__009: | - Foo - = = - - Foo - --- - -04_03_00__leaf_blocks__setext_headings__010: "Foo \n-----\n" -04_03_00__leaf_blocks__setext_headings__011: | - Foo\ - ---- -04_03_00__leaf_blocks__setext_headings__012: | - `Foo - ---- - ` - - <a title="a lot - --- - of dashes"/> -04_03_00__leaf_blocks__setext_headings__013: | - > Foo - --- -04_03_00__leaf_blocks__setext_headings__014: | - > foo - bar - === -04_03_00__leaf_blocks__setext_headings__015: | - - Foo - --- -04_03_00__leaf_blocks__setext_headings__016: | - Foo - Bar - --- -04_03_00__leaf_blocks__setext_headings__017: | - --- - Foo - --- - Bar - --- - Baz -04_03_00__leaf_blocks__setext_headings__018: |2 - - ==== -04_03_00__leaf_blocks__setext_headings__019: | - --- - --- -04_03_00__leaf_blocks__setext_headings__020: | - - foo - ----- -04_03_00__leaf_blocks__setext_headings__021: |2 - foo - --- -04_03_00__leaf_blocks__setext_headings__022: | - > foo - ----- -04_03_00__leaf_blocks__setext_headings__023: | - \> foo - ------ -04_03_00__leaf_blocks__setext_headings__024: | - Foo - - bar - --- - baz -04_03_00__leaf_blocks__setext_headings__025: | - Foo - bar - - --- - - baz -04_03_00__leaf_blocks__setext_headings__026: | - Foo - bar - * * * - baz -04_03_00__leaf_blocks__setext_headings__027: | - Foo - bar - \--- - baz -04_04_00__leaf_blocks__indented_code_blocks__001: |2 - a simple - indented code block -04_04_00__leaf_blocks__indented_code_blocks__002: |2 - - foo - - bar -04_04_00__leaf_blocks__indented_code_blocks__003: | - 1. foo - - - bar -04_04_00__leaf_blocks__indented_code_blocks__004: |2 - <a/> - *hi* - - - one -04_04_00__leaf_blocks__indented_code_blocks__005: " chunk1\n\n chunk2\n \n - \n \n chunk3\n" -04_04_00__leaf_blocks__indented_code_blocks__006: " chunk1\n \n chunk2\n" -04_04_00__leaf_blocks__indented_code_blocks__007: |+ - Foo - bar - -04_04_00__leaf_blocks__indented_code_blocks__008: |2 - foo - bar -04_04_00__leaf_blocks__indented_code_blocks__009: | - # Heading - foo - Heading - ------ - foo - ---- -04_04_00__leaf_blocks__indented_code_blocks__010: |2 - foo - bar -04_04_00__leaf_blocks__indented_code_blocks__011: "\n \n foo\n \n\n" -04_04_00__leaf_blocks__indented_code_blocks__012: " foo \n" -04_05_00__leaf_blocks__fenced_code_blocks__001: | - ``` - < - > - ``` -04_05_00__leaf_blocks__fenced_code_blocks__002: | - ~~~ - < - > - ~~~ -04_05_00__leaf_blocks__fenced_code_blocks__003: | - `` - foo - `` -04_05_00__leaf_blocks__fenced_code_blocks__004: | - ``` - aaa - ~~~ - ``` -04_05_00__leaf_blocks__fenced_code_blocks__005: | - ~~~ - aaa - ``` - ~~~ -04_05_00__leaf_blocks__fenced_code_blocks__006: | - ```` - aaa - ``` - `````` -04_05_00__leaf_blocks__fenced_code_blocks__007: | - ~~~~ - aaa - ~~~ - ~~~~ -04_05_00__leaf_blocks__fenced_code_blocks__008: | - ``` -04_05_00__leaf_blocks__fenced_code_blocks__009: | - ````` - - ``` - aaa -04_05_00__leaf_blocks__fenced_code_blocks__010: | - > ``` - > aaa - - bbb -04_05_00__leaf_blocks__fenced_code_blocks__011: "```\n\n \n```\n" -04_05_00__leaf_blocks__fenced_code_blocks__012: | - ``` - ``` -04_05_00__leaf_blocks__fenced_code_blocks__013: |2 - ``` - aaa - aaa - ``` -04_05_00__leaf_blocks__fenced_code_blocks__014: |2 - ``` - aaa - aaa - aaa - ``` -04_05_00__leaf_blocks__fenced_code_blocks__015: |2 - ``` - aaa - aaa - aaa - ``` -04_05_00__leaf_blocks__fenced_code_blocks__016: |2 - ``` - aaa - ``` -04_05_00__leaf_blocks__fenced_code_blocks__017: | - ``` - aaa - ``` -04_05_00__leaf_blocks__fenced_code_blocks__018: |2 - ``` - aaa - ``` -04_05_00__leaf_blocks__fenced_code_blocks__019: | - ``` - aaa - ``` -04_05_00__leaf_blocks__fenced_code_blocks__020: | - ``` ``` - aaa -04_05_00__leaf_blocks__fenced_code_blocks__021: | - ~~~~~~ - aaa - ~~~ ~~ -04_05_00__leaf_blocks__fenced_code_blocks__022: | - foo - ``` - bar - ``` - baz -04_05_00__leaf_blocks__fenced_code_blocks__023: | - foo - --- - ~~~ - bar - ~~~ - # baz -04_05_00__leaf_blocks__fenced_code_blocks__024: | - ```ruby - def foo(x) - return 3 - end - ``` -04_05_00__leaf_blocks__fenced_code_blocks__025: | - ~~~~ ruby startline=3 $%@#$ - def foo(x) - return 3 - end - ~~~~~~~ -04_05_00__leaf_blocks__fenced_code_blocks__026: | - ````; - ```` -04_05_00__leaf_blocks__fenced_code_blocks__027: | - ``` aa ``` - foo -04_05_00__leaf_blocks__fenced_code_blocks__028: | - ~~~ aa ``` ~~~ - foo - ~~~ -04_05_00__leaf_blocks__fenced_code_blocks__029: | - ``` - ``` aaa - ``` -04_06_00__leaf_blocks__html_blocks__001: | - <table><tr><td> - <pre> - **Hello**, - - _world_. - </pre> - </td></tr></table> -04_06_00__leaf_blocks__html_blocks__002: | - <table> - <tr> - <td> - hi - </td> - </tr> - </table> - - okay. -04_06_00__leaf_blocks__html_blocks__003: |2 - <div> - *hello* - <foo><a> -04_06_00__leaf_blocks__html_blocks__004: | - </div> - *foo* -04_06_00__leaf_blocks__html_blocks__005: | - <DIV CLASS="foo"> - - *Markdown* - - </DIV> -04_06_00__leaf_blocks__html_blocks__006: | - <div id="foo" - class="bar"> - </div> -04_06_00__leaf_blocks__html_blocks__007: | - <div id="foo" class="bar - baz"> - </div> -04_06_00__leaf_blocks__html_blocks__008: | - <div> - *foo* - - *bar* -04_06_00__leaf_blocks__html_blocks__009: | - <div id="foo" - *hi* -04_06_00__leaf_blocks__html_blocks__010: | - <div class - foo -04_06_00__leaf_blocks__html_blocks__011: | - <div *???-&&&-<--- - *foo* -04_06_00__leaf_blocks__html_blocks__012: | - <div><a href="bar">*foo*</a></div> -04_06_00__leaf_blocks__html_blocks__013: | - <table><tr><td> - foo - </td></tr></table> -04_06_00__leaf_blocks__html_blocks__014: | - <div></div> - ``` c - int x = 33; - ``` -04_06_00__leaf_blocks__html_blocks__015: | - <a href="foo"> - *bar* - </a> -04_06_00__leaf_blocks__html_blocks__016: | - <Warning> - *bar* - </Warning> -04_06_00__leaf_blocks__html_blocks__017: | - <i class="foo"> - *bar* - </i> -04_06_00__leaf_blocks__html_blocks__018: | - </ins> - *bar* -04_06_00__leaf_blocks__html_blocks__019: | - <del> - *foo* - </del> -04_06_00__leaf_blocks__html_blocks__020: | - <del> - - *foo* - - </del> -04_06_00__leaf_blocks__html_blocks__021: | - <del>*foo*</del> -04_06_00__leaf_blocks__html_blocks__022: | - <pre language="haskell"><code> - import Text.HTML.TagSoup - - main :: IO () - main = print $ parseTags tags - </code></pre> - okay -04_06_00__leaf_blocks__html_blocks__023: | - <script type="text/javascript"> - // JavaScript example - - document.getElementById("demo").innerHTML = "Hello JavaScript!"; - </script> - okay -04_06_00__leaf_blocks__html_blocks__024: | - <style - type="text/css"> - h1 {color:red;} - - p {color:blue;} - </style> - okay -04_06_00__leaf_blocks__html_blocks__025: | - <style - type="text/css"> - - foo -04_06_00__leaf_blocks__html_blocks__026: | - > <div> - > foo - - bar -04_06_00__leaf_blocks__html_blocks__027: | - - <div> - - foo -04_06_00__leaf_blocks__html_blocks__028: | - <style>p{color:red;}</style> - *foo* -04_06_00__leaf_blocks__html_blocks__029: | - <!-- foo -->*bar* - *baz* -04_06_00__leaf_blocks__html_blocks__030: | - <script> - foo - </script>1. *bar* -04_06_00__leaf_blocks__html_blocks__031: | - <!-- Foo - - bar - baz --> - okay -04_06_00__leaf_blocks__html_blocks__032: | - <?php - - echo '>'; - - ?> - okay -04_06_00__leaf_blocks__html_blocks__033: | - <!DOCTYPE html> -04_06_00__leaf_blocks__html_blocks__034: | - <![CDATA[ - function matchwo(a,b) - { - if (a < b && a < 0) then { - return 1; - - } else { - - return 0; - } - } - ]]> - okay -04_06_00__leaf_blocks__html_blocks__035: |2 - <!-- foo --> - - <!-- foo --> -04_06_00__leaf_blocks__html_blocks__036: |2 - <div> - - <div> -04_06_00__leaf_blocks__html_blocks__037: | - Foo - <div> - bar - </div> -04_06_00__leaf_blocks__html_blocks__038: | - <div> - bar - </div> - *foo* -04_06_00__leaf_blocks__html_blocks__039: | - Foo - <a href="bar"> - baz -04_06_00__leaf_blocks__html_blocks__040: | - <div> - - *Emphasized* text. - - </div> -04_06_00__leaf_blocks__html_blocks__041: | - <div> - *Emphasized* text. - </div> -04_06_00__leaf_blocks__html_blocks__042: | - <table> - - <tr> - - <td> - Hi - </td> - - </tr> - - </table> -04_06_00__leaf_blocks__html_blocks__043: | - <table> - - <tr> - - <td> - Hi - </td> - - </tr> - - </table> -04_07_00__leaf_blocks__link_reference_definitions__001: | - [foo]: /url "title" - - [foo] -04_07_00__leaf_blocks__link_reference_definitions__002: " [foo]: \n /url \n - \ 'the title' \n\n[foo]\n" -04_07_00__leaf_blocks__link_reference_definitions__003: | - [Foo*bar\]]:my_(url) 'title (with parens)' - - [Foo*bar\]] -04_07_00__leaf_blocks__link_reference_definitions__004: | - [Foo bar]: - <my url> - 'title' - - [Foo bar] -04_07_00__leaf_blocks__link_reference_definitions__005: | - [foo]: /url ' - title - line1 - line2 - ' - - [foo] -04_07_00__leaf_blocks__link_reference_definitions__006: | - [foo]: /url 'title - - with blank line' - - [foo] -04_07_00__leaf_blocks__link_reference_definitions__007: | - [foo]: - /url - - [foo] -04_07_00__leaf_blocks__link_reference_definitions__008: | - [foo]: - - [foo] -04_07_00__leaf_blocks__link_reference_definitions__009: | - [foo]: <> - - [foo] -04_07_00__leaf_blocks__link_reference_definitions__010: | - [foo]: <bar>(baz) - - [foo] -04_07_00__leaf_blocks__link_reference_definitions__011: | - [foo]: /url\bar\*baz "foo\"bar\baz" - - [foo] -04_07_00__leaf_blocks__link_reference_definitions__012: | - [foo] - - [foo]: url -04_07_00__leaf_blocks__link_reference_definitions__013: | - [foo] - - [foo]: first - [foo]: second -04_07_00__leaf_blocks__link_reference_definitions__014: | - [FOO]: /url - - [Foo] -04_07_00__leaf_blocks__link_reference_definitions__015: | - [ΑΓΩ]: /φου - - [αγω] -04_07_00__leaf_blocks__link_reference_definitions__016: | - [foo]: /url -04_07_00__leaf_blocks__link_reference_definitions__017: | - [ - foo - ]: /url - bar -04_07_00__leaf_blocks__link_reference_definitions__018: | - [foo]: /url "title" ok -04_07_00__leaf_blocks__link_reference_definitions__019: | - [foo]: /url - "title" ok -04_07_00__leaf_blocks__link_reference_definitions__020: |2 - [foo]: /url "title" - - [foo] -04_07_00__leaf_blocks__link_reference_definitions__021: | - ``` - [foo]: /url - ``` - - [foo] -04_07_00__leaf_blocks__link_reference_definitions__022: | - Foo - [bar]: /baz - - [bar] -04_07_00__leaf_blocks__link_reference_definitions__023: | - # [Foo] - [foo]: /url - > bar -04_07_00__leaf_blocks__link_reference_definitions__024: | - [foo]: /url - bar - === - [foo] -04_07_00__leaf_blocks__link_reference_definitions__025: | - [foo]: /url - === - [foo] -04_07_00__leaf_blocks__link_reference_definitions__026: | - [foo]: /foo-url "foo" - [bar]: /bar-url - "bar" - [baz]: /baz-url - - [foo], - [bar], - [baz] -04_07_00__leaf_blocks__link_reference_definitions__027: | - [foo] - - > [foo]: /url -04_07_00__leaf_blocks__link_reference_definitions__028: | - [foo]: /url -04_08_00__leaf_blocks__paragraphs__001: | - aaa - - bbb -04_08_00__leaf_blocks__paragraphs__002: | - aaa - bbb - - ccc - ddd -04_08_00__leaf_blocks__paragraphs__003: | - aaa - - - bbb -04_08_00__leaf_blocks__paragraphs__004: |2 - aaa - bbb -04_08_00__leaf_blocks__paragraphs__005: | - aaa - bbb - ccc -04_08_00__leaf_blocks__paragraphs__006: |2 - aaa - bbb -04_08_00__leaf_blocks__paragraphs__007: |2 - aaa - bbb -04_08_00__leaf_blocks__paragraphs__008: "aaa \nbbb \n" -04_09_00__leaf_blocks__blank_lines__001: " \n\naaa\n \n\n# aaa\n\n \n" -04_10_00__leaf_blocks__tables_extension__001: | - | foo | bar | - | --- | --- | - | baz | bim | -04_10_00__leaf_blocks__tables_extension__002: | - | abc | defghi | - :-: | -----------: - bar | baz -04_10_00__leaf_blocks__tables_extension__003: | - | f\|oo | - | ------ | - | b `\|` az | - | b **\|** im | -04_10_00__leaf_blocks__tables_extension__004: | - | abc | def | - | --- | --- | - | bar | baz | - > bar -04_10_00__leaf_blocks__tables_extension__005: | - | abc | def | - | --- | --- | - | bar | baz | - bar - - bar -04_10_00__leaf_blocks__tables_extension__006: | - | abc | def | - | --- | - | bar | -04_10_00__leaf_blocks__tables_extension__007: | - | abc | def | - | --- | --- | - | bar | - | bar | baz | boo | -04_10_00__leaf_blocks__tables_extension__008: | - | abc | def | - | --- | --- | -05_01_00__container_blocks__block_quotes__001: | - > # Foo - > bar - > baz -05_01_00__container_blocks__block_quotes__002: | - ># Foo - >bar - > baz -05_01_00__container_blocks__block_quotes__003: |2 - > # Foo - > bar - > baz -05_01_00__container_blocks__block_quotes__004: |2 - > # Foo - > bar - > baz -05_01_00__container_blocks__block_quotes__005: | - > # Foo - > bar - baz -05_01_00__container_blocks__block_quotes__006: | - > bar - baz - > foo -05_01_00__container_blocks__block_quotes__007: | - > foo - --- -05_01_00__container_blocks__block_quotes__008: | - > - foo - - bar -05_01_00__container_blocks__block_quotes__009: | - > foo - bar -05_01_00__container_blocks__block_quotes__010: | - > ``` - foo - ``` -05_01_00__container_blocks__block_quotes__011: | - > foo - - bar -05_01_00__container_blocks__block_quotes__012: | - > -05_01_00__container_blocks__block_quotes__013: ">\n> \n> \n" -05_01_00__container_blocks__block_quotes__014: ">\n> foo\n> \n" -05_01_00__container_blocks__block_quotes__015: | - > foo - - > bar -05_01_00__container_blocks__block_quotes__016: | - > foo - > bar -05_01_00__container_blocks__block_quotes__017: | - > foo - > - > bar -05_01_00__container_blocks__block_quotes__018: | - foo - > bar -05_01_00__container_blocks__block_quotes__019: | - > aaa - *** - > bbb -05_01_00__container_blocks__block_quotes__020: | - > bar - baz -05_01_00__container_blocks__block_quotes__021: | - > bar - - baz -05_01_00__container_blocks__block_quotes__022: | - > bar - > - baz -05_01_00__container_blocks__block_quotes__023: | - > > > foo - bar -05_01_00__container_blocks__block_quotes__024: | - >>> foo - > bar - >>baz -05_01_00__container_blocks__block_quotes__025: | - > code - - > not code -05_02_00__container_blocks__list_items__001: | - A paragraph - with two lines. - - indented code - - > A block quote. -05_02_00__container_blocks__list_items__002: | - 1. A paragraph - with two lines. - - indented code - - > A block quote. -05_02_00__container_blocks__list_items__003: | - - one - - two -05_02_00__container_blocks__list_items__004: | - - one - - two -05_02_00__container_blocks__list_items__005: |2 - - one - - two -05_02_00__container_blocks__list_items__006: |2 - - one - - two -05_02_00__container_blocks__list_items__007: |2 - > > 1. one - >> - >> two -05_02_00__container_blocks__list_items__008: | - >>- one - >> - > > two -05_02_00__container_blocks__list_items__009: | - -one - - 2.two -05_02_00__container_blocks__list_items__010: | - - foo - - - bar -05_02_00__container_blocks__list_items__011: | - 1. foo - - ``` - bar - ``` - - baz - - > bam -05_02_00__container_blocks__list_items__012: | - - Foo - - bar - - - baz -05_02_00__container_blocks__list_items__013: | - 123456789. ok -05_02_00__container_blocks__list_items__014: | - 1234567890. not ok -05_02_00__container_blocks__list_items__015: | - 0. ok -05_02_00__container_blocks__list_items__016: | - 003. ok -05_02_00__container_blocks__list_items__017: | - -1. not ok -05_02_00__container_blocks__list_items__018: | - - foo - - bar -05_02_00__container_blocks__list_items__019: |2 - 10. foo - - bar -05_02_00__container_blocks__list_items__020: |2 - indented code - - paragraph - - more code -05_02_00__container_blocks__list_items__021: | - 1. indented code - - paragraph - - more code -05_02_00__container_blocks__list_items__022: | - 1. indented code - - paragraph - - more code -05_02_00__container_blocks__list_items__023: |2 - foo - - bar -05_02_00__container_blocks__list_items__024: | - - foo - - bar -05_02_00__container_blocks__list_items__025: | - - foo - - bar -05_02_00__container_blocks__list_items__026: | - - - foo - - - ``` - bar - ``` - - - baz -05_02_00__container_blocks__list_items__027: "- \n foo\n" -05_02_00__container_blocks__list_items__028: | - - - - foo -05_02_00__container_blocks__list_items__029: | - - foo - - - - bar -05_02_00__container_blocks__list_items__030: "- foo\n- \n- bar\n" -05_02_00__container_blocks__list_items__031: | - 1. foo - 2. - 3. bar -05_02_00__container_blocks__list_items__032: | - * -05_02_00__container_blocks__list_items__033: | - foo - * - - foo - 1. -05_02_00__container_blocks__list_items__034: |2 - 1. A paragraph - with two lines. - - indented code - - > A block quote. -05_02_00__container_blocks__list_items__035: |2 - 1. A paragraph - with two lines. - - indented code - - > A block quote. -05_02_00__container_blocks__list_items__036: |2 - 1. A paragraph - with two lines. - - indented code - - > A block quote. -05_02_00__container_blocks__list_items__037: |2 - 1. A paragraph - with two lines. - - indented code - - > A block quote. -05_02_00__container_blocks__list_items__038: |2 - 1. A paragraph - with two lines. - - indented code - - > A block quote. -05_02_00__container_blocks__list_items__039: |2 - 1. A paragraph - with two lines. -05_02_00__container_blocks__list_items__040: | - > 1. > Blockquote - continued here. -05_02_00__container_blocks__list_items__041: | - > 1. > Blockquote - > continued here. -05_02_00__container_blocks__list_items__042: | - - foo - - bar - - baz - - boo -05_02_00__container_blocks__list_items__043: | - - foo - - bar - - baz - - boo -05_02_00__container_blocks__list_items__044: | - 10) foo - - bar -05_02_00__container_blocks__list_items__045: | - 10) foo - - bar -05_02_00__container_blocks__list_items__046: | - - - foo -05_02_00__container_blocks__list_items__047: | - 1. - 2. foo -05_02_00__container_blocks__list_items__048: | - - # Foo - - Bar - --- - baz -05_04_00__container_blocks__lists__001: | - - foo - - bar - + baz -05_04_00__container_blocks__lists__002: | - 1. foo - 2. bar - 3) baz -05_04_00__container_blocks__lists__003: | - Foo - - bar - - baz -05_04_00__container_blocks__lists__004: | - The number of windows in my house is - 14. The number of doors is 6. -05_04_00__container_blocks__lists__005: | - The number of windows in my house is - 1. The number of doors is 6. -05_04_00__container_blocks__lists__006: | - - foo - - - bar - - - - baz -05_04_00__container_blocks__lists__007: | - - foo - - bar - - baz - - - bim -05_04_00__container_blocks__lists__008: | - - foo - - bar - - <!-- --> - - - baz - - bim -05_04_00__container_blocks__lists__009: | - - foo - - notcode - - - foo - - <!-- --> - - code -05_04_00__container_blocks__lists__010: | - - a - - b - - c - - d - - e - - f - - g -05_04_00__container_blocks__lists__011: | - 1. a - - 2. b - - 3. c -05_04_00__container_blocks__lists__012: | - - a - - b - - c - - d - - e -05_04_00__container_blocks__lists__013: | - 1. a - - 2. b - - 3. c -05_04_00__container_blocks__lists__014: | - - a - - b - - - c -05_04_00__container_blocks__lists__015: | - * a - * - - * c -05_04_00__container_blocks__lists__016: | - - a - - b - - c - - d -05_04_00__container_blocks__lists__017: | - - a - - b - - [ref]: /url - - d -05_04_00__container_blocks__lists__018: | - - a - - ``` - b - - - ``` - - c -05_04_00__container_blocks__lists__019: | - - a - - b - - c - - d -05_04_00__container_blocks__lists__020: | - * a - > b - > - * c -05_04_00__container_blocks__lists__021: | - - a - > b - ``` - c - ``` - - d -05_04_00__container_blocks__lists__022: | - - a -05_04_00__container_blocks__lists__023: | - - a - - b -05_04_00__container_blocks__lists__024: | - 1. ``` - foo - ``` - - bar -05_04_00__container_blocks__lists__025: | - * foo - * bar - - baz -05_04_00__container_blocks__lists__026: | - - a - - b - - c - - - d - - e - - f -06_01_00__inlines__001: | - `hi`lo` -06_02_00__inlines__backslash_escapes__001: | - \!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~ -06_02_00__inlines__backslash_escapes__002: "\\\t\\A\\a\\ \\3\\φ\\«\n" -06_02_00__inlines__backslash_escapes__003: | - \*not emphasized* - \<br/> not a tag - \[not a link](/foo) - \`not code` - 1\. not a list - \* not a list - \# not a heading - \[foo]: /url "not a reference" - \ö not a character entity -06_02_00__inlines__backslash_escapes__004: | - \\*emphasis* -06_02_00__inlines__backslash_escapes__005: | - foo\ - bar -06_02_00__inlines__backslash_escapes__006: | - `` \[\` `` -06_02_00__inlines__backslash_escapes__007: |2 - \[\] -06_02_00__inlines__backslash_escapes__008: | - ~~~ - \[\] - ~~~ -06_02_00__inlines__backslash_escapes__009: | - <http://example.com?find=\*> -06_02_00__inlines__backslash_escapes__010: | - <a href="/bar\/)"> -06_02_00__inlines__backslash_escapes__011: | - [foo](/bar\* "ti\*tle") -06_02_00__inlines__backslash_escapes__012: | - [foo] - - [foo]: /bar\* "ti\*tle" -06_02_00__inlines__backslash_escapes__013: | - ``` foo\+bar - foo - ``` -06_03_00__inlines__entity_and_numeric_character_references__001: | - & © Æ Ď - ¾ ℋ ⅆ - ∲ ≧̸ -06_03_00__inlines__entity_and_numeric_character_references__002: | - # Ӓ Ϡ � -06_03_00__inlines__entity_and_numeric_character_references__003: | - " ആ ಫ -06_03_00__inlines__entity_and_numeric_character_references__004: | -   &x; &#; &#x; - � - &#abcdef0; - &ThisIsNotDefined; &hi?; -06_03_00__inlines__entity_and_numeric_character_references__005: | - © -06_03_00__inlines__entity_and_numeric_character_references__006: | - &MadeUpEntity; -06_03_00__inlines__entity_and_numeric_character_references__007: | - <a href="öö.html"> -06_03_00__inlines__entity_and_numeric_character_references__008: | - [foo](/föö "föö") -06_03_00__inlines__entity_and_numeric_character_references__009: | - [foo] - - [foo]: /föö "föö" -06_03_00__inlines__entity_and_numeric_character_references__010: | - ``` föö - foo - ``` -06_03_00__inlines__entity_and_numeric_character_references__011: | - `föö` -06_03_00__inlines__entity_and_numeric_character_references__012: |2 - föfö -06_03_00__inlines__entity_and_numeric_character_references__013: | - *foo* - *foo* -06_03_00__inlines__entity_and_numeric_character_references__014: | - * foo - - * foo -06_03_00__inlines__entity_and_numeric_character_references__015: | - foo bar -06_03_00__inlines__entity_and_numeric_character_references__016: | - 	foo -06_03_00__inlines__entity_and_numeric_character_references__017: | - [a](url "tit") -06_04_00__inlines__code_spans__001: | - `foo` -06_04_00__inlines__code_spans__002: | - `` foo ` bar `` -06_04_00__inlines__code_spans__003: | - ` `` ` -06_04_00__inlines__code_spans__004: | - ` `` ` -06_04_00__inlines__code_spans__005: | - ` a` -06_04_00__inlines__code_spans__006: | - ` b ` -06_04_00__inlines__code_spans__007: | - ` ` - ` ` -06_04_00__inlines__code_spans__008: "``\nfoo\nbar \nbaz\n``\n" -06_04_00__inlines__code_spans__009: "``\nfoo \n``\n" -06_04_00__inlines__code_spans__010: "`foo bar \nbaz`\n" -06_04_00__inlines__code_spans__011: | - `foo\`bar` -06_04_00__inlines__code_spans__012: | - ``foo`bar`` -06_04_00__inlines__code_spans__013: | - ` foo `` bar ` -06_04_00__inlines__code_spans__014: | - *foo`*` -06_04_00__inlines__code_spans__015: | - [not a `link](/foo`) -06_04_00__inlines__code_spans__016: | - `<a href="`">` -06_04_00__inlines__code_spans__017: | - <a href="`">` -06_04_00__inlines__code_spans__018: | - `<http://foo.bar.`baz>` -06_04_00__inlines__code_spans__019: | - <http://foo.bar.`baz>` -06_04_00__inlines__code_spans__020: | - ```foo`` -06_04_00__inlines__code_spans__021: | - `foo -06_04_00__inlines__code_spans__022: | - `foo``bar`` -06_05_00__inlines__emphasis_and_strong_emphasis__001: | - *foo bar* -06_05_00__inlines__emphasis_and_strong_emphasis__002: | - a * foo bar* -06_05_00__inlines__emphasis_and_strong_emphasis__003: | - a*"foo"* -06_05_00__inlines__emphasis_and_strong_emphasis__004: | - * a * -06_05_00__inlines__emphasis_and_strong_emphasis__005: | - foo*bar* -06_05_00__inlines__emphasis_and_strong_emphasis__006: | - 5*6*78 -06_05_00__inlines__emphasis_and_strong_emphasis__007: | - _foo bar_ -06_05_00__inlines__emphasis_and_strong_emphasis__008: | - _ foo bar_ -06_05_00__inlines__emphasis_and_strong_emphasis__009: | - a_"foo"_ -06_05_00__inlines__emphasis_and_strong_emphasis__010: | - foo_bar_ -06_05_00__inlines__emphasis_and_strong_emphasis__011: | - 5_6_78 -06_05_00__inlines__emphasis_and_strong_emphasis__012: | - приÑтанÑм_ÑтремÑÑ‚ÑÑ_ -06_05_00__inlines__emphasis_and_strong_emphasis__013: | - aa_"bb"_cc -06_05_00__inlines__emphasis_and_strong_emphasis__014: | - foo-_(bar)_ -06_05_00__inlines__emphasis_and_strong_emphasis__015: | - _foo* -06_05_00__inlines__emphasis_and_strong_emphasis__016: | - *foo bar * -06_05_00__inlines__emphasis_and_strong_emphasis__017: | - *foo bar - * -06_05_00__inlines__emphasis_and_strong_emphasis__018: | - *(*foo) -06_05_00__inlines__emphasis_and_strong_emphasis__019: | - *(*foo*)* -06_05_00__inlines__emphasis_and_strong_emphasis__020: | - *foo*bar -06_05_00__inlines__emphasis_and_strong_emphasis__021: | - _foo bar _ -06_05_00__inlines__emphasis_and_strong_emphasis__022: | - _(_foo) -06_05_00__inlines__emphasis_and_strong_emphasis__023: | - _(_foo_)_ -06_05_00__inlines__emphasis_and_strong_emphasis__024: | - _foo_bar -06_05_00__inlines__emphasis_and_strong_emphasis__025: | - _приÑтанÑм_ÑтремÑÑ‚ÑÑ -06_05_00__inlines__emphasis_and_strong_emphasis__026: | - _foo_bar_baz_ -06_05_00__inlines__emphasis_and_strong_emphasis__027: | - _(bar)_. -06_05_00__inlines__emphasis_and_strong_emphasis__028: | - **foo bar** -06_05_00__inlines__emphasis_and_strong_emphasis__029: | - ** foo bar** -06_05_00__inlines__emphasis_and_strong_emphasis__030: | - a**"foo"** -06_05_00__inlines__emphasis_and_strong_emphasis__031: | - foo**bar** -06_05_00__inlines__emphasis_and_strong_emphasis__032: | - __foo bar__ -06_05_00__inlines__emphasis_and_strong_emphasis__033: | - __ foo bar__ -06_05_00__inlines__emphasis_and_strong_emphasis__034: | - __ - foo bar__ -06_05_00__inlines__emphasis_and_strong_emphasis__035: | - a__"foo"__ -06_05_00__inlines__emphasis_and_strong_emphasis__036: | - foo__bar__ -06_05_00__inlines__emphasis_and_strong_emphasis__037: | - 5__6__78 -06_05_00__inlines__emphasis_and_strong_emphasis__038: | - приÑтанÑм__ÑтремÑÑ‚ÑÑ__ -06_05_00__inlines__emphasis_and_strong_emphasis__039: | - __foo, __bar__, baz__ -06_05_00__inlines__emphasis_and_strong_emphasis__040: | - foo-__(bar)__ -06_05_00__inlines__emphasis_and_strong_emphasis__041: | - **foo bar ** -06_05_00__inlines__emphasis_and_strong_emphasis__042: | - **(**foo) -06_05_00__inlines__emphasis_and_strong_emphasis__043: | - *(**foo**)* -06_05_00__inlines__emphasis_and_strong_emphasis__044: | - **Gomphocarpus (*Gomphocarpus physocarpus*, syn. - *Asclepias physocarpa*)** -06_05_00__inlines__emphasis_and_strong_emphasis__045: | - **foo "*bar*" foo** -06_05_00__inlines__emphasis_and_strong_emphasis__046: | - **foo**bar -06_05_00__inlines__emphasis_and_strong_emphasis__047: | - __foo bar __ -06_05_00__inlines__emphasis_and_strong_emphasis__048: | - __(__foo) -06_05_00__inlines__emphasis_and_strong_emphasis__049: | - _(__foo__)_ -06_05_00__inlines__emphasis_and_strong_emphasis__050: | - __foo__bar -06_05_00__inlines__emphasis_and_strong_emphasis__051: | - __приÑтанÑм__ÑтремÑÑ‚ÑÑ -06_05_00__inlines__emphasis_and_strong_emphasis__052: | - __foo__bar__baz__ -06_05_00__inlines__emphasis_and_strong_emphasis__053: | - __(bar)__. -06_05_00__inlines__emphasis_and_strong_emphasis__054: | - *foo [bar](/url)* -06_05_00__inlines__emphasis_and_strong_emphasis__055: | - *foo - bar* -06_05_00__inlines__emphasis_and_strong_emphasis__056: | - _foo __bar__ baz_ -06_05_00__inlines__emphasis_and_strong_emphasis__057: | - _foo _bar_ baz_ -06_05_00__inlines__emphasis_and_strong_emphasis__058: | - __foo_ bar_ -06_05_00__inlines__emphasis_and_strong_emphasis__059: | - *foo *bar** -06_05_00__inlines__emphasis_and_strong_emphasis__060: | - *foo **bar** baz* -06_05_00__inlines__emphasis_and_strong_emphasis__061: | - *foo**bar**baz* -06_05_00__inlines__emphasis_and_strong_emphasis__062: | - *foo**bar* -06_05_00__inlines__emphasis_and_strong_emphasis__063: | - ***foo** bar* -06_05_00__inlines__emphasis_and_strong_emphasis__064: | - *foo **bar*** -06_05_00__inlines__emphasis_and_strong_emphasis__065: | - *foo**bar*** -06_05_00__inlines__emphasis_and_strong_emphasis__066: | - foo***bar***baz -06_05_00__inlines__emphasis_and_strong_emphasis__067: | - foo******bar*********baz -06_05_00__inlines__emphasis_and_strong_emphasis__068: | - *foo **bar *baz* bim** bop* -06_05_00__inlines__emphasis_and_strong_emphasis__069: | - *foo [*bar*](/url)* -06_05_00__inlines__emphasis_and_strong_emphasis__070: | - ** is not an empty emphasis -06_05_00__inlines__emphasis_and_strong_emphasis__071: | - **** is not an empty strong emphasis -06_05_00__inlines__emphasis_and_strong_emphasis__072: | - **foo [bar](/url)** -06_05_00__inlines__emphasis_and_strong_emphasis__073: | - **foo - bar** -06_05_00__inlines__emphasis_and_strong_emphasis__074: | - __foo _bar_ baz__ -06_05_00__inlines__emphasis_and_strong_emphasis__075: | - __foo __bar__ baz__ -06_05_00__inlines__emphasis_and_strong_emphasis__076: | - ____foo__ bar__ -06_05_00__inlines__emphasis_and_strong_emphasis__077: | - **foo **bar**** -06_05_00__inlines__emphasis_and_strong_emphasis__078: | - **foo *bar* baz** -06_05_00__inlines__emphasis_and_strong_emphasis__079: | - **foo*bar*baz** -06_05_00__inlines__emphasis_and_strong_emphasis__080: | - ***foo* bar** -06_05_00__inlines__emphasis_and_strong_emphasis__081: | - **foo *bar*** -06_05_00__inlines__emphasis_and_strong_emphasis__082: | - **foo *bar **baz** - bim* bop** -06_05_00__inlines__emphasis_and_strong_emphasis__083: | - **foo [*bar*](/url)** -06_05_00__inlines__emphasis_and_strong_emphasis__084: | - __ is not an empty emphasis -06_05_00__inlines__emphasis_and_strong_emphasis__085: | - ____ is not an empty strong emphasis -06_05_00__inlines__emphasis_and_strong_emphasis__086: | - foo *** -06_05_00__inlines__emphasis_and_strong_emphasis__087: | - foo *\** -06_05_00__inlines__emphasis_and_strong_emphasis__088: | - foo *_* -06_05_00__inlines__emphasis_and_strong_emphasis__089: | - foo ***** -06_05_00__inlines__emphasis_and_strong_emphasis__090: | - foo **\*** -06_05_00__inlines__emphasis_and_strong_emphasis__091: | - foo **_** -06_05_00__inlines__emphasis_and_strong_emphasis__092: | - **foo* -06_05_00__inlines__emphasis_and_strong_emphasis__093: | - *foo** -06_05_00__inlines__emphasis_and_strong_emphasis__094: | - ***foo** -06_05_00__inlines__emphasis_and_strong_emphasis__095: | - ****foo* -06_05_00__inlines__emphasis_and_strong_emphasis__096: | - **foo*** -06_05_00__inlines__emphasis_and_strong_emphasis__097: | - *foo**** -06_05_00__inlines__emphasis_and_strong_emphasis__098: | - foo ___ -06_05_00__inlines__emphasis_and_strong_emphasis__099: | - foo _\__ -06_05_00__inlines__emphasis_and_strong_emphasis__100: | - foo _*_ -06_05_00__inlines__emphasis_and_strong_emphasis__101: | - foo _____ -06_05_00__inlines__emphasis_and_strong_emphasis__102: | - foo __\___ -06_05_00__inlines__emphasis_and_strong_emphasis__103: | - foo __*__ -06_05_00__inlines__emphasis_and_strong_emphasis__104: | - __foo_ -06_05_00__inlines__emphasis_and_strong_emphasis__105: | - _foo__ -06_05_00__inlines__emphasis_and_strong_emphasis__106: | - ___foo__ -06_05_00__inlines__emphasis_and_strong_emphasis__107: | - ____foo_ -06_05_00__inlines__emphasis_and_strong_emphasis__108: | - __foo___ -06_05_00__inlines__emphasis_and_strong_emphasis__109: | - _foo____ -06_05_00__inlines__emphasis_and_strong_emphasis__110: | - **foo** -06_05_00__inlines__emphasis_and_strong_emphasis__111: | - *_foo_* -06_05_00__inlines__emphasis_and_strong_emphasis__112: | - __foo__ -06_05_00__inlines__emphasis_and_strong_emphasis__113: | - _*foo*_ -06_05_00__inlines__emphasis_and_strong_emphasis__114: | - ****foo**** -06_05_00__inlines__emphasis_and_strong_emphasis__115: | - ____foo____ -06_05_00__inlines__emphasis_and_strong_emphasis__116: | - ******foo****** -06_05_00__inlines__emphasis_and_strong_emphasis__117: | - ***foo*** -06_05_00__inlines__emphasis_and_strong_emphasis__118: | - _____foo_____ -06_05_00__inlines__emphasis_and_strong_emphasis__119: | - *foo _bar* baz_ -06_05_00__inlines__emphasis_and_strong_emphasis__120: | - *foo __bar *baz bim__ bam* -06_05_00__inlines__emphasis_and_strong_emphasis__121: | - **foo **bar baz** -06_05_00__inlines__emphasis_and_strong_emphasis__122: | - *foo *bar baz* -06_05_00__inlines__emphasis_and_strong_emphasis__123: | - *[bar*](/url) -06_05_00__inlines__emphasis_and_strong_emphasis__124: | - _foo [bar_](/url) -06_05_00__inlines__emphasis_and_strong_emphasis__125: | - *<img src="foo" title="*"/> -06_05_00__inlines__emphasis_and_strong_emphasis__126: | - **<a href="**"> -06_05_00__inlines__emphasis_and_strong_emphasis__127: | - __<a href="__"> -06_05_00__inlines__emphasis_and_strong_emphasis__128: | - *a `*`* -06_05_00__inlines__emphasis_and_strong_emphasis__129: | - _a `_`_ -06_05_00__inlines__emphasis_and_strong_emphasis__130: | - **a<http://foo.bar/?q=**> -06_05_00__inlines__emphasis_and_strong_emphasis__131: | - __a<http://foo.bar/?q=__> -06_06_00__inlines__strikethrough_extension__001: | - ~~Hi~~ Hello, world! -06_06_00__inlines__strikethrough_extension__002: | - This ~~has a - - new paragraph~~. -06_07_00__inlines__links__001: | - [link](/uri "title") -06_07_00__inlines__links__002: | - [link](/uri) -06_07_00__inlines__links__003: | - [link]() -06_07_00__inlines__links__004: | - [link](<>) -06_07_00__inlines__links__005: | - [link](/my uri) -06_07_00__inlines__links__006: | - [link](</my uri>) -06_07_00__inlines__links__007: | - [link](foo - bar) -06_07_00__inlines__links__008: | - [link](<foo - bar>) -06_07_00__inlines__links__009: | - [a](<b)c>) -06_07_00__inlines__links__010: | - [link](<foo\>) -06_07_00__inlines__links__011: | - [a](<b)c - [a](<b)c> - [a](<b>c) -06_07_00__inlines__links__012: | - [link](\(foo\)) -06_07_00__inlines__links__013: | - [link](foo(and(bar))) -06_07_00__inlines__links__014: | - [link](foo\(and\(bar\)) -06_07_00__inlines__links__015: | - [link](<foo(and(bar)>) -06_07_00__inlines__links__016: | - [link](foo\)\:) -06_07_00__inlines__links__017: | - [link](#fragment) - - [link](http://example.com#fragment) - - [link](http://example.com?foo=3#frag) -06_07_00__inlines__links__018: | - [link](foo\bar) -06_07_00__inlines__links__019: | - [link](foo%20bä) -06_07_00__inlines__links__020: | - [link]("title") -06_07_00__inlines__links__021: | - [link](/url "title") - [link](/url 'title') - [link](/url (title)) -06_07_00__inlines__links__022: | - [link](/url "title \""") -06_07_00__inlines__links__023: | - [link](/url "title") -06_07_00__inlines__links__024: | - [link](/url "title "and" title") -06_07_00__inlines__links__025: | - [link](/url 'title "and" title') -06_07_00__inlines__links__026: | - [link]( /uri - "title" ) -06_07_00__inlines__links__027: | - [link] (/uri) -06_07_00__inlines__links__028: | - [link [foo [bar]]](/uri) -06_07_00__inlines__links__029: | - [link] bar](/uri) -06_07_00__inlines__links__030: | - [link [bar](/uri) -06_07_00__inlines__links__031: | - [link \[bar](/uri) -06_07_00__inlines__links__032: | - [link *foo **bar** `#`*](/uri) -06_07_00__inlines__links__033: | - [](/uri) -06_07_00__inlines__links__034: | - [foo [bar](/uri)](/uri) -06_07_00__inlines__links__035: | - [foo *[bar [baz](/uri)](/uri)*](/uri) -06_07_00__inlines__links__036: | - ](uri2)](uri3) -06_07_00__inlines__links__037: | - *[foo*](/uri) -06_07_00__inlines__links__038: | - [foo *bar](baz*) -06_07_00__inlines__links__039: | - *foo [bar* baz] -06_07_00__inlines__links__040: | - [foo <bar attr="](baz)"> -06_07_00__inlines__links__041: | - [foo`](/uri)` -06_07_00__inlines__links__042: | - [foo<http://example.com/?search=](uri)> -06_07_00__inlines__links__043: | - [foo][bar] - - [bar]: /url "title" -06_07_00__inlines__links__044: | - [link [foo [bar]]][ref] - - [ref]: /uri -06_07_00__inlines__links__045: | - [link \[bar][ref] - - [ref]: /uri -06_07_00__inlines__links__046: | - [link *foo **bar** `#`*][ref] - - [ref]: /uri -06_07_00__inlines__links__047: | - [][ref] - - [ref]: /uri -06_07_00__inlines__links__048: | - [foo [bar](/uri)][ref] - - [ref]: /uri -06_07_00__inlines__links__049: | - [foo *bar [baz][ref]*][ref] - - [ref]: /uri -06_07_00__inlines__links__050: | - *[foo*][ref] - - [ref]: /uri -06_07_00__inlines__links__051: | - [foo *bar][ref] - - [ref]: /uri -06_07_00__inlines__links__052: | - [foo <bar attr="][ref]"> - - [ref]: /uri -06_07_00__inlines__links__053: | - [foo`][ref]` - - [ref]: /uri -06_07_00__inlines__links__054: | - [foo<http://example.com/?search=][ref]> - - [ref]: /uri -06_07_00__inlines__links__055: | - [foo][BaR] - - [bar]: /url "title" -06_07_00__inlines__links__056: | - [Толпой][Толпой] is a Russian word. - - [ТОЛПОЙ]: /url -06_07_00__inlines__links__057: | - [Foo - bar]: /url - - [Baz][Foo bar] -06_07_00__inlines__links__058: | - [foo] [bar] - - [bar]: /url "title" -06_07_00__inlines__links__059: | - [foo] - [bar] - - [bar]: /url "title" -06_07_00__inlines__links__060: | - [foo]: /url1 - - [foo]: /url2 - - [bar][foo] -06_07_00__inlines__links__061: | - [bar][foo\!] - - [foo!]: /url -06_07_00__inlines__links__062: | - [foo][ref[] - - [ref[]: /uri -06_07_00__inlines__links__063: | - [foo][ref[bar]] - - [ref[bar]]: /uri -06_07_00__inlines__links__064: | - [[[foo]]] - - [[[foo]]]: /url -06_07_00__inlines__links__065: | - [foo][ref\[] - - [ref\[]: /uri -06_07_00__inlines__links__066: | - [bar\\]: /uri - - [bar\\] -06_07_00__inlines__links__067: | - [] - - []: /uri -06_07_00__inlines__links__068: | - [ - ] - - [ - ]: /uri -06_07_00__inlines__links__069: | - [foo][] - - [foo]: /url "title" -06_07_00__inlines__links__070: | - [*foo* bar][] - - [*foo* bar]: /url "title" -06_07_00__inlines__links__071: | - [Foo][] - - [foo]: /url "title" -06_07_00__inlines__links__072: "[foo] \n[]\n\n[foo]: /url \"title\"\n" -06_07_00__inlines__links__073: | - [foo] - - [foo]: /url "title" -06_07_00__inlines__links__074: | - [*foo* bar] - - [*foo* bar]: /url "title" -06_07_00__inlines__links__075: | - [[*foo* bar]] - - [*foo* bar]: /url "title" -06_07_00__inlines__links__076: | - [[bar [foo] - - [foo]: /url -06_07_00__inlines__links__077: | - [Foo] - - [foo]: /url "title" -06_07_00__inlines__links__078: | - [foo] bar - - [foo]: /url -06_07_00__inlines__links__079: | - \[foo] - - [foo]: /url "title" -06_07_00__inlines__links__080: | - [foo*]: /url - - *[foo*] -06_07_00__inlines__links__081: | - [foo][bar] - - [foo]: /url1 - [bar]: /url2 -06_07_00__inlines__links__082: | - [foo][] - - [foo]: /url1 -06_07_00__inlines__links__083: | - [foo]() - - [foo]: /url1 -06_07_00__inlines__links__084: | - [foo](not a link) - - [foo]: /url1 -06_07_00__inlines__links__085: | - [foo][bar][baz] - - [baz]: /url -06_07_00__inlines__links__086: | - [foo][bar][baz] - - [baz]: /url1 - [bar]: /url2 -06_07_00__inlines__links__087: | - [foo][bar][baz] - - [baz]: /url1 - [foo]: /url2 -06_08_00__inlines__images__001: | -  -06_08_00__inlines__images__002: | - ![foo *bar*] - - [foo *bar*]: train.jpg "train & tracks" -06_08_00__inlines__images__003: | - ](/url2) -06_08_00__inlines__images__004: | - ](/url2) -06_08_00__inlines__images__005: | - ![foo *bar*][] - - [foo *bar*]: train.jpg "train & tracks" -06_08_00__inlines__images__006: | - ![foo *bar*][foobar] - - [FOOBAR]: train.jpg "train & tracks" -06_08_00__inlines__images__007: | -  -06_08_00__inlines__images__008: | - My  -06_08_00__inlines__images__009: | -  -06_08_00__inlines__images__010: | -  -06_08_00__inlines__images__011: | - ![foo][bar] - - [bar]: /url -06_08_00__inlines__images__012: | - ![foo][bar] - - [BAR]: /url -06_08_00__inlines__images__013: | - ![foo][] - - [foo]: /url "title" -06_08_00__inlines__images__014: | - ![*foo* bar][] - - [*foo* bar]: /url "title" -06_08_00__inlines__images__015: | - ![Foo][] - - [foo]: /url "title" -06_08_00__inlines__images__016: "![foo] \n[]\n\n[foo]: /url \"title\"\n" -06_08_00__inlines__images__017: | - ![foo] - - [foo]: /url "title" -06_08_00__inlines__images__018: | - ![*foo* bar] - - [*foo* bar]: /url "title" -06_08_00__inlines__images__019: | - ![[foo]] - - [[foo]]: /url "title" -06_08_00__inlines__images__020: | - ![Foo] - - [foo]: /url "title" -06_08_00__inlines__images__021: | - !\[foo] - - [foo]: /url "title" -06_08_00__inlines__images__022: | - \![foo] - - [foo]: /url "title" -06_09_00__inlines__autolinks__001: | - <http://foo.bar.baz> -06_09_00__inlines__autolinks__002: | - <http://foo.bar.baz/test?q=hello&id=22&boolean> -06_09_00__inlines__autolinks__003: | - <irc://foo.bar:2233/baz> -06_09_00__inlines__autolinks__004: | - <MAILTO:FOO@BAR.BAZ> -06_09_00__inlines__autolinks__005: | - <a+b+c:d> -06_09_00__inlines__autolinks__006: | - <made-up-scheme://foo,bar> -06_09_00__inlines__autolinks__007: | - <http://../> -06_09_00__inlines__autolinks__008: | - <localhost:5001/foo> -06_09_00__inlines__autolinks__009: | - <http://foo.bar/baz bim> -06_09_00__inlines__autolinks__010: | - <http://example.com/\[\> -06_09_00__inlines__autolinks__011: | - <foo@bar.example.com> -06_09_00__inlines__autolinks__012: | - <foo+special@Bar.baz-bar0.com> -06_09_00__inlines__autolinks__013: | - <foo\+@bar.example.com> -06_09_00__inlines__autolinks__014: | - <> -06_09_00__inlines__autolinks__015: | - < http://foo.bar > -06_09_00__inlines__autolinks__016: | - <m:abc> -06_09_00__inlines__autolinks__017: | - <foo.bar.baz> -06_09_00__inlines__autolinks__018: | - http://example.com -06_09_00__inlines__autolinks__019: | - foo@bar.example.com -06_10_00__inlines__autolinks_extension__001: | - www.commonmark.org -06_10_00__inlines__autolinks_extension__002: | - Visit www.commonmark.org/help for more information. -06_10_00__inlines__autolinks_extension__003: | - Visit www.commonmark.org. - - Visit www.commonmark.org/a.b. -06_10_00__inlines__autolinks_extension__004: | - www.google.com/search?q=Markup+(business) - - www.google.com/search?q=Markup+(business))) - - (www.google.com/search?q=Markup+(business)) - - (www.google.com/search?q=Markup+(business) -06_10_00__inlines__autolinks_extension__005: | - www.google.com/search?q=(business))+ok -06_10_00__inlines__autolinks_extension__006: | - www.google.com/search?q=commonmark&hl=en - - www.google.com/search?q=commonmark&hl; -06_10_00__inlines__autolinks_extension__007: | - www.commonmark.org/he<lp -06_10_00__inlines__autolinks_extension__008: | - http://commonmark.org - - (Visit https://encrypted.google.com/search?q=Markup+(business)) - - Anonymous FTP is available at ftp://foo.bar.baz. -06_10_00__inlines__autolinks_extension__009: | - foo@bar.baz -06_10_00__inlines__autolinks_extension__010: | - hello@mail+xyz.example isn't valid, but hello+xyz@mail.example is. -06_10_00__inlines__autolinks_extension__011: | - a.b-c_d@a.b - - a.b-c_d@a.b. - - a.b-c_d@a.b- - - a.b-c_d@a.b_ -06_11_00__inlines__raw_html__001: | - <a><bab><c2c> -06_11_00__inlines__raw_html__002: | - <a/><b2/> -06_11_00__inlines__raw_html__003: | - <a /><b2 - data="foo" > -06_11_00__inlines__raw_html__004: | - <a foo="bar" bam = 'baz <em>"</em>' - _boolean zoop:33=zoop:33 /> -06_11_00__inlines__raw_html__005: | - Foo <responsive-image src="foo.jpg" /> -06_11_00__inlines__raw_html__006: | - <33> <__> -06_11_00__inlines__raw_html__007: | - <a h*#ref="hi"> -06_11_00__inlines__raw_html__008: | - <a href="hi'> <a href=hi'> -06_11_00__inlines__raw_html__009: | - < a>< - foo><bar/ > - <foo bar=baz - bim!bop /> -06_11_00__inlines__raw_html__010: | - <a href='bar'title=title> -06_11_00__inlines__raw_html__011: | - </a></foo > -06_11_00__inlines__raw_html__012: | - </a href="foo"> -06_11_00__inlines__raw_html__013: | - foo <!-- this is a - comment - with hyphen --> -06_11_00__inlines__raw_html__014: | - foo <!-- not a comment -- two hyphens --> -06_11_00__inlines__raw_html__015: | - foo <!--> foo --> - - foo <!-- foo---> -06_11_00__inlines__raw_html__016: | - foo <?php echo $a; ?> -06_11_00__inlines__raw_html__017: | - foo <!ELEMENT br EMPTY> -06_11_00__inlines__raw_html__018: | - foo <![CDATA[>&<]]> -06_11_00__inlines__raw_html__019: | - foo <a href="ö"> -06_11_00__inlines__raw_html__020: | - foo <a href="\*"> -06_11_00__inlines__raw_html__021: | - <a href="\""> -06_12_00__inlines__disallowed_raw_html_extension__001: | - <strong> <title> <style> <em> - - <blockquote> - <xmp> is disallowed. <XMP> is also disallowed. - </blockquote> -06_13_00__inlines__hard_line_breaks__001: "foo \nbaz\n" -06_13_00__inlines__hard_line_breaks__002: | - foo\ - baz -06_13_00__inlines__hard_line_breaks__003: "foo \nbaz\n" -06_13_00__inlines__hard_line_breaks__004: "foo \n bar\n" -06_13_00__inlines__hard_line_breaks__005: | - foo\ - bar -06_13_00__inlines__hard_line_breaks__006: "*foo \nbar*\n" -06_13_00__inlines__hard_line_breaks__007: | - *foo\ - bar* -06_13_00__inlines__hard_line_breaks__008: "`code \nspan`\n" -06_13_00__inlines__hard_line_breaks__009: | - `code\ - span` -06_13_00__inlines__hard_line_breaks__010: "<a href=\"foo \nbar\">\n" -06_13_00__inlines__hard_line_breaks__011: | - <a href="foo\ - bar"> -06_13_00__inlines__hard_line_breaks__012: | - foo\ -06_13_00__inlines__hard_line_breaks__013: "foo \n" -06_13_00__inlines__hard_line_breaks__014: | - ### foo\ -06_13_00__inlines__hard_line_breaks__015: "### foo \n" -06_14_00__inlines__soft_line_breaks__001: | - foo - baz -06_14_00__inlines__soft_line_breaks__002: "foo \n baz\n" -06_15_00__inlines__textual_content__001: | - hello $.;'there -06_15_00__inlines__textual_content__002: | - Foo χÏῆν -06_15_00__inlines__textual_content__003: | - Multiple spaces -07_01_00__gitlab_official_specification_markdown__task_list_items__001: | - - [ ] incomplete -07_01_00__gitlab_official_specification_markdown__task_list_items__002: | - - [x] completed -07_01_00__gitlab_official_specification_markdown__task_list_items__003: | - - [~] inapplicable -07_01_00__gitlab_official_specification_markdown__task_list_items__004: | - - [~] inapplicable - - text in loose list -07_02_00__gitlab_official_specification_markdown__front_matter__001: | - --- - title: YAML front matter - --- -07_02_00__gitlab_official_specification_markdown__front_matter__002: | - +++ - title: TOML front matter - +++ -07_02_00__gitlab_official_specification_markdown__front_matter__003: | - ;;; - { - "title": "JSON front matter" - } - ;;; -07_02_00__gitlab_official_specification_markdown__front_matter__004: | - text - - --- - title: YAML front matter - --- -07_02_00__gitlab_official_specification_markdown__front_matter__005: |2 - --- - title: YAML front matter - --- -07_03_00__gitlab_official_specification_markdown__table_of_contents__001: | - [TOC] - - # Heading 1 - - ## Heading 2 -07_03_00__gitlab_official_specification_markdown__table_of_contents__002: | - [[_TOC_]] - - # Heading 1 - - ## Heading 2 -07_03_00__gitlab_official_specification_markdown__table_of_contents__003: | - [[_TOC_]] - text - - text - [TOC] -07_03_00__gitlab_official_specification_markdown__table_of_contents__004: |2 - [[_TOC_]] - - # Heading 1 -08_01_00__gitlab_internal_extension_markdown__audio__001: | -  -08_01_00__gitlab_internal_extension_markdown__audio__002: | - [audio]: audio.oga "audio title" - - ![audio][audio] -08_02_00__gitlab_internal_extension_markdown__video__001: | -  -08_02_00__gitlab_internal_extension_markdown__video__002: | - [video]: video.mov "video title" - - ![video][video] -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__001: | - [groups-test-file](/uploads/groups-test-file) -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__002: | - [projects-test-file](projects-test-file) -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__003: | - This project snippet ID reference IS filtered: $88888 -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__004: | - This personal snippet ID reference is not filtered: $99999 -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__005: | - [project-wikis-test-file](project-wikis-test-file) -08_03_00__gitlab_internal_extension_markdown__markdown_preview_api_request_overrides__006: | - [group-wikis-test-file](group-wikis-test-file) -08_04_01__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_image_for_group__001: | -  -08_04_02__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_image_for_project__001: | -  -08_04_03__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_image_for_project_wiki__001: | -  -08_04_04__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_link_for_group__001: | - [test-file](/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.zip) -08_04_05__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_link_for_project__001: | - [test-file](/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.zip) -08_04_06__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_link_for_project_wiki__001: | - [test-file](test-file.zip) -08_04_07__gitlab_internal_extension_markdown__migrated_golden_master_examples__attachment_link_for_group_wiki__001: | - [test-file](test-file.zip) -08_04_08__gitlab_internal_extension_markdown__migrated_golden_master_examples__audio__001: | -  -08_04_09__gitlab_internal_extension_markdown__migrated_golden_master_examples__audio_and_video_in_lists__001: | - *  - *  - - 1.  - 2.  - - * [x]  - * [x]  - * [x]  -08_04_10__gitlab_internal_extension_markdown__migrated_golden_master_examples__blockquote__001: | - > This is a blockquote - > - > This is another one -08_04_11__gitlab_internal_extension_markdown__migrated_golden_master_examples__bold__001: | - **bold** -08_04_12__gitlab_internal_extension_markdown__migrated_golden_master_examples__bullet_list_style_1__001: | - * list item 1 - * list item 2 - * embedded list item 3 -08_04_13__gitlab_internal_extension_markdown__migrated_golden_master_examples__bullet_list_style_2__001: | - - list item 1 - - list item 2 - * embedded list item 3 -08_04_14__gitlab_internal_extension_markdown__migrated_golden_master_examples__bullet_list_style_3__001: | - + list item 1 - + list item 2 - - embedded list item 3 -08_04_15__gitlab_internal_extension_markdown__migrated_golden_master_examples__code_block_javascript__001: | - ```javascript - console.log('hello world') - ``` -08_04_16__gitlab_internal_extension_markdown__migrated_golden_master_examples__code_block_plaintext__001: | - ``` - plaintext - ``` -08_04_17__gitlab_internal_extension_markdown__migrated_golden_master_examples__code_block_unknown__001: | - ```foobar - custom_language = >> this << - ``` -08_04_18__gitlab_internal_extension_markdown__migrated_golden_master_examples__color_chips__001: | - - `#F00` - - `#F00A` - - `#FF0000` - - `#FF0000AA` - - `RGB(0,255,0)` - - `RGB(0%,100%,0%)` - - `RGBA(0,255,0,0.3)` - - `HSL(540,70%,50%)` - - `HSLA(540,70%,50%,0.3)` -08_04_19__gitlab_internal_extension_markdown__migrated_golden_master_examples__description_list__001: | - <dl> - <dt>Frog</dt> - <dd>Wet green thing</dd> - <dt>Rabbit</dt> - <dd>Warm fluffy thing</dd> - <dt>Punt</dt> - <dd>Kick a ball</dd> - <dd>Take a bet</dd> - <dt>Color</dt> - <dt>Colour</dt> - <dd> - - Any hue except _white_ or **black** - - </dd> - </dl> -08_04_20__gitlab_internal_extension_markdown__migrated_golden_master_examples__details__001: | - <details> - <summary>This is the visible summary of the collapsible section</summary> - - 1. collapsed markdown - 2. more collapsed markdown - - </details> -08_04_21__gitlab_internal_extension_markdown__migrated_golden_master_examples__diagram_kroki_nomnoml__001: | - ```nomnoml - #stroke: #a86128 - [<frame>Decorator pattern| - [<abstract>Component||+ operation()] - [Client] depends --> [Component] - [Decorator|- next: Component] - [Decorator] decorates -- [ConcreteComponent] - [Component] <:- [Decorator] - [Component] <:- [ConcreteComponent] - ] - ``` -08_04_22__gitlab_internal_extension_markdown__migrated_golden_master_examples__diagram_plantuml__001: | - ```plantuml - Alice -> Bob: Authentication Request - Bob --> Alice: Authentication Response - - Alice -> Bob: Another authentication Request - Alice <-- Bob: Another authentication Response - ``` -08_04_23__gitlab_internal_extension_markdown__migrated_golden_master_examples__diagram_plantuml_unicode__001: | - ```plantuml - A -> B : Text with norwegian characters: æøå - ``` -08_04_24__gitlab_internal_extension_markdown__migrated_golden_master_examples__div__001: | - <div>plain text</div> - <div> - - just a plain ol' div, not much to _expect_! - - </div> -08_04_25__gitlab_internal_extension_markdown__migrated_golden_master_examples__emoji__001: | - :sparkles: :heart: :100: -08_04_26__gitlab_internal_extension_markdown__migrated_golden_master_examples__emphasis__001: | - _emphasized text_ -08_04_27__gitlab_internal_extension_markdown__migrated_golden_master_examples__figure__001: | - <figure> - -  - - <figcaption>An elephant at sunset</figcaption> - </figure> - <figure> - -  - - <figcaption> - - A crocodile wearing _crocs_! - - </figcaption> - </figure> -08_04_28__gitlab_internal_extension_markdown__migrated_golden_master_examples__footnotes__001: | - A footnote reference tag looks like this: [^1] - - This reference tag is a mix of letters and numbers. [^footnote] - - [^1]: This is the text inside a footnote. - - [^footnote]: This is another footnote. -08_04_29__gitlab_internal_extension_markdown__migrated_golden_master_examples__frontmatter_json__001: | - ;;; - { - "title": "Page title" - } - ;;; -08_04_30__gitlab_internal_extension_markdown__migrated_golden_master_examples__frontmatter_toml__001: | - +++ - title = "Page title" - +++ -08_04_31__gitlab_internal_extension_markdown__migrated_golden_master_examples__frontmatter_yaml__001: | - --- - title: Page title - --- -08_04_32__gitlab_internal_extension_markdown__migrated_golden_master_examples__hard_break__001: | - This is a line after a\ - hard break -08_04_33__gitlab_internal_extension_markdown__migrated_golden_master_examples__headings__001: | - # Heading 1 - - ## Heading 2 - - ### Heading 3 - - #### Heading 4 - - ##### Heading 5 - - ###### Heading 6 -08_04_34__gitlab_internal_extension_markdown__migrated_golden_master_examples__horizontal_rule__001: | - --- -08_04_35__gitlab_internal_extension_markdown__migrated_golden_master_examples__html_marks__001: "* - Content editor is ~~great~~<ins>amazing</ins>.\n* If the changes <abbr title=\"Looks - good to merge\">LGTM</abbr>, please <abbr title=\"Merge when pipeline succeeds\">MWPS</abbr>.\n* - The English song <q>Oh I do like to be beside the seaside</q> looks like this in - Hebrew: <span dir=\"rtl\">××”, ×× ×™ ×והב להיות ליד חוף ×”×™×</span>. In the computer's - memory, this is stored as <bdo dir=\"ltr\">××”, ×× ×™ ×והב להיות ליד חוף ×”×™×</bdo>.\n* - <cite>The Scream</cite> by Edvard Munch. Painted in 1893.\n* <dfn>HTML</dfn> is - the standard markup language for creating web pages.\n* Do not forget to buy <mark>milk</mark> - today.\n* This is a paragraph and <small>smaller text goes here</small>.\n* The - concert starts at <time datetime=\"20:00\">20:00</time> and you'll be able to enjoy - the band for at least <time datetime=\"PT2H30M\">2h 30m</time>.\n* Press <kbd>Ctrl</kbd> - + <kbd>C</kbd> to copy text (Windows).\n* WWF's goal is to: <q>Build a future where - people live in harmony with nature.</q> We hope they succeed.\n* The error occurred - was: <samp>Keyboard not found. Press F1 to continue.</samp>\n* The area of a triangle - is: 1/2 x <var>b</var> x <var>h</var>, where <var>b</var> is the base, and <var>h</var> - is the vertical height.\n* <ruby>æ¼¢<rt>ã„ㄢˋ</rt></ruby>\n* C<sub>7</sub>H<sub>16</sub> - + O<sub>2</sub> \t CO<sub>2</sub> + H<sub>2</sub>O\n* The **Pythagorean theorem** - is often expressed as <var>a<sup>2</sup></var> + <var>b<sup>2</sup></var> = <var>c<sup>2</sup></var>\n" -08_04_36__gitlab_internal_extension_markdown__migrated_golden_master_examples__image__001: | -  -08_04_37__gitlab_internal_extension_markdown__migrated_golden_master_examples__inline_code__001: | - `code` -08_04_38__gitlab_internal_extension_markdown__migrated_golden_master_examples__inline_diff__001: | - * {-deleted-} - * {+added+} -08_04_39__gitlab_internal_extension_markdown__migrated_golden_master_examples__label__001: | - ~bug -08_04_40__gitlab_internal_extension_markdown__migrated_golden_master_examples__link__001: | - [GitLab](https://gitlab.com) -08_04_41__gitlab_internal_extension_markdown__migrated_golden_master_examples__math__001: | - This math is inline $`a^2+b^2=c^2`$. - - This is on a separate line: - - ```math - a^2+b^2=c^2 - ``` -08_04_42__gitlab_internal_extension_markdown__migrated_golden_master_examples__ordered_list__001: | - 1. list item 1 - 2. list item 2 - 3. list item 3 -08_04_43__gitlab_internal_extension_markdown__migrated_golden_master_examples__ordered_list_with_start_order__001: | - 134. list item 1 - 135. list item 2 - 136. list item 3 -08_04_44__gitlab_internal_extension_markdown__migrated_golden_master_examples__ordered_task_list__001: | - 1. [x] hello - 2. [x] world - 3. [ ] example - 1. [ ] of nested - 1. [x] task list - 2. [ ] items -08_04_45__gitlab_internal_extension_markdown__migrated_golden_master_examples__ordered_task_list_with_order__001: | - 4893. [x] hello - 4894. [x] world - 4895. [ ] example -08_04_46__gitlab_internal_extension_markdown__migrated_golden_master_examples__reference_for_project_wiki__001: | - Hi @gfm_user - thank you for reporting this ~"UX bug" (#1) we hope to fix it in %1.1 as part of !1 -08_04_47__gitlab_internal_extension_markdown__migrated_golden_master_examples__strike__001: | - ~~del~~ -08_04_48__gitlab_internal_extension_markdown__migrated_golden_master_examples__table__001: | - | header | header | - |--------|--------| - | `code` | cell with **bold** | - | ~~strike~~ | cell with _italic_ | - - # content after table -08_04_49__gitlab_internal_extension_markdown__migrated_golden_master_examples__table_of_contents__001: | - [[_TOC_]] - - # Lorem - - Well, that's just like... your opinion.. man. - - ## Ipsum - - ### Dolar - - # Sit amit - - ### I don't know -08_04_50__gitlab_internal_extension_markdown__migrated_golden_master_examples__task_list__001: | - * [x] hello - * [x] world - * [ ] example - * [ ] of nested - * [x] task list - * [ ] items -08_04_51__gitlab_internal_extension_markdown__migrated_golden_master_examples__video__001: | -  -08_04_52__gitlab_internal_extension_markdown__migrated_golden_master_examples__word_break__001: | - Fernstraßen<wbr>bau<wbr>privat<wbr>finanzierungs<wbr>gesetz -08_05_00__gitlab_internal_extension_markdown__image_attributes__001: | - {width="100" height="100"} -08_05_00__gitlab_internal_extension_markdown__image_attributes__002: | - {width="100%"} -08_05_00__gitlab_internal_extension_markdown__image_attributes__003: | - {height="100px"} -08_05_00__gitlab_internal_extension_markdown__image_attributes__004: | - { width="100" height="100" } -08_05_00__gitlab_internal_extension_markdown__image_attributes__005: | -  {width="100" height="100"} -08_06_00__gitlab_internal_extension_markdown__footnotes__001: | - footnote reference tag [^fortytwo] - - [^fortytwo]: footnote text -09_00_00__gfm_undocumented_extensions_and_more_robust_test__footnotes__002: | - This is some text![^1]. Other text.[^footnote]. - - Here's a thing[^other-note]. - - And another thing[^codeblock-note]. - - This doesn't have a referent[^nope]. - - - [^other-note]: no code block here (spaces are stripped away) - - [^codeblock-note]: - this is now a code block (8 spaces indentation) - - [^1]: Some *bolded* footnote definition. - - Hi! - - [^footnote]: - > Blockquotes can be in a footnote. - - as well as code blocks - - or, naturally, simple paragraphs. - - [^unused]: This is unused. -? 09_01_00__gfm_undocumented_extensions_and_more_robust_test__when_a_footnote_is_used_multiple_times,_we_insert_multiple_backrefs.__001 -: | - This is some text. It has a footnote[^a-footnote]. - - This footnote is referenced[^a-footnote] multiple times, in lots of different places.[^a-footnote] - - [^a-footnote]: This footnote definition should have three backrefs. -09_02_00__gfm_undocumented_extensions_and_more_robust_test__footnote_reference_labels_are_href_escaped__001: | - Hello[^"><script>alert(1)</script>] - - [^"><script>alert(1)</script>]: pwned -09_03_00__gfm_undocumented_extensions_and_more_robust_test__interop__001: | - ~~www.google.com~~ - - ~~http://google.com~~ -09_03_00__gfm_undocumented_extensions_and_more_robust_test__interop__002: | - | a | b | - | --- | --- | - | https://github.com www.github.com | http://pokemon.com | -09_04_00__gfm_undocumented_extensions_and_more_robust_test__task_lists__001: | - - [ ] foo - - [x] bar -09_04_00__gfm_undocumented_extensions_and_more_robust_test__task_lists__002: | - - [x] foo - - [ ] bar - - [x] baz - - [ ] bim - - Show a regular (non task) list to show that it has the same structure - - [@] foo - - [@] bar - - [@] baz - - [@] bim -09_04_00__gfm_undocumented_extensions_and_more_robust_test__task_lists__003: | - - [x] foo - - [ ] bar - - [x] baz - - [ ] bim - - Show a regular (non task) list to show that it has the same structure - - [@] foo - - [@] bar - - [@] baz - - [@] bim diff --git a/glfm_specification/output_example_snapshots/snapshot_spec.html b/glfm_specification/output_example_snapshots/snapshot_spec.html deleted file mode 100644 index 4ed274d2346db9494993597957d4787160c8d9e0..0000000000000000000000000000000000000000 --- a/glfm_specification/output_example_snapshots/snapshot_spec.html +++ /dev/null @@ -1,13823 +0,0 @@ -<!DOCTYPE html> -<!-- NOTE: Styling is based on the CommonMark specification template: --> -<!-- - https://github.com/commonmark/commonmark-spec/blob/master/tools/make_spec.lua --> -<!-- - https://github.com/commonmark/commonmark-spec/blob/master/tools/template.html --> -<!-- --> -<!-- NOTE: 'TODO:' comments will be followed up as task(s) on this issue: --> -<!-- - https://gitlab.com/gitlab-org/gitlab/-/issues/361241 --> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <title>GitLab Flavored Markdown Internal Extensions</title> - <style type="text/css"> - body { - font-family: Helvetica, arial, freesans, clean, sans-serif; - line-height: 1.4; - max-width: 48em; - margin: auto; - padding: 0 0.5em 4em; - color: #333333; - background-color: #ffffff; - font-size: 13pt; - } - - div#TOC ul { list-style: none; } - h1 { - font-size: 140%; - font-weight: bold; - border-top: 1px solid gray; - padding-top: 0.5em; - } - - h2 { - font-size: 120%; - font-weight: bold; - } - - h3 { - font-size: 110%; - font-weight: bold; - } - - h4 { - font-size: 100%; - font-weight: bold; - } - - /* NOTE: "font-weight: bold" was applied to "a.definition" class in original CommonMark */ - /* template, but in practice it was applied to all anchors */ - a { - font-weight: bold; - } - - - /* TODO: Format whitespace in examples. This will require preprocessing to insert spans around them. */ - /*span.space { position: relative; }*/ - /*span.space:after {*/ - /* content: "·";*/ - /* position: absolute;*/ - /* !* create a mark that indicates a space (trick from D. Greenspan) *!*/ - /* top: 0; bottom: 7px; left: 1px; right: 1px;*/ - /* color: #aaaaaa;*/ - /*}*/ - /*@media print {*/ - /* a.dingus { display: none; }*/ - /*}*/ - - div.example { - overflow: hidden; - } - - p { - text-align: justify; - } - - pre { - padding: 0.5em; - margin: 0.2em 0 0.5em; - font-size: 88%; - } - - pre { - white-space: pre-wrap; /* css-3 */ - white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ - white-space: -o-pre-wrap; /* Opera 7 */ - word-wrap: break-word; /* Internet Explorer 5.5+ */ - } - - code { - font-family: monospace; - background-color: #d3e1e4; - } - - pre > code { - background-color: transparent; - } - - .example { - font-size: 0; /* hack to get width: 50% to work on inline-block */ - padding-bottom: 6pt; - } - - .column pre { - font-size: 11pt; - padding: 2pt 6pt; - } - - div.examplenum { - font-size: 11pt; - text-align: left; - margin-bottom: 10px; - } - - div.column { - display: inline-block; - width: 50%; - vertical-align: top; - } - - div.example > div:nth-child(2) { - clear: left; - background-color: #d3e1e4; - } - - div.example > div:nth-child(3) { - clear: right; - background-color: #c9cace; - } - - @media print { - @page { - size: auto; - margin: 1.2in 1.2in 1.2in 1.2in; - } - - body { - margin: 0; - line-height: 1.2; - font-size: 10pt; - } - - .column pre { - font-size: 9pt; - } - - div.examplenum { - font-size: 9pt; - } - } - </style> - <!-- TODO: Extract this javascript out to a separate file and unit test it --> - <script type="text/javascript"> - /* NOTE: The following code performs many of the pre-processing steps originally handled */ - /* in https://github.com/commonmark/commonmark-spec/blob/master/tools/make_spec.lua */ - - /* Adds a div.example wrapper around each pair of example code blocks. */ - function addAttributesToExampleWrapperDivs() { - const exampleAnchorTags = document.querySelectorAll("a[href^=\"#example-\"]"); - for (const exampleAnchorTag of exampleAnchorTags) { - const examplenumDiv = exampleAnchorTag.parentElement; - examplenumDiv.classList.add("examplenum"); - const exampleDiv = examplenumDiv.parentElement; - exampleDiv.classList.add("example"); - exampleDiv.id = exampleAnchorTag.getAttribute("href").substring(1); - } - } - - function addColumnClassToMarkdownDivs() { - const markdownCodeBlockDivs = document.querySelectorAll("div.markdown-code-block"); - for (const markdownCodeBlockDiv of markdownCodeBlockDivs) { - markdownCodeBlockDiv.classList.add("column"); - } - } - - function addNumbersToHeaders() { - const headers = document.querySelectorAll('h1,h2,h3'); - let h1Index = -1; // NOTE: -1 because we don't assign a number to the title - let h2Index = 0; - let h3Index = 0; - const tocEntries = []; - for (const header of headers) { - if (h1Index === -1) { - h1Index++; - continue; - } - - const originalHeaderTextContent = header.textContent.trim(); - const headerAnchor = originalHeaderTextContent.toLowerCase().replaceAll(' ', '-'); - header.id = headerAnchor; - let indent; - let headerTextContent; - if (header.tagName === 'H1') { - h1Index++; - h2Index = 0; - h3Index = 0; - header.textContent = headerTextContent = h1Index + ' ' + originalHeaderTextContent; - indent = 0; - } else if (header.tagName === 'H2') { - h2Index++; - h3Index = 0; - header.textContent = - headerTextContent = h1Index + '.' + h2Index + ' ' + originalHeaderTextContent; - indent = 1; - } else if (header.tagName === 'H3') { - h3Index++; - header.textContent = headerTextContent = - h1Index + '.' + h2Index + '.' + h3Index + ' ' + originalHeaderTextContent; - indent = 2; - } - tocEntries.push({headerAnchor, headerTextContent, indent}); - } - } - - document.addEventListener("DOMContentLoaded", function(_event) { - addAttributesToExampleWrapperDivs(); - addColumnClassToMarkdownDivs(); - const tocEntries = addNumbersToHeaders(); - addToc(tocEntries); - }); - - /* NOTE: The following code is to support the "Try it" interactive "dingus", which */ - /* we do not yet support. But it is being left here for comparison context with the */ - /* original CommonMark template. */ - // $$(document).ready(function() { - // $$("div.example").each(function(e) { - // var t = $$(this).find('code.language-markdown').text(); - // $$(this).find('a.dingus').click(function(f) { - // window.open('/dingus/?text=' + - // encodeURIComponent(t.replace(/→/g,"\t"))); - // }); - // }); - // $$("code.language-markdown").dblclick(function(e) { window.open('/dingus/?text=' + - // encodeURIComponent($$(this).text())); - // }); - // }); - </script> -</head> -<body> -<h1 class="title">GitLab Flavored Markdown Internal Extensions</h1> -<div class="version">Version alpha</div> - -<ul class="section-nav"> -<li> -<a href="#preliminaries">Preliminaries</a><ul> -<li><a href="#characters-and-lines">Characters and lines</a></li> -<li><a href="#tabs">Tabs</a></li> -<li><a href="#insecure-characters">Insecure characters</a></li> -</ul> -</li> -<li> -<a href="#blocks-and-inlines">Blocks and inlines</a><ul> -<li><a href="#precedence">Precedence</a></li> -<li><a href="#container-blocks-and-leaf-blocks">Container blocks and leaf blocks</a></li> -</ul> -</li> -<li> -<a href="#leaf-blocks">Leaf blocks</a><ul> -<li><a href="#thematic-breaks">Thematic breaks</a></li> -<li><a href="#atx-headings">ATX headings</a></li> -<li><a href="#setext-headings">Setext headings</a></li> -<li><a href="#indented-code-blocks">Indented code blocks</a></li> -<li><a href="#fenced-code-blocks">Fenced code blocks</a></li> -<li><a href="#html-blocks">HTML blocks</a></li> -<li><a href="#link-reference-definitions">Link reference definitions</a></li> -<li><a href="#paragraphs">Paragraphs</a></li> -<li><a href="#blank-lines">Blank lines</a></li> -<li><a href="#tables-extension">Tables (extension)</a></li> -</ul> -</li> -<li> -<a href="#container-blocks">Container blocks</a><ul> -<li><a href="#block-quotes">Block quotes</a></li> -<li> -<a href="#list-items">List items</a><ul><li><a href="#motivation">Motivation</a></li></ul> -</li> -<li><a href="#task-list-items-extension">Task list items (extension)</a></li> -<li><a href="#lists">Lists</a></li> -</ul> -</li> -<li> -<a href="#inlines">Inlines</a><ul> -<li><a href="#backslash-escapes">Backslash escapes</a></li> -<li><a href="#entity-and-numeric-character-references">Entity and numeric character references</a></li> -<li><a href="#code-spans">Code spans</a></li> -<li><a href="#emphasis-and-strong-emphasis">Emphasis and strong emphasis</a></li> -<li><a href="#strikethrough-extension">Strikethrough (extension)</a></li> -<li><a href="#links">Links</a></li> -<li><a href="#images">Images</a></li> -<li><a href="#autolinks">Autolinks</a></li> -<li><a href="#autolinks-extension">Autolinks (extension)</a></li> -<li><a href="#raw-html">Raw HTML</a></li> -<li><a href="#disallowed-raw-html-extension">Disallowed Raw HTML (extension)</a></li> -<li><a href="#hard-line-breaks">Hard line breaks</a></li> -<li><a href="#soft-line-breaks">Soft line breaks</a></li> -<li><a href="#textual-content">Textual content</a></li> -</ul> -</li> -<li> -<a href="#gitlab-official-specification-markdown">GitLab Official Specification Markdown</a><ul> -<li><a href="#task-list-items">Task list items</a></li> -<li><a href="#front-matter">Front matter</a></li> -<li><a href="#table-of-contents">Table of contents</a></li> -</ul> -</li> -<li> -<a href="#gitlab-internal-extension-markdown">GitLab Internal Extension Markdown</a><ul> -<li><a href="#audio">Audio</a></li> -<li><a href="#video">Video</a></li> -<li><a href="#markdown-preview-api-request-overrides">Markdown Preview API Request Overrides</a></li> -<li> -<a href="#migrated-golden-master-examples">Migrated golden master examples</a><ul> -<li><a href="#attachment_image_for_group">attachment_image_for_group</a></li> -<li><a href="#attachment_image_for_project">attachment_image_for_project</a></li> -<li><a href="#attachment_image_for_project_wiki">attachment_image_for_project_wiki</a></li> -<li><a href="#attachment_link_for_group">attachment_link_for_group</a></li> -<li><a href="#attachment_link_for_project">attachment_link_for_project</a></li> -<li><a href="#attachment_link_for_project_wiki">attachment_link_for_project_wiki</a></li> -<li><a href="#attachment_link_for_group_wiki">attachment_link_for_group_wiki</a></li> -<li><a href="#audio-1">audio</a></li> -<li><a href="#audio_and_video_in_lists">audio_and_video_in_lists</a></li> -<li><a href="#blockquote">blockquote</a></li> -<li><a href="#bold">bold</a></li> -<li><a href="#bullet_list_style_1">bullet_list_style_1</a></li> -<li><a href="#bullet_list_style_2">bullet_list_style_2</a></li> -<li><a href="#bullet_list_style_3">bullet_list_style_3</a></li> -<li><a href="#code_block_javascript">code_block_javascript</a></li> -<li><a href="#code_block_plaintext">code_block_plaintext</a></li> -<li><a href="#code_block_unknown">code_block_unknown</a></li> -<li><a href="#color_chips">color_chips</a></li> -<li><a href="#description_list">description_list</a></li> -<li><a href="#details">details</a></li> -<li><a href="#diagram_kroki_nomnoml">diagram_kroki_nomnoml</a></li> -<li><a href="#diagram_plantuml">diagram_plantuml</a></li> -<li><a href="#diagram_plantuml_unicode">diagram_plantuml_unicode</a></li> -<li><a href="#div">div</a></li> -<li><a href="#emoji">emoji</a></li> -<li><a href="#emphasis">emphasis</a></li> -<li><a href="#figure">figure</a></li> -<li><a href="#footnotes">footnotes</a></li> -<li><a href="#frontmatter_json">frontmatter_json</a></li> -<li><a href="#frontmatter_toml">frontmatter_toml</a></li> -<li><a href="#frontmatter_yaml">frontmatter_yaml</a></li> -<li><a href="#hard_break">hard_break</a></li> -<li><a href="#headings">headings</a></li> -<li><a href="#horizontal_rule">horizontal_rule</a></li> -<li><a href="#html_marks">html_marks</a></li> -<li><a href="#image">image</a></li> -<li><a href="#inline_code">inline_code</a></li> -<li><a href="#inline_diff">inline_diff</a></li> -<li><a href="#label">label</a></li> -<li><a href="#link">link</a></li> -<li><a href="#math">math</a></li> -<li><a href="#ordered_list">ordered_list</a></li> -<li><a href="#ordered_list_with_start_order">ordered_list_with_start_order</a></li> -<li><a href="#ordered_task_list">ordered_task_list</a></li> -<li><a href="#ordered_task_list_with_order">ordered_task_list_with_order</a></li> -<li><a href="#reference_for_project_wiki">reference_for_project_wiki</a></li> -<li><a href="#strike">strike</a></li> -<li><a href="#table">table</a></li> -<li><a href="#table_of_contents">table_of_contents</a></li> -<li><a href="#task_list">task_list</a></li> -<li><a href="#video-1">video</a></li> -<li><a href="#word_break">word_break</a></li> -</ul> -</li> -<li><a href="#image-attributes">Image Attributes</a></li> -<li><a href="#footnotes-1">Footnotes</a></li> -</ul> -</li> -<li> -<a href="#gfm-undocumented-extensions-and-more-robust-test">GFM undocumented extensions and more robust test</a><ul> -<li><a href="#footnotes-2">Footnotes</a></li> -<li><a href="#when-a-footnote-is-used-multiple-times-we-insert-multiple-backrefs">When a footnote is used multiple times, we insert multiple backrefs.</a></li> -<li><a href="#footnote-reference-labels-are-href-escaped">Footnote reference labels are href escaped</a></li> -<li><a href="#interop">Interop</a></li> -<li><a href="#task-lists">Task lists</a></li> -</ul> -</li> -</ul> -<h1 data-sourcepos="3:1-3:15" dir="auto"> -<a href="#preliminaries" aria-hidden="true" class="anchor" id="user-content-preliminaries"></a>Preliminaries</h1> -<h2 data-sourcepos="5:1-5:23" dir="auto"> -<a href="#characters-and-lines" aria-hidden="true" class="anchor" id="user-content-characters-and-lines"></a>Characters and lines</h2> -<p data-sourcepos="7:1-8:9" dir="auto">Any sequence of [characters] is a valid CommonMark -document.</p> -<p data-sourcepos="10:1-13:26" dir="auto">A <a data-sourcepos="10:3-10:16" href="@">character</a> is a Unicode code point. Although some -code points (for example, combining accents) do not correspond to -characters in an intuitive sense, all code points count as characters -for purposes of this spec.</p> -<p data-sourcepos="15:1-17:22" dir="auto">This spec does not specify an encoding; it thinks of lines as composed -of [characters] rather than bytes. A conforming parser may be limited -to a certain encoding.</p> -<p data-sourcepos="19:1-21:50" dir="auto">A <a data-sourcepos="19:3-19:11" href="@">line</a> is a sequence of zero or more [characters] -other than newline (<code data-sourcepos="20:22-20:27">U+000A</code>) or carriage return (<code data-sourcepos="20:52-20:57">U+000D</code>), -followed by a [line ending] or by the end of file.</p> -<p data-sourcepos="23:1-25:18" dir="auto">A <a data-sourcepos="23:3-23:18" href="@">line ending</a> is a newline (<code data-sourcepos="23:35-23:40">U+000A</code>), a carriage return -(<code data-sourcepos="24:3-24:8">U+000D</code>) not followed by a newline, or a carriage return and a -following newline.</p> -<p data-sourcepos="27:1-28:59" dir="auto">A line containing no characters, or a line containing only spaces -(<code data-sourcepos="28:3-28:8">U+0020</code>) or tabs (<code data-sourcepos="28:22-28:27">U+0009</code>), is called a <a data-sourcepos="28:44-28:58" href="@">blank line</a>.</p> -<p data-sourcepos="30:1-30:73" dir="auto">The following definitions of character classes will be used in this spec:</p> -<p data-sourcepos="32:1-34:52" dir="auto">A <a data-sourcepos="32:3-32:27" href="@">whitespace character</a> is a space -(<code data-sourcepos="33:3-33:8">U+0020</code>), tab (<code data-sourcepos="33:19-33:24">U+0009</code>), newline (<code data-sourcepos="33:39-33:44">U+000A</code>), line tabulation (<code data-sourcepos="33:67-33:72">U+000B</code>), -form feed (<code data-sourcepos="34:13-34:18">U+000C</code>), or carriage return (<code data-sourcepos="34:44-34:49">U+000D</code>).</p> -<p data-sourcepos="36:1-37:12" dir="auto"><a data-sourcepos="36:1-36:15" href="@">Whitespace</a> is a sequence of one or more [whitespace -characters].</p> -<p data-sourcepos="39:1-42:11" dir="auto">A <a data-sourcepos="39:3-39:35" href="@">Unicode whitespace character</a> is -any code point in the Unicode <code data-sourcepos="40:32-40:33">Zs</code> general category, or a tab (<code data-sourcepos="40:65-40:70">U+0009</code>), -carriage return (<code data-sourcepos="41:19-41:24">U+000D</code>), newline (<code data-sourcepos="41:39-41:44">U+000A</code>), or form feed -(<code data-sourcepos="42:3-42:8">U+000C</code>).</p> -<p data-sourcepos="44:1-45:40" dir="auto"><a data-sourcepos="44:1-44:23" href="@">Unicode whitespace</a> is a sequence of one -or more [Unicode whitespace characters].</p> -<p data-sourcepos="47:1-47:25" dir="auto">A <a data-sourcepos="47:3-47:12" href="@">space</a> is <code data-sourcepos="47:18-47:23">U+0020</code>.</p> -<p data-sourcepos="49:1-50:37" dir="auto">A <a data-sourcepos="49:3-49:31" href="@">non-whitespace character</a> is any character -that is not a [whitespace character].</p> -<p data-sourcepos="52:1-57:38" dir="auto">An <a data-sourcepos="52:4-52:35" href="@">ASCII punctuation character</a> -is <code data-sourcepos="53:5-53:5">!</code>, <code data-sourcepos="53:10-53:10">"</code>, <code data-sourcepos="53:15-53:15">#</code>, <code data-sourcepos="53:20-53:20">$</code>, <code data-sourcepos="53:25-53:25">%</code>, <code data-sourcepos="53:30-53:30">&</code>, <code data-sourcepos="53:35-53:35">'</code>, <code data-sourcepos="53:40-53:40">(</code>, <code data-sourcepos="53:45-53:45">)</code>, -<code data-sourcepos="54:2-54:2">*</code>, <code data-sourcepos="54:7-54:7">+</code>, <code data-sourcepos="54:12-54:12">,</code>, <code data-sourcepos="54:17-54:17">-</code>, <code data-sourcepos="54:22-54:22">.</code>, <code data-sourcepos="54:27-54:27">/</code> (U+0021–2F), -<code data-sourcepos="55:2-55:2">:</code>, <code data-sourcepos="55:7-55:7">;</code>, <code data-sourcepos="55:12-55:12"><</code>, <code data-sourcepos="55:17-55:17">=</code>, <code data-sourcepos="55:22-55:22">></code>, <code data-sourcepos="55:27-55:27">?</code>, <code data-sourcepos="55:32-55:32">@</code> (U+003A–0040), -<code data-sourcepos="56:2-56:2">[</code>, <code data-sourcepos="56:7-56:7">\</code>, <code data-sourcepos="56:12-56:12">]</code>, <code data-sourcepos="56:17-56:17">^</code>, <code data-sourcepos="56:22-56:22">_</code>, <code data-sourcepos="56:28-56:30">`</code> (U+005B–0060), -<code data-sourcepos="57:2-57:2">{</code>, <code data-sourcepos="57:7-57:7">|</code>, <code data-sourcepos="57:12-57:12">}</code>, or <code data-sourcepos="57:20-57:20">~</code> (U+007B–007E).</p> -<p data-sourcepos="59:1-61:76" dir="auto">A <a data-sourcepos="59:3-59:28" href="@">punctuation character</a> is an [ASCII -punctuation character] or anything in -the general Unicode categories <code data-sourcepos="61:34-61:35">Pc</code>, <code data-sourcepos="61:40-61:41">Pd</code>, <code data-sourcepos="61:46-61:47">Pe</code>, <code data-sourcepos="61:52-61:53">Pf</code>, <code data-sourcepos="61:58-61:59">Pi</code>, <code data-sourcepos="61:64-61:65">Po</code>, or <code data-sourcepos="61:73-61:74">Ps</code>.</p> -<h2 data-sourcepos="63:1-63:7" dir="auto"> -<a href="#tabs" aria-hidden="true" class="anchor" id="user-content-tabs"></a>Tabs</h2> -<p data-sourcepos="65:1-68:16" dir="auto">Tabs in lines are not expanded to [spaces]. However, -in contexts where whitespace helps to define block structure, -tabs behave as if they were replaced by spaces with a tab stop -of 4 characters.</p> -<p data-sourcepos="70:1-73:8" dir="auto">Thus, for example, a tab can be used instead of four spaces -in an indented code block. (Note, however, that internal -tabs are passed through as literal tabs, not expanded to -spaces.)</p> -<div> -<div><a href="#example-1">Example 1</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="78:1-80:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="82:1-85:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-2">Example 2</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="91:1-93:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="95:1-98:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-3">Example 3</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="104:1-107:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="109:1-113:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="116:1-118: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> -<div><a href="#example-4">Example 4</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="123:1-127:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="129:1-136:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-5">Example 5</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="142:1-146:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="148:1-156:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="159:1-166:36" dir="auto">Normally the <code data-sourcepos="159:15-159:15">></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 data-sourcepos="161:34-161:34">></code> is followed by a tab, -which is treated as if it were expanded into three spaces. -Since one of these spaces is considered part of the -delimiter, <code data-sourcepos="164:13-164:15">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> -<div><a href="#example-6">Example 6</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="171:1-173:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="175:1-180:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-7">Example 7</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="186:1-188:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="190:1-197:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-8">Example 8</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="204:1-207:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="209:1-213:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-9">Example 9</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="219:1-223:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="225:1-237:32" class="code highlight js-syntax-highlight language-plaintext" 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</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> -<div> -<div><a href="#example-10">Example 10</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="243:1-245:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="247:1-249:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>Foo</h1></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-11">Example 11</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="255:1-257:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="259:1-261:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h2 data-sourcepos="265:1-265:22" dir="auto"> -<a href="#insecure-characters" aria-hidden="true" class="anchor" id="user-content-insecure-characters"></a>Insecure characters</h2> -<p data-sourcepos="267:1-268:42" dir="auto">For security reasons, the Unicode character <code data-sourcepos="267:46-267:51">U+0000</code> must be replaced -with the REPLACEMENT CHARACTER (<code data-sourcepos="268:34-268:39">U+FFFD</code>).</p> -<h1 data-sourcepos="270:1-270:20" dir="auto"> -<a href="#blocks-and-inlines" aria-hidden="true" class="anchor" id="user-content-blocks-and-inlines"></a>Blocks and inlines</h1> -<p data-sourcepos="272:1-277:54" dir="auto">We can think of a document as a sequence of -<a data-sourcepos="273:1-273:11" 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 data-sourcepos="276:34-276:44" href="@">inline</a> content---text, -links, emphasized text, images, code spans, and so on.</p> -<h2 data-sourcepos="279:1-279:13" dir="auto"> -<a href="#precedence" aria-hidden="true" class="anchor" id="user-content-precedence"></a>Precedence</h2> -<p data-sourcepos="281:1-283: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> -<div><a href="#example-12">Example 12</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="288:1-291:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="293:1-298:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="302:1-309: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 -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="311:1-311:35" dir="auto"> -<a href="#container-blocks-and-leaf-blocks" aria-hidden="true" class="anchor" id="user-content-container-blocks-and-leaf-blocks"></a>Container blocks and leaf blocks</h2> -<p data-sourcepos="313:1-316:13" dir="auto">We can divide blocks into two types: -<a data-sourcepos="314:1-314:21" href="@">container blocks</a>, -which can contain other blocks, and <a data-sourcepos="315:37-315:52" href="@">leaf blocks</a>, -which cannot.</p> -<h1 data-sourcepos="318:1-318:13" dir="auto"> -<a href="#leaf-blocks" aria-hidden="true" class="anchor" id="user-content-leaf-blocks"></a>Leaf blocks</h1> -<p data-sourcepos="320:1-321:18" dir="auto">This section describes the different kinds of leaf block that make up a -Markdown document.</p> -<h2 data-sourcepos="323:1-323:18" dir="auto"> -<a href="#thematic-breaks" aria-hidden="true" class="anchor" id="user-content-thematic-breaks"></a>Thematic breaks</h2> -<p data-sourcepos="325:1-328:20" dir="auto">A line consisting of 0-3 spaces of indentation, followed by a sequence -of three or more matching <code data-sourcepos="326:28-326:28">-</code>, <code data-sourcepos="326:33-326:33">_</code>, or <code data-sourcepos="326:41-326:41">*</code> characters, each followed -optionally by any number of spaces or tabs, forms a -<a data-sourcepos="328:1-328:19" href="@">thematic break</a>.</p> -<div> -<div><a href="#example-13">Example 13</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="333:1-337:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="339:1-343:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="347:1-347:17" dir="auto">Wrong characters:</p> -<div> -<div><a href="#example-14">Example 14</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="352:1-354:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="356:1-358:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>+++</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-15">Example 15</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="365:1-367:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="369:1-371:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>===</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="375:1-375:22" dir="auto">Not enough characters:</p> -<div> -<div><a href="#example-16">Example 16</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="380:1-384:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="386:1-390:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="394:1-394:39" dir="auto">One to three spaces indent are allowed:</p> -<div> -<div><a href="#example-17">Example 17</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="399:1-403:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="405:1-409:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="413:1-413:24" dir="auto">Four spaces is too many:</p> -<div> -<div><a href="#example-18">Example 18</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="418:1-420:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="422:1-425:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-19">Example 19</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="432:1-435:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="437:1-440:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="444:1-444:39" dir="auto">More than three characters may be used:</p> -<div> -<div><a href="#example-20">Example 20</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="449:1-451:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="453:1-455:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="459:1-459:42" dir="auto">Spaces are allowed between the characters:</p> -<div> -<div><a href="#example-21">Example 21</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="464:1-466:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="468:1-470:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-22">Example 22</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="477:1-479:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="481:1-483:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-23">Example 23</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="490:1-492:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="494:1-496:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="500:1-500:30" dir="auto">Spaces are allowed at the end:</p> -<div> -<div><a href="#example-24">Example 24</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="505:1-507:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="509:1-511:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><hr /></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="515:1-515:51" dir="auto">However, no other characters may occur in the line:</p> -<div> -<div><a href="#example-25">Example 25</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="520:1-526:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="528:1-532:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="536:1-537: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> -<div><a href="#example-26">Example 26</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="542:1-544:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="546:1-548:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>-</em></p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="552:1-552:56" dir="auto">Thematic breaks do not need blank lines before or after:</p> -<div> -<div><a href="#example-27">Example 27</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="557:1-561:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="563:1-571:32" class="code highlight js-syntax-highlight language-plaintext" 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>bar</li></span> -<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="575:1-575:42" dir="auto">Thematic breaks can interrupt a paragraph:</p> -<div> -<div><a href="#example-28">Example 28</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="580:1-584:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="586:1-590:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="594:1-598: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> -<div><a href="#example-29">Example 29</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="603:1-607:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="609:1-612:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="616:1-617: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> -<div><a href="#example-30">Example 30</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="622:1-626:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="628:1-636:32" class="code highlight js-syntax-highlight language-plaintext" 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>Bar</li></span> -<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="640:1-640:68" dir="auto">If you want a thematic break in a list item, use a different bullet:</p> -<div> -<div><a href="#example-31">Example 31</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="645:1-648:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="650:1-657:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<h2 data-sourcepos="661:1-661:15" dir="auto"> -<a href="#atx-headings" aria-hidden="true" class="anchor" id="user-content-atx-headings"></a>ATX headings</h2> -<p data-sourcepos="663:1-673:35" dir="auto">An <a data-sourcepos="663:4-663:19" href="@">ATX heading</a> -consists of a string of characters, parsed as inline content, between an -opening sequence of 1--6 unescaped <code data-sourcepos="665:37-665:37">#</code> characters and an optional -closing sequence of any number of unescaped <code data-sourcepos="666:46-666:46">#</code> characters. -The opening sequence of <code data-sourcepos="667:26-667:26">#</code> characters must be followed by a -[space] or by the end of line. The optional closing sequence of <code data-sourcepos="668:66-668:66">#</code>s must be -preceded by a [space] and may be followed by spaces only. The opening -<code data-sourcepos="670:2-670:2">#</code> character may be indented 0-3 spaces. The raw contents of the -heading are stripped of leading and trailing spaces before being parsed -as inline content. The heading level is equal to the number of <code data-sourcepos="672:66-672:66">#</code> -characters in the opening sequence.</p> -<p data-sourcepos="675:1-675:16" dir="auto">Simple headings:</p> -<div> -<div><a href="#example-32">Example 32</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="680:1-687:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="689:1-696:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="700:1-700:46" dir="auto">More than six <code data-sourcepos="700:16-700:16">#</code> characters is not a heading:</p> -<div> -<div><a href="#example-33">Example 33</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="705:1-707:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="709:1-711:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>####### foo</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="715:1-721:9" dir="auto">At least one space is required between the <code data-sourcepos="715:45-715:45">#</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 -<a data-sourcepos="719:1-719:69" href="http://www.aaronsw.com/2002/atx/atx.py" rel="nofollow noreferrer noopener" target="_blank">original ATX implementation</a>, -and it helps prevent things like the following from being parsed as -headings:</p> -<div> -<div><a href="#example-34">Example 34</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="726:1-730:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="732:1-735:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="739:1-739:56" dir="auto">This is not a heading, because the first <code data-sourcepos="739:43-739:43">#</code> is escaped:</p> -<div> -<div><a href="#example-35">Example 35</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="744:1-746:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="748:1-750:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>## foo</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="754:1-754:31" dir="auto">Contents are parsed as inlines:</p> -<div> -<div><a href="#example-36">Example 36</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="759:1-761:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="763:1-765:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="769:1-769:71" dir="auto">Leading and trailing [whitespace] is ignored in parsing inline content:</p> -<div> -<div><a href="#example-37">Example 37</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="774:1-776:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="778:1-780:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>foo</h1></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="784:1-784:44" dir="auto">One to three spaces indentation are allowed:</p> -<div> -<div><a href="#example-38">Example 38</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="789:1-793:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="795:1-799:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="803:1-803:25" dir="auto">Four spaces are too much:</p> -<div> -<div><a href="#example-39">Example 39</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="808:1-810:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="812:1-815:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-40">Example 40</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="822:1-825:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="827:1-830:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="834:1-834:49" dir="auto">A closing sequence of <code data-sourcepos="834:24-834:24">#</code> characters is optional:</p> -<div> -<div><a href="#example-41">Example 41</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="839:1-842:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="844:1-847:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="851:1-851:55" dir="auto">It need not be the same length as the opening sequence:</p> -<div> -<div><a href="#example-42">Example 42</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="856:1-859:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="861:1-864:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="868:1-868:46" dir="auto">Spaces are allowed after the closing sequence:</p> -<div> -<div><a href="#example-43">Example 43</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="873:1-875:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="877:1-879:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h3>foo</h3></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="883:1-885:8" dir="auto">A sequence of <code data-sourcepos="883:16-883:16">#</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> -<div><a href="#example-44">Example 44</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="890:1-892:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="894:1-896:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h3>foo ### b</h3></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="900:1-900:49" dir="auto">The closing sequence must be preceded by a space:</p> -<div> -<div><a href="#example-45">Example 45</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="905:1-907:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="909:1-911:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h1>foo#</h1></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="915:1-916:24" dir="auto">Backslash-escaped <code data-sourcepos="915:20-915:20">#</code> characters do not count as part -of the closing sequence:</p> -<div> -<div><a href="#example-46">Example 46</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="921:1-925:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="927:1-931:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="935:1-936:41" dir="auto">ATX headings need not be separated from surrounding content by blank -lines, and they can interrupt paragraphs:</p> -<div> -<div><a href="#example-47">Example 47</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="941:1-945:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="947:1-951:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-48">Example 48</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="958:1-962:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="964:1-968:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="972:1-972:26" dir="auto">ATX headings can be empty:</p> -<div> -<div><a href="#example-49">Example 49</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="977:1-981:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="983:1-987:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<h2 data-sourcepos="991:1-991:18" dir="auto"> -<a href="#setext-headings" aria-hidden="true" class="anchor" id="user-content-setext-headings"></a>Setext headings</h2> -<p data-sourcepos="993:1-1001:54" dir="auto">A <a data-sourcepos="993:3-993:21" 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 -that, were they not followed by the setext heading underline, -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="1003:1-1008:40" dir="auto">A <a data-sourcepos="1003:3-1003:31" href="@">setext heading underline</a> is a sequence of -<code data-sourcepos="1004:2-1004:2">=</code> characters or a sequence of <code data-sourcepos="1004:34-1004:34">-</code> characters, with no more than 3 -spaces indentation and any number of trailing spaces. If a line -containing a single <code data-sourcepos="1006:22-1006:22">-</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="1010:1-1014:8" dir="auto">The heading is a level 1 heading if <code data-sourcepos="1010:38-1010:38">=</code> characters are used in -the [setext heading underline], and a level 2 heading if <code data-sourcepos="1011:59-1011:59">-</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="1016:1-1019: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="1021:1-1021:16" dir="auto">Simple examples:</p> -<div> -<div><a href="#example-50">Example 50</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1026:1-1032:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1034:1-1037:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1041:1-1041:54" dir="auto">The content of the header may span more than one line:</p> -<div> -<div><a href="#example-51">Example 51</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1046:1-1050:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1052:1-1055:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1058:1-1061: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> -<div><a href="#example-52">Example 52</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1066:1-1070:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1072:1-1075:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1079:1-1079:34" dir="auto">The underlining can be any length:</p> -<div> -<div><a href="#example-53">Example 53</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1084:1-1090:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1092:1-1095:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1099:1-1100:33" dir="auto">The heading content can be indented up to three spaces, and need -not line up with the underlining:</p> -<div> -<div><a href="#example-54">Example 54</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1105:1-1114:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1116:1-1120:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1124:1-1124:31" dir="auto">Four spaces indent is too much:</p> -<div> -<div><a href="#example-55">Example 55</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1129:1-1135:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1137:1-1144:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1148:1-1149:25" dir="auto">The setext heading underline can be indented up to three spaces, and -may have trailing spaces:</p> -<div> -<div><a href="#example-56">Example 56</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1154:1-1157:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="1159:1-1161:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>Foo</h2></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="1165:1-1165:24" dir="auto">Four spaces is too much:</p> -<div> -<div><a href="#example-57">Example 57</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1170:1-1173:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="1175:1-1178:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1182:1-1182:60" dir="auto">The setext heading underline cannot contain internal spaces:</p> -<div> -<div><a href="#example-58">Example 58</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1187:1-1193:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1195:1-1200:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1204:1-1204:62" dir="auto">Trailing spaces in the content line do not cause a line break:</p> -<div> -<div><a href="#example-59">Example 59</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1209:1-1212:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="1214:1-1216:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>Foo</h2></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="1220:1-1220:32" dir="auto">Nor does a backslash at the end:</p> -<div> -<div><a href="#example-60">Example 60</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1225:1-1228:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="1230:1-1232:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>Foo\</h2></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="1236:1-1237:66" dir="auto">Since indicators of block structure take precedence over -indicators of inline structure, the following are setext headings:</p> -<div> -<div><a href="#example-61">Example 61</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1242:1-1250:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1252:1-1257:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1261:1-1262:36" dir="auto">The setext heading underline cannot be a [lazy continuation -line] in a list item or block quote:</p> -<div> -<div><a href="#example-62">Example 62</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1267:1-1270:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="1272:1-1277:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-63">Example 63</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1284:1-1288:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1290:1-1296:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-64">Example 64</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1303:1-1306:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="1308:1-1313:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="1317:1-1319: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> -<div><a href="#example-65">Example 65</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1324:1-1328:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1330:1-1333:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1337:1-1338:16" dir="auto">But in general a blank line is not required before or after -setext headings:</p> -<div> -<div><a href="#example-66">Example 66</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1343:1-1350:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1352:1-1357:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1361:1-1361:32" dir="auto">Setext headings cannot be empty:</p> -<div> -<div><a href="#example-67">Example 67</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1366:1-1369:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="1371:1-1373:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>====</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="1377:1-1379: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> -<div><a href="#example-68">Example 68</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1384:1-1387:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="1389:1-1392:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-69">Example 69</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1399:1-1402:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="1404:1-1409:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-70">Example 70</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1416:1-1419:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="1421:1-1425:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-71">Example 71</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1432:1-1435:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="1437:1-1442:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="1446:1-1447:22" dir="auto">If you want a heading with <code data-sourcepos="1446:29-1446:33">> foo</code> as its literal text, you can -use backslash escapes:</p> -<div> -<div><a href="#example-72">Example 72</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1452:1-1455:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="1457:1-1459:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h2>&gt; foo</h2></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="1463:1-1465:48" dir="auto"><strong data-sourcepos="1463:1-1463:23">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="1467:1-1472:3" data-canonical-lang="markdown" class="code highlight js-syntax-highlight language-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="1474:1-1474:44" dir="auto">One can find four different interpretations:</p> -<ol data-sourcepos="1476:1-1480:0" dir="auto"> -<li data-sourcepos="1476:1-1476:50">paragraph "Foo", heading "bar", paragraph "baz"</li> -<li data-sourcepos="1477:1-1477:55">paragraph "Foo bar", thematic break, paragraph "baz"</li> -<li data-sourcepos="1478:1-1478:30">paragraph "Foo bar --- baz"</li> -<li data-sourcepos="1479:1-1480:0">heading "Foo bar", paragraph "baz"</li> -</ol> -<p data-sourcepos="1481:1-1484: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> -<div><a href="#example-73">Example 73</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1489:1-1495:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1497:1-1501:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1505:1-1506:19" dir="auto">Authors who want interpretation 2 can put blank lines around -the thematic break,</p> -<div> -<div><a href="#example-74">Example 74</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1511:1-1518:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1520:1-1525:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1529:1-1530:19" dir="auto">or use a thematic break that cannot count as a [setext heading -underline], such as</p> -<div> -<div><a href="#example-75">Example 75</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1535:1-1540:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1542:1-1547:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1551:1-1551:60" dir="auto">Authors who want interpretation 3 can use backslash escapes:</p> -<div> -<div><a href="#example-76">Example 76</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1556:1-1561:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1563:1-1568:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<h2 data-sourcepos="1572:1-1572:23" dir="auto"> -<a href="#indented-code-blocks" aria-hidden="true" class="anchor" id="user-content-indented-code-blocks"></a>Indented code blocks</h2> -<p data-sourcepos="1574:1-1580:44" dir="auto">An <a data-sourcepos="1574:4-1574:27" href="@">indented code block</a> is composed of one or more -[indented chunks] separated by blank lines. -An <a data-sourcepos="1576:4-1576:22" 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="1582:1-1585: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> -<div><a href="#example-77">Example 77</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1590:1-1593:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1595:1-1599:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1603:1-1605: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> -<div><a href="#example-78">Example 78</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1610:1-1614:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1616:1-1623:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-79">Example 79</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1630:1-1634:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1636:1-1645:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1650:1-1651:12" dir="auto">The contents of a code block are literal text, and do not get parsed -as Markdown:</p> -<div> -<div><a href="#example-80">Example 80</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1656:1-1661:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1663:1-1669:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1673:1-1673:51" dir="auto">Here we have three chunks separated by blank lines:</p> -<div> -<div><a href="#example-81">Example 81</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1678:1-1686:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1688:1-1697:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1701:1-1702:24" dir="auto">Any initial spaces beyond four will be included in the content, even -in interior blank lines:</p> -<div> -<div><a href="#example-82">Example 82</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1707:1-1711:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1713:1-1718:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1722:1-1723:37" dir="auto">An indented code block cannot interrupt a paragraph. (This -allows hanging indents and the like.)</p> -<div> -<div><a href="#example-83">Example 83</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1728:1-1732:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1734:1-1737:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1741:1-1743: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> -<div><a href="#example-84">Example 84</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1748:1-1751:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="1753:1-1757:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1761:1-1762:7" dir="auto">And indented code can occur immediately before and after other kinds of -blocks:</p> -<div> -<div><a href="#example-85">Example 85</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1767:1-1774:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1776:1-1784:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1788:1-1788:53" dir="auto">The first line can be indented more than four spaces:</p> -<div> -<div><a href="#example-86">Example 86</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1793:1-1796:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="1798:1-1802:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="1806:1-1807:23" dir="auto">Blank lines preceding or following an indented code block -are not included in it:</p> -<div> -<div><a href="#example-87">Example 87</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1812:1-1818:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1820:1-1823:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="1827:1-1827:57" dir="auto">Trailing spaces are included in the code block's content:</p> -<div> -<div><a href="#example-88">Example 88</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1832:1-1834:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="1836:1-1839:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<h2 data-sourcepos="1844:1-1844:21" dir="auto"> -<a href="#fenced-code-blocks" aria-hidden="true" class="anchor" id="user-content-fenced-code-blocks"></a>Fenced code blocks</h2> -<p data-sourcepos="1846:1-1850:61" dir="auto">A <a data-sourcepos="1846:3-1846:17" href="@">code fence</a> is a sequence -of at least three consecutive backtick characters (<code data-sourcepos="1847:54-1847:56">`</code>) or -tildes (<code data-sourcepos="1848:10-1848:10">~</code>). (Tildes and backticks cannot be mixed.) -A <a data-sourcepos="1849:3-1849:24" href="@">fenced code block</a> -begins with a code fence, indented no more than three spaces.</p> -<p data-sourcepos="1852:1-1858: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 data-sourcepos="1854:27-1854:42" 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="1860:1-1867: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 -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="1869:1-1877: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 -opening code fence until the end of the containing block (or -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="1879:1-1880: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="1882:1-1886: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 data-sourcepos="1884:63-1884:67">class</code> -attribute of the <code data-sourcepos="1885:19-1885:22">code</code> tag. However, this spec does not mandate any -particular treatment of the [info string].</p> -<p data-sourcepos="1888:1-1888:40" dir="auto">Here is a simple example with backticks:</p> -<div> -<div><a href="#example-89">Example 89</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1893:1-1898:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1900:1-1904:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1908:1-1908:12" dir="auto">With tildes:</p> -<div> -<div><a href="#example-90">Example 90</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1913:1-1918:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1920:1-1924:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="1927:1-1927:41" dir="auto">Fewer than three backticks is not enough:</p> -<div> -<div><a href="#example-91">Example 91</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1932:1-1936:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1938:1-1940:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>foo</code></p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="1943:1-1944:6" dir="auto">The closing code fence must use the same character as the opening -fence:</p> -<div> -<div><a href="#example-92">Example 92</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1949:1-1954:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1956:1-1960:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-93">Example 93</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1967:1-1972:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1974:1-1978:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="1982:1-1982:69" dir="auto">The closing code fence must be at least as long as the opening fence:</p> -<div> -<div><a href="#example-94">Example 94</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1987:1-1992:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="1994:1-1998:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-95">Example 95</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2005:1-2010:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2012:1-2016:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="2020:1-2021: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> -<div><a href="#example-96">Example 96</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2026:1-2028:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="2030:1-2032:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code></code></pre></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-97">Example 97</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2039:1-2044:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2046:1-2051:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-98">Example 98</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2058:1-2063:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2065:1-2071:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="2075:1-2075:53" dir="auto">A code block can have all empty lines as its content:</p> -<div> -<div><a href="#example-99">Example 99</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2080:1-2085:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2087:1-2091:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="2095:1-2095:26" dir="auto">A code block can be empty:</p> -<div> -<div><a href="#example-100">Example 100</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2100:1-2103:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="2105:1-2107:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><pre><code></code></pre></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="2111:1-2113: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> -<div><a href="#example-101">Example 101</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2118:1-2123:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2125:1-2129:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-102">Example 102</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2136:1-2142:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2144:1-2149:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-103">Example 103</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2156:1-2162:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2164:1-2169:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="2173:1-2173:56" dir="auto">Four spaces indentation produces an indented code block:</p> -<div> -<div><a href="#example-104">Example 104</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2178:1-2182:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2184:1-2189:32" class="code highlight js-syntax-highlight language-plaintext" 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"></code></pre></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="2193:1-2194: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> -<div><a href="#example-105">Example 105</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2199:1-2203:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2205:1-2208:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-106">Example 106</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2215:1-2219:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2221:1-2224:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="2228:1-2228:61" dir="auto">This is not a closing fence, because it is indented 4 spaces:</p> -<div> -<div><a href="#example-107">Example 107</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2233:1-2237:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2239:1-2243:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="2248:1-2248:65" dir="auto">Code fences (opening and closing) cannot contain internal spaces:</p> -<div> -<div><a href="#example-108">Example 108</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2253:1-2256:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="2258:1-2261:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-109">Example 109</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2268:1-2272:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2274:1-2278:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="2282:1-2283:53" dir="auto">Fenced code blocks can interrupt paragraphs, and can be followed -directly by paragraphs, without a blank line between:</p> -<div> -<div><a href="#example-110">Example 110</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2288:1-2294:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2296:1-2301:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="2305:1-2306:34" dir="auto">Other blocks can also occur before and after fenced code blocks -without an intervening blank line:</p> -<div> -<div><a href="#example-111">Example 111</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2311:1-2318:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2320:1-2325:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="2329:1-2334: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 data-sourcepos="2333:46-2333:49">code</code> element consisting -of <code data-sourcepos="2334:5-2334:13">language-</code> followed by the language name.</p> -<div> -<div><a href="#example-112">Example 112</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2339:1-2345:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2347:1-2352:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-113">Example 113</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2359:1-2365:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2367:1-2372:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-114">Example 114</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2379:1-2382:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="2384:1-2386:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="2390:1-2390:65" dir="auto">[Info strings] for backtick code blocks cannot contain backticks:</p> -<div> -<div><a href="#example-115">Example 115</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2395:1-2398:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="2400:1-2403:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="2407:1-2407:70" dir="auto">[Info strings] for tilde code blocks can contain backticks and tildes:</p> -<div> -<div><a href="#example-116">Example 116</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2412:1-2416:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2418:1-2421:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="2425:1-2425:47" dir="auto">Closing code fences cannot have [info strings]:</p> -<div> -<div><a href="#example-117">Example 117</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2430:1-2434:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2436:1-2439:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<h2 data-sourcepos="2444:1-2444:14" dir="auto"> -<a href="#html-blocks" aria-hidden="true" class="anchor" id="user-content-html-blocks"></a>HTML blocks</h2> -<p data-sourcepos="2446:1-2447:53" dir="auto">An <a data-sourcepos="2446:4-2446:18" 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="2449:1-2457: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 data-sourcepos="2451:1-2451:20" href="@">start condition</a> (after up to three spaces optional indentation). -It ends with the first subsequent line that meets a matching <a data-sourcepos="2453:62-2453:13" href="@">end -condition</a>, or the last line of the document, or the last line of -the <a data-sourcepos="2454:5-2454:40" 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="2459:1-2500:0" dir="auto"> -<li data-sourcepos="2459:1-2465:0"> -<p data-sourcepos="2459:5-2464:30"><strong data-sourcepos="2459:5-2459:24">Start condition:</strong> line begins with the string <code data-sourcepos="2459:56-2459:62"><script</code>, -<code data-sourcepos="2460:6-2460:9"><pre</code>, or <code data-sourcepos="2460:17-2460:22"><style</code> (case-insensitive), followed by whitespace, -the string <code data-sourcepos="2461:17-2461:17">></code>, or the end of the line.<br data-sourcepos="2461:44-2461:45"> -<strong data-sourcepos="2461:46-2461:63">End condition:</strong> line contains an end tag -<code data-sourcepos="2462:6-2462:14"></script></code>, <code data-sourcepos="2462:19-2462:24"></pre></code>, or <code data-sourcepos="2462:32-2462:39"></style></code> (case-insensitive; it -need not match the start tag).</p> -</li> -<li data-sourcepos="2466:1-2468:0"> -<p data-sourcepos="2466:5-2467:51"><strong data-sourcepos="2466:5-2466:24">Start condition:</strong> line begins with the string <code data-sourcepos="2466:55-2466:58"><!--</code>.<br data-sourcepos="2466:61-2466:62"> -<strong data-sourcepos="2466:63-2466:80">End condition:</strong> line contains the string <code data-sourcepos="2466:109-2466:111">--></code>.</p> -</li> -<li data-sourcepos="2469:1-2471:0"> -<p data-sourcepos="2469:5-2470:49"><strong data-sourcepos="2469:5-2469:24">Start condition:</strong> line begins with the string <code data-sourcepos="2469:55-2469:56"><?</code>.<br data-sourcepos="2469:59-2469:60"> -<strong data-sourcepos="2469:61-2469:78">End condition:</strong> line contains the string <code data-sourcepos="2469:106-2469:107">?></code>.</p> -</li> -<li data-sourcepos="2472:1-2475:0"> -<p data-sourcepos="2472:5-2474:51"><strong data-sourcepos="2472:5-2472:24">Start condition:</strong> line begins with the string <code data-sourcepos="2472:55-2472:56"><!</code> -followed by an uppercase ASCII letter.<br data-sourcepos="2473:43-2473:44"> -<strong data-sourcepos="2473:45-2473:62">End condition:</strong> line contains the character <code data-sourcepos="2473:93-2473:93">></code>.</p> -</li> -<li data-sourcepos="2476:1-2479:0"> -<p data-sourcepos="2476:5-2478:50"><strong data-sourcepos="2476:5-2476:24">Start condition:</strong> line begins with the string -<code data-sourcepos="2477:6-2477:14"><![CDATA[</code>.<br data-sourcepos="2477:17-2477:18"> -<strong data-sourcepos="2477:19-2477:36">End condition:</strong> line contains the string <code data-sourcepos="2477:64-2477:66">]]></code>.</p> -</li> -<li data-sourcepos="2480:1-2494:0"> -<p data-sourcepos="2480:5-2493:54"><strong data-sourcepos="2480:5-2480:24">Start condition:</strong> line begins the string <code data-sourcepos="2480:50-2480:50"><</code> or <code data-sourcepos="2480:57-2480:58"></</code> -followed by one of the strings (case-insensitive) <code data-sourcepos="2481:56-2481:62">address</code>, -<code data-sourcepos="2482:6-2482:12">article</code>, <code data-sourcepos="2482:17-2482:21">aside</code>, <code data-sourcepos="2482:26-2482:29">base</code>, <code data-sourcepos="2482:34-2482:41">basefont</code>, <code data-sourcepos="2482:46-2482:55">blockquote</code>, <code data-sourcepos="2482:60-2482:63">body</code>, -<code data-sourcepos="2483:6-2483:12">caption</code>, <code data-sourcepos="2483:17-2483:22">center</code>, <code data-sourcepos="2483:27-2483:29">col</code>, <code data-sourcepos="2483:34-2483:41">colgroup</code>, <code data-sourcepos="2483:46-2483:47">dd</code>, <code data-sourcepos="2483:52-2483:58">details</code>, <code data-sourcepos="2483:63-2483:68">dialog</code>, -<code data-sourcepos="2484:6-2484:8">dir</code>, <code data-sourcepos="2484:13-2484:15">div</code>, <code data-sourcepos="2484:20-2484:21">dl</code>, <code data-sourcepos="2484:26-2484:27">dt</code>, <code data-sourcepos="2484:32-2484:39">fieldset</code>, <code data-sourcepos="2484:44-2484:53">figcaption</code>, <code data-sourcepos="2484:58-2484:63">figure</code>, -<code data-sourcepos="2485:6-2485:11">footer</code>, <code data-sourcepos="2485:16-2485:19">form</code>, <code data-sourcepos="2485:24-2485:28">frame</code>, <code data-sourcepos="2485:33-2485:40">frameset</code>, -<code data-sourcepos="2486:6-2486:7">h1</code>, <code data-sourcepos="2486:12-2486:13">h2</code>, <code data-sourcepos="2486:18-2486:19">h3</code>, <code data-sourcepos="2486:24-2486:25">h4</code>, <code data-sourcepos="2486:30-2486:31">h5</code>, <code data-sourcepos="2486:36-2486:37">h6</code>, <code data-sourcepos="2486:42-2486:45">head</code>, <code data-sourcepos="2486:50-2486:55">header</code>, <code data-sourcepos="2486:60-2486:61">hr</code>, -<code data-sourcepos="2487:6-2487:9">html</code>, <code data-sourcepos="2487:14-2487:19">iframe</code>, <code data-sourcepos="2487:24-2487:29">legend</code>, <code data-sourcepos="2487:34-2487:35">li</code>, <code data-sourcepos="2487:40-2487:43">link</code>, <code data-sourcepos="2487:48-2487:51">main</code>, <code data-sourcepos="2487:56-2487:59">menu</code>, <code data-sourcepos="2487:64-2487:71">menuitem</code>, -<code data-sourcepos="2488:6-2488:8">nav</code>, <code data-sourcepos="2488:13-2488:20">noframes</code>, <code data-sourcepos="2488:25-2488:26">ol</code>, <code data-sourcepos="2488:31-2488:38">optgroup</code>, <code data-sourcepos="2488:43-2488:48">option</code>, <code data-sourcepos="2488:53-2488:53">p</code>, <code data-sourcepos="2488:58-2488:62">param</code>, -<code data-sourcepos="2489:6-2489:12">section</code>, <code data-sourcepos="2489:17-2489:23">summary</code>, <code data-sourcepos="2489:28-2489:32">table</code>, <code data-sourcepos="2489:37-2489:41">tbody</code>, <code data-sourcepos="2489:46-2489:47">td</code>, -<code data-sourcepos="2490:6-2490:10">tfoot</code>, <code data-sourcepos="2490:15-2490:16">th</code>, <code data-sourcepos="2490:21-2490:25">thead</code>, <code data-sourcepos="2490:30-2490:34">title</code>, <code data-sourcepos="2490:39-2490:40">tr</code>, <code data-sourcepos="2490:45-2490:49">track</code>, <code data-sourcepos="2490:54-2490:55">ul</code>, followed -by [whitespace], the end of the line, the string <code data-sourcepos="2491:55-2491:55">></code>, or -the string <code data-sourcepos="2492:17-2492:18">/></code>.<br data-sourcepos="2492:21-2492:22"> -<strong data-sourcepos="2492:23-2492:40">End condition:</strong> line is followed by a [blank line].</p> -</li> -<li data-sourcepos="2495:1-2500:0"> -<p data-sourcepos="2495:5-2499:54"><strong data-sourcepos="2495:5-2495:24">Start condition:</strong> line begins with a complete [open tag] -(with any [tag name] other than <code data-sourcepos="2496:38-2496:43">script</code>, -<code data-sourcepos="2497:6-2497:10">style</code>, or <code data-sourcepos="2497:18-2497:20">pre</code>) or a complete [closing tag], -followed only by [whitespace] or the end of the line.<br data-sourcepos="2498:58-2498:59"> -<strong data-sourcepos="2498:60-2498:77">End condition:</strong> line is followed by a [blank line].</p> -</li> -</ol> -<p data-sourcepos="2501:1-2506: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 data-sourcepos="2503:60-2503:25" href="#container-blocks">container -block</a>. This means any HTML <strong data-sourcepos="2503:49-2504:7">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="2508:1-2510:51" dir="auto">For instance, <code data-sourcepos="2508:16-2508:20"><pre></code> within a HTML block started by <code data-sourcepos="2508:55-2508:61"><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> -<div><a href="#example-118">Example 118</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2515:1-2523:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2525:1-2532:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="2535:1-2537:55" dir="auto">In this case, the HTML block is terminated by the newline — the <code data-sourcepos="2535:68-2535:76">**Hello**</code> -text remains verbatim — and regular parsing resumes, with a paragraph, -emphasised <code data-sourcepos="2537:13-2537:17">world</code> and inline and block HTML following.</p> -<p data-sourcepos="2539:1-2542: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="2544:1-2545:10" dir="auto">Some simple examples follow. Here are some basic HTML blocks -of type 6:</p> -<div> -<div><a href="#example-119">Example 119</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2550:1-2560:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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"></span> -<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="2562:1-2571:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-120">Example 120</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2578:1-2582:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2584:1-2588:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="2592:1-2592:42" dir="auto">A block can also start with a closing tag:</p> -<div> -<div><a href="#example-121">Example 121</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2597:1-2600:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="2602:1-2605:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="2609:1-2609:68" dir="auto">Here we have two HTML blocks with a Markdown paragraph between them:</p> -<div> -<div><a href="#example-122">Example 122</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2614:1-2620:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2622:1-2626:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="2630:1-2631: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> -<div><a href="#example-123">Example 123</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2636:1-2640:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="2642:1-2646:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-124">Example 124</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2653:1-2657:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2659:1-2663:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="2667:1-2667:31" dir="auto">An open tag need not be closed:</p> -<div> -<div><a href="#example-125">Example 125</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2671:1-2676:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2678:1-2682:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="2687:1-2688:17" dir="auto">A partial tag need not even be completed (garbage -in, garbage out):</p> -<div> -<div><a href="#example-126">Example 126</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2693:1-2696:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="2698:1-2701:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-127">Example 127</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2708:1-2711:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="2713:1-2716:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="2720:1-2721:35" dir="auto">The initial tag doesn't even need to be a valid -tag, as long as it starts like one:</p> -<div> -<div><a href="#example-128">Example 128</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2726:1-2729:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="2731:1-2734:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="2738:1-2739:7" dir="auto">In type 6 blocks, the initial tag need not be on a line by -itself:</p> -<div> -<div><a href="#example-129">Example 129</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2744:1-2746:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="2748:1-2750:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-130">Example 130</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2757:1-2761:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2763:1-2767:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="2771:1-2775: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> -<div><a href="#example-131">Example 131</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2780:1-2785:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2787:1-2792:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="2796:1-2798:51" dir="auto">To start an [HTML block] with a tag that is <em data-sourcepos="2796:45-2796:49">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> -<div><a href="#example-132">Example 132</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2803:1-2807:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="2809:1-2813:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="2817:1-2817:49" dir="auto">In type 7 blocks, the [tag name] can be anything:</p> -<div> -<div><a href="#example-133">Example 133</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2822:1-2826:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2828:1-2832:32" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-134">Example 134</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2839:1-2843:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2845:1-2849:32" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-135">Example 135</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2856:1-2859:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="2861:1-2864:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="2868:1-2872: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 data-sourcepos="2870:6-2870:10"><del></code> tag is a nice example. We can surround content with -<code data-sourcepos="2871:2-2871:6"><del></code> tags in three different ways. In this case, we get a raw -HTML block, because the <code data-sourcepos="2872:26-2872:30"><del></code> tag is on a line by itself:</p> -<div> -<div><a href="#example-136">Example 136</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2877:1-2881:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2883:1-2887:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="2891:1-2893:54" dir="auto">In this case, we get a raw HTML block that just includes -the <code data-sourcepos="2892:6-2892:10"><del></code> tag (because it ends with the following blank -line). So the contents get interpreted as CommonMark:</p> -<div> -<div><a href="#example-137">Example 137</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2898:1-2904:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2906:1-2910:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="2914:1-2917:29" dir="auto">Finally, in this case, the <code data-sourcepos="2914:29-2914:33"><del></code> tags are interpreted -as [raw HTML] <em data-sourcepos="2915:15-2915:22">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> -<div><a href="#example-138">Example 138</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2922:1-2924:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="2926:1-2928:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="2932:1-2937:50" dir="auto">HTML tags designed to contain literal content -(<code data-sourcepos="2933:3-2933:8">script</code>, <code data-sourcepos="2933:13-2933:17">style</code>, <code data-sourcepos="2933:22-2933:24">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="2939:1-2939:19" dir="auto">A pre tag (type 1):</p> -<div> -<div><a href="#example-139">Example 139</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2944:1-2952:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2954:1-2962:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="2966:1-2966:22" dir="auto">A script tag (type 1):</p> -<div> -<div><a href="#example-140">Example 140</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2971:1-2978:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2980:1-2987:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="2991:1-2991:21" dir="auto">A style tag (type 1):</p> -<div> -<div><a href="#example-141">Example 141</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="2996:1-3004:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3006:1-3014:32" class="code highlight js-syntax-highlight language-plaintext" 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"><p>okay</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="3018:1-3020: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> -<div><a href="#example-142">Example 142</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3025:1-3030:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="3032:1-3037:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-143">Example 143</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3044:1-3049:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3051:1-3057:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<div> -<div><a href="#example-144">Example 144</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3064:1-3067:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="3069:1-3076:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3080:1-3080:56" dir="auto">The end tag can occur on the same line as the start tag:</p> -<div> -<div><a href="#example-145">Example 145</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3085:1-3088:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="3090:1-3093:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-146">Example 146</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3100:1-3103:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="3105:1-3108:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3112:1-3113:45" dir="auto">Note that anything on the last line after the -end tag will be included in the [HTML block]:</p> -<div> -<div><a href="#example-147">Example 147</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3118:1-3122:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="3124:1-3128:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="3132:1-3132:19" dir="auto">A comment (type 2):</p> -<div> -<div><a href="#example-148">Example 148</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3137:1-3143:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3145:1-3151:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3156:1-3156:34" dir="auto">A processing instruction (type 3):</p> -<div> -<div><a href="#example-149">Example 149</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3161:1-3168:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3170:1-3177:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3181:1-3181:23" dir="auto">A declaration (type 4):</p> -<div> -<div><a href="#example-150">Example 150</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3186:1-3188:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><!DOCTYPE html></span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3190:1-3192:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><!DOCTYPE html></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="3196:1-3196:15" dir="auto">CDATA (type 5):</p> -<div> -<div><a href="#example-151">Example 151</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3201:1-3215:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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">okay</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3217:1-3231:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3235:1-3235:54" dir="auto">The opening tag can be indented 1-3 spaces, but not 4:</p> -<div> -<div><a href="#example-152">Example 152</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3240:1-3244:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3246:1-3250:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-153">Example 153</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3257:1-3261:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="3263:1-3267:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3271:1-3272: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> -<div><a href="#example-154">Example 154</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3277:1-3282:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="3284:1-3289:32" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="3293:1-3295: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> -<div><a href="#example-155">Example 155</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3300:1-3305:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="3307:1-3312:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="3316:1-3316:51" dir="auto">HTML blocks of type 7 cannot interrupt a paragraph:</p> -<div> -<div><a href="#example-156">Example 156</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3321:1-3325:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3327:1-3331:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3335:1-3336:26" dir="auto">This rule differs from John Gruber's original Markdown syntax -specification, which says:</p> -<blockquote data-sourcepos="3338:1-3341:51" dir="auto"> -<p data-sourcepos="3338:3-3341:51">The only restrictions are that block-level HTML elements — -e.g. <code data-sourcepos="3339:9-3339:13"><div></code>, <code data-sourcepos="3339:18-3339:24"><table></code>, <code data-sourcepos="3339:29-3339:33"><pre></code>, <code data-sourcepos="3339:38-3339:40"><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="3343:1-3344:5" dir="auto">In some ways Gruber's rule is more restrictive than the one given -here:</p> -<ul data-sourcepos="3346:1-3350:0" dir="auto"> -<li data-sourcepos="3346:1-3346:61">It requires that an HTML block be preceded by a blank line.</li> -<li data-sourcepos="3347:1-3347:49">It does not allow the start tag to be indented.</li> -<li data-sourcepos="3348:1-3350:0">It requires a matching end tag, which it also does not allow to -be indented.</li> -</ul> -<p data-sourcepos="3351:1-3352:34" dir="auto">Most Markdown implementations (including some of Gruber's own) do not -respect all of these restrictions.</p> -<p data-sourcepos="3354:1-3361: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 -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="3363:1-3363:8" dir="auto">Compare:</p> -<div> -<div><a href="#example-157">Example 157</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3368:1-3374:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3376:1-3380:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-158">Example 158</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3387:1-3391:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3393:1-3397:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3401:1-3405: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 data-sourcepos="3403:16-3403:25">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="3407:1-3410:59" dir="auto">The main potential drawback is that one can no longer paste HTML -blocks into Markdown documents with 100% reliability. However, -<em data-sourcepos="3409:1-3409:15">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> -<div><a href="#example-159">Example 159</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3415:1-3427:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<span id="LC5" class="line" lang="plaintext"><td></span> -<span id="LC6" class="line" lang="plaintext">Hi</span> -<span id="LC7" class="line" lang="plaintext"></td></span> -<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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3429:1-3437:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3441:1-3443:23" dir="auto">There are problems, however, if the inner tags are indented -<em data-sourcepos="3442:1-3442:5">and</em> separated by spaces, as then they will be interpreted as -an indented code block:</p> -<div> -<div><a href="#example-160">Example 160</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3448:1-3460:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<span id="LC5" class="line" lang="plaintext"> <td></span> -<span id="LC6" class="line" lang="plaintext"> Hi</span> -<span id="LC7" class="line" lang="plaintext"> </td></span> -<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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3462:1-3471:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3475:1-3478:26" dir="auto">Fortunately, blank lines are usually not necessary and can be -deleted. The exception is inside <code data-sourcepos="3476:36-3476:40"><pre></code> tags, but as described -[above][HTML blocks], raw HTML blocks starting with <code data-sourcepos="3477:54-3477:58"><pre></code> -<em data-sourcepos="3478:1-3478:5">can</em> contain blank lines.</p> -<h2 data-sourcepos="3480:1-3480:29" dir="auto"> -<a href="#link-reference-definitions" aria-hidden="true" class="anchor" id="user-content-link-reference-definitions"></a>Link reference definitions</h2> -<p data-sourcepos="3482:1-3490:61" dir="auto">A <a data-sourcepos="3482:3-3482:32" href="@">link reference definition</a> -consists of a [link label], indented up to three spaces, followed -by a colon (<code data-sourcepos="3484:14-3484:14">:</code>), optional [whitespace] (including up to one -[line ending]), a [link destination], -optional [whitespace] (including up to one -[line ending]), and an optional [link -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="3492:1-3497: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> -<div><a href="#example-161">Example 161</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3502:1-3506:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3508:1-3510:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-162">Example 162</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3517:1-3523:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3525:1-3527:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-163">Example 163</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3534:1-3538:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3540:1-3542:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-164">Example 164</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3549:1-3555:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3557:1-3559:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3563:1-3563:41" dir="auto">The title may extend over multiple lines:</p> -<div> -<div><a href="#example-165">Example 165</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3568:1-3576:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3578:1-3584:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3588:1-3588:43" dir="auto">However, it may not contain a [blank line]:</p> -<div> -<div><a href="#example-166">Example 166</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3593:1-3599:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3601:1-3605:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3609:1-3609:25" dir="auto">The title may be omitted:</p> -<div> -<div><a href="#example-167">Example 167</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3614:1-3619:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3621:1-3623:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="3627:1-3627:40" dir="auto">The link destination may not be omitted:</p> -<div> -<div><a href="#example-168">Example 168</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3632:1-3636:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3638:1-3641:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3644:2-3645:16" dir="auto">However, an empty link destination may be specified using -angle brackets:</p> -<div> -<div><a href="#example-169">Example 169</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3650:1-3654:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3656:1-3658:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="3661:1-3662:11" dir="auto">The title must be separated from the link destination by -whitespace:</p> -<div> -<div><a href="#example-170">Example 170</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3667:1-3671:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3673:1-3676:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3680:1-3681:24" dir="auto">Both title and destination can contain backslash escapes -and literal backslashes:</p> -<div> -<div><a href="#example-171">Example 171</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3686:1-3690:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3692:1-3694:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3698:1-3698:52" dir="auto">A link can come before its corresponding definition:</p> -<div> -<div><a href="#example-172">Example 172</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3703:1-3707:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3709:1-3711:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="3715:1-3716:11" dir="auto">If there are several matching definitions, the first one takes -precedence:</p> -<div> -<div><a href="#example-173">Example 173</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3721:1-3726:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3728:1-3730:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3734:1-3735:33" dir="auto">As noted in the section on [Links], matching of labels is -case-insensitive (see [matches]).</p> -<div> -<div><a href="#example-174">Example 174</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3740:1-3744:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3746:1-3748:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-175">Example 175</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3755:1-3759:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3761:1-3763:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3767:1-3768:39" dir="auto">Here is a link reference definition with no corresponding link. -It contributes nothing to the document.</p> -<div> -<div><a href="#example-176">Example 176</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3773:1-3775:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="3777:1-3778:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="3782:1-3782:20" dir="auto">Here is another one:</p> -<div> -<div><a href="#example-177">Example 177</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3787:1-3792:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3794:1-3796:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>bar</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="3800:1-3801:44" dir="auto">This is not a link reference definition, because there are -[non-whitespace characters] after the title:</p> -<div> -<div><a href="#example-178">Example 178</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3806:1-3808:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="3810:1-3812:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3816:1-3816:57" dir="auto">This is a link reference definition, but it has no title:</p> -<div> -<div><a href="#example-179">Example 179</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3821:1-3824:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3826:1-3828:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3832:1-3833:12" dir="auto">This is not a link reference definition, because it is indented -four spaces:</p> -<div> -<div><a href="#example-180">Example 180</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3838:1-3842:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3844:1-3848:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3852:1-3853:13" dir="auto">This is not a link reference definition, because it occurs inside -a code block:</p> -<div> -<div><a href="#example-181">Example 181</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3858:1-3864:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3866:1-3870:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3874:1-3874:59" dir="auto">A [link reference definition] cannot interrupt a paragraph.</p> -<div> -<div><a href="#example-182">Example 182</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3879:1-3884:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3886:1-3890:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3894:1-3895: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> -<div><a href="#example-183">Example 183</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3900:1-3904:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3906:1-3911:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-184">Example 184</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3917:1-3922:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3924:1-3927:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-185">Example 185</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3933:1-3937:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3939:1-3942:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3946:1-3947:61" dir="auto">Several [link reference definitions] -can occur one after another, without intervening blank lines.</p> -<div> -<div><a href="#example-186">Example 186</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3952:1-3961:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></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" 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> -</div> -<p data-sourcepos="3971:1-3974: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> -<div><a href="#example-187">Example 187</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3979:1-3983:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="3985:1-3989:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="3993:1-3997: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> -<div><a href="#example-188">Example 188</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4002:1-4004:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="4006:1-4007:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code></code></pre> -<copy-code></copy-code> -</div> -</div> -<h2 data-sourcepos="4011:1-4011:13" dir="auto"> -<a href="#paragraphs" aria-hidden="true" class="anchor" id="user-content-paragraphs"></a>Paragraphs</h2> -<p data-sourcepos="4013:1-4018:13" dir="auto">A sequence of non-blank lines that cannot be interpreted as other -kinds of blocks forms a <a data-sourcepos="4014:25-4014:38" 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="4020:1-4020:37" dir="auto">A simple example with two paragraphs:</p> -<div> -<div><a href="#example-189">Example 189</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4025:1-4029:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4031:1-4034:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="4038:1-4038:58" dir="auto">Paragraphs can contain multiple lines, but no blank lines:</p> -<div> -<div><a href="#example-190">Example 190</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4043:1-4049:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4051:1-4056:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="4060:1-4060:54" dir="auto">Multiple blank lines between paragraph have no effect:</p> -<div> -<div><a href="#example-191">Example 191</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4065:1-4070:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4072:1-4075:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="4079:1-4079:27" dir="auto">Leading spaces are skipped:</p> -<div> -<div><a href="#example-192">Example 192</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4084:1-4087:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="4089:1-4092:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="4096:1-4097:40" dir="auto">Lines after the first may be indented any amount, since indented -code blocks cannot interrupt paragraphs.</p> -<div> -<div><a href="#example-193">Example 193</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4102:1-4106:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4108:1-4112:32" class="code highlight js-syntax-highlight language-plaintext" 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">ccc</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="4116:1-4117:44" dir="auto">However, the first line may be indented at most three spaces, -or an indented code block will be triggered:</p> -<div> -<div><a href="#example-194">Example 194</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4122:1-4125:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="4127:1-4130:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-195">Example 195</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4137:1-4140:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="4142:1-4146:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="4150:1-4152: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> -<div><a href="#example-196">Example 196</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4157:1-4160:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="4162:1-4165:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<h2 data-sourcepos="4169:1-4169:14" dir="auto"> -<a href="#blank-lines" aria-hidden="true" class="anchor" id="user-content-blank-lines"></a>Blank lines</h2> -<p data-sourcepos="4171:1-4173: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="4175:1-4175:70" dir="auto">Blank lines at the beginning and end of the document are also ignored.</p> -<div> -<div><a href="#example-197">Example 197</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4180:1-4189:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4191:1-4194:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<h2 data-sourcepos="4199:1-4199:21"> -<a href="#tables-extension" aria-hidden="true" class="anchor" id="user-content-tables-extension"></a>Tables (extension)</h2> -<p data-sourcepos="4201:1-4202:10">GFM enables the <code data-sourcepos="4201:18-4201:22">table</code> extension, where an additional leaf block type is -available.</p> -<p data-sourcepos="4204:1-4206:23">A <a data-sourcepos="4204:3-4204:12" 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="4208:1-4212:23">Each row consists of cells containing arbitrary text, in which [inlines] are -parsed, separated by pipes (<code data-sourcepos="4209:30-4209:30">|</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="4214:1-4216:40">The <a data-sourcepos="4214:5-4214:22" href="@">delimiter row</a> consists of cells whose only content are hyphens (<code data-sourcepos="4214:75-4214:75">-</code>), -and optionally, a leading or trailing colon (<code data-sourcepos="4215:47-4215:47">:</code>), or both, to indicate left, -right, or center alignment respectively.</p> -<div> -<div><a href="#example-198">Example 198</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4221:1-4225:32" data-canonical-lang="example" data-lang-params="table" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4227:1-4242:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="4245:1-4246: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> -<div><a href="#example-199">Example 199</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4251:1-4255:32" data-canonical-lang="example" data-lang-params="table" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4257:1-4272:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="4275:1-4276:13">Include a pipe in a cell's content by escaping it, including inside other -inline spans:</p> -<div> -<div><a href="#example-200">Example 200</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4281:1-4286:32" data-canonical-lang="example" data-lang-params="table" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4288:1-4304:32" class="code highlight js-syntax-highlight language-plaintext" 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"><td>b <code>|</code> az</td></span> -<span id="LC10" class="line" lang="plaintext"></tr></span> -<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> -</div> -<p data-sourcepos="4307:1-4308:22">The table is broken at the first empty line, or beginning of another -block-level structure:</p> -<div> -<div><a href="#example-201">Example 201</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4313:1-4318:32" data-canonical-lang="example" data-lang-params="table" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4320:1-4338:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-202">Example 202</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4344:1-4351:32" data-canonical-lang="example" data-lang-params="table" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4353:1-4373:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="4376:1-4377:31">The header row must match the [delimiter row] in the number of cells. If not, -a table will not be recognized:</p> -<div> -<div><a href="#example-203">Example 203</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4382:1-4386:32" data-canonical-lang="example" data-lang-params="table" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4388:1-4392:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="4395:1-4397: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> -<div><a href="#example-204">Example 204</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4402:1-4407:32" data-canonical-lang="example" data-lang-params="table" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4409:1-4428:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="4431:1-4431:75">If there are no rows in the body, no <code data-sourcepos="4431:39-4431:45"><tbody></code> is generated in HTML output:</p> -<div> -<div><a href="#example-205">Example 205</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4436:1-4439:32" data-canonical-lang="example" data-lang-params="table" class="code highlight js-syntax-highlight language-plaintext" 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="4441:1-4450:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<h1 data-sourcepos="4455:1-4455:18" dir="auto"> -<a href="#container-blocks" aria-hidden="true" class="anchor" id="user-content-container-blocks"></a>Container blocks</h1> -<p data-sourcepos="4457:1-4460:45" dir="auto">A <a data-sourcepos="4457:3-4457:38" 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="4462:1-4463:26" dir="auto">We define the syntax for container blocks recursively. The general -form of the definition is:</p> -<blockquote data-sourcepos="4465:1-4467:35" dir="auto"> -<p data-sourcepos="4465:3-4467: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="4469:1-4473:52" dir="auto">So, we explain what counts as a block quote or list item by explaining -how these can be <em data-sourcepos="4470:18-4470:28">generated</em> from their contents. This should suffice -to define the syntax, although it does not give a recipe for <em data-sourcepos="4471:62-4471:70">parsing</em> -these constructions. (A recipe is provided below in the section entitled -<a data-sourcepos="4473:1-4473:50" href="#appendix-a-parsing-strategy">A parsing strategy</a>.)</p> -<h2 data-sourcepos="4475:1-4475:15" dir="auto"> -<a href="#block-quotes" aria-hidden="true" class="anchor" id="user-content-block-quotes"></a>Block quotes</h2> -<p data-sourcepos="4477:1-4479:78" dir="auto">A <a data-sourcepos="4477:3-4477:25" href="@">block quote marker</a> -consists of 0-3 spaces of initial indent, plus (a) the character <code data-sourcepos="4478:67-4478:67">></code> together -with a following space, or (b) a single character <code data-sourcepos="4479:52-4479:52">></code> not followed by a space.</p> -<p data-sourcepos="4481:1-4481:42" dir="auto">The following rules define [block quotes]:</p> -<ol data-sourcepos="4483:1-4500:0" dir="auto"> -<li data-sourcepos="4483:1-4487:0"> -<p data-sourcepos="4483:5-4486:54"><strong data-sourcepos="4483:5-4483:19">Basic case.</strong> If a string of lines <em data-sourcepos="4483:43-4483:46">Ls</em> constitute a sequence -of blocks <em data-sourcepos="4484:15-4484:18">Bs</em>, then the result of prepending a [block quote -marker] to the beginning of each line in <em data-sourcepos="4485:46-4485:49">Ls</em> -is a <a data-sourcepos="4486:10-4486:37" href="#block-quotes">block quote</a> containing <em data-sourcepos="4486:50-4486:53">Bs</em>.</p> -</li> -<li data-sourcepos="4488:1-4497:0"> -<p data-sourcepos="4488:5-4496:48"><strong data-sourcepos="4488:5-4488:17">Laziness.</strong> If a string of lines <em data-sourcepos="4488:41-4488:44">Ls</em> constitute a <a data-sourcepos="4489:59-4489:25" href="#block-quotes">block -quote</a> with contents <em data-sourcepos="4489:41-4489:44">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 -quote marker] is [paragraph continuation -text] is a block quote with <em data-sourcepos="4493:33-4493:36">Bs</em> as its content. -<a data-sourcepos="4494:5-4494:36" href="@">Paragraph continuation text</a> is text -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="4498:1-4500:0"> -<p data-sourcepos="4498:5-4499:65"><strong data-sourcepos="4498:5-4498:24">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="4501:1-4501:54" dir="auto">Nothing else counts as a <a data-sourcepos="4501:26-4501:53" href="#block-quotes">block quote</a>.</p> -<p data-sourcepos="4503:1-4503:25" dir="auto">Here is a simple example:</p> -<div> -<div><a href="#example-206">Example 206</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4508:1-4512:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4514:1-4520:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="4524:1-4524:51" dir="auto">The spaces after the <code data-sourcepos="4524:23-4524:23">></code> characters can be omitted:</p> -<div> -<div><a href="#example-207">Example 207</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4529:1-4533:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4535:1-4541:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="4545:1-4545:46" dir="auto">The <code data-sourcepos="4545:6-4545:6">></code> characters can be indented 1-3 spaces:</p> -<div> -<div><a href="#example-208">Example 208</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4550:1-4554:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4556:1-4562:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="4566:1-4566:34" dir="auto">Four spaces gives us a code block:</p> -<div> -<div><a href="#example-209">Example 209</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4571:1-4575:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4577:1-4582:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="4586:1-4587:30" dir="auto">The Laziness clause allows us to omit the <code data-sourcepos="4586:44-4586:44">></code> before -[paragraph continuation text]:</p> -<div> -<div><a href="#example-210">Example 210</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4592:1-4596:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4598:1-4604:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="4608:1-4609:19" dir="auto">A block quote can contain some lazy and some non-lazy -continuation lines:</p> -<div> -<div><a href="#example-211">Example 211</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4614:1-4618:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4620:1-4626:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="4630:1-4632: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 data-sourcepos="4632:19-4632:20">> </code> cannot be omitted in the second line of</p> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4634:1-4637:3" data-canonical-lang="markdown" class="code highlight js-syntax-highlight language-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="4639:1-4639:29" dir="auto">without changing the meaning:</p> -<div> -<div><a href="#example-212">Example 212</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4644:1-4647:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="4649:1-4654:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="4658:1-4658:52" dir="auto">Similarly, if we omit the <code data-sourcepos="4658:28-4658:29">> </code> in the second line of</p> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4660:1-4663:3" data-canonical-lang="markdown" class="code highlight js-syntax-highlight language-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="4665:1-4665:47" dir="auto">then the block quote ends after the first line:</p> -<div> -<div><a href="#example-213">Example 213</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4670:1-4673:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="4675:1-4684:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="4688:1-4689:53" dir="auto">For the same reason, we can't omit the <code data-sourcepos="4688:41-4688:42">> </code> in front of -subsequent lines of an indented or fenced code block:</p> -<div> -<div><a href="#example-214">Example 214</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4694:1-4697:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="4699:1-4706:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-215">Example 215</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4713:1-4717:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4719:1-4725:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="4729:1-4730:19" dir="auto">Note that in the following case, we have a [lazy -continuation line]:</p> -<div> -<div><a href="#example-216">Example 216</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4735:1-4738:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="4740:1-4745:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="4749:1-4749:24" dir="auto">To see why, note that in</p> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4751:1-4754:3" data-canonical-lang="markdown" class="code highlight js-syntax-highlight language-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="4756:1-4758:61" dir="auto">the <code data-sourcepos="4756:6-4756:10">- 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="4760:1-4760:27" dir="auto">A block quote can be empty:</p> -<div> -<div><a href="#example-217">Example 217</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4765:1-4767:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="4769:1-4772:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-218">Example 218</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4779:1-4783:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4785:1-4788:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="4792:1-4792:52" dir="auto">A block quote can have initial or final blank lines:</p> -<div> -<div><a href="#example-219">Example 219</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4797:1-4801:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4803:1-4807:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="4811:1-4811:43" dir="auto">A blank line always separates block quotes:</p> -<div> -<div><a href="#example-220">Example 220</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4816:1-4820:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4822:1-4829:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="4833:1-4836:44" dir="auto">(Most current Markdown implementations, including John Gruber's -original <code data-sourcepos="4834:11-4834:21">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="4838:1-4839:28" dir="auto">Consecutiveness means that if we put these block quotes together, -we get a single block quote:</p> -<div> -<div><a href="#example-221">Example 221</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4844:1-4847:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="4849:1-4854:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="4858:1-4858:46" dir="auto">To get a block quote with two paragraphs, use:</p> -<div> -<div><a href="#example-222">Example 222</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4863:1-4867:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4869:1-4874:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="4878:1-4878:38" dir="auto">Block quotes can interrupt paragraphs:</p> -<div> -<div><a href="#example-223">Example 223</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4883:1-4886:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="4888:1-4893:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="4897:1-4898:7" dir="auto">In general, blank lines are not needed before or after block -quotes:</p> -<div> -<div><a href="#example-224">Example 224</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4903:1-4907:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4909:1-4917:32" class="code highlight js-syntax-highlight language-plaintext" 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>bbb</p></span> -<span id="LC7" class="line" lang="plaintext"></blockquote></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="4921:1-4922:40" dir="auto">However, because of laziness, a blank line is needed between -a block quote and a following paragraph:</p> -<div> -<div><a href="#example-225">Example 225</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4927:1-4930:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="4932:1-4937:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-226">Example 226</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4944:1-4948:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4950:1-4955:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-227">Example 227</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4962:1-4966:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></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" 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> -<p data-sourcepos="4977:1-4979:19" dir="auto">It is a consequence of the Laziness rule that any number -of initial <code data-sourcepos="4978:13-4978:13">></code>s may be omitted on a continuation line of a -nested block quote:</p> -<div> -<div><a href="#example-228">Example 228</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="4984:1-4987:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="4989:1-4998:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-229">Example 229</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5005:1-5009:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5011:1-5021:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5025:1-5028:8" dir="auto">When including an indented code block in a block quote, -remember that the [block quote marker] includes -both the <code data-sourcepos="5027:11-5027:11">></code> and a following space. So <em data-sourcepos="5027:41-5027:53">five spaces</em> are needed after -the <code data-sourcepos="5028:6-5028:6">></code>:</p> -<div> -<div><a href="#example-230">Example 230</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5033:1-5037:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5039:1-5047:32" class="code highlight js-syntax-highlight language-plaintext" 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"><p>not code</p></span> -<span id="LC7" class="line" lang="plaintext"></blockquote></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h2 data-sourcepos="5052:1-5052:13" dir="auto"> -<a href="#list-items" aria-hidden="true" class="anchor" id="user-content-list-items"></a>List items</h2> -<p data-sourcepos="5054:1-5055:49" dir="auto">A <a data-sourcepos="5054:3-5054:18" href="@">list marker</a> is a -[bullet list marker] or an [ordered list marker].</p> -<p data-sourcepos="5057:1-5058:32" dir="auto">A <a data-sourcepos="5057:3-5057:25" href="@">bullet list marker</a> -is a <code data-sourcepos="5058:7-5058:7">-</code>, <code data-sourcepos="5058:12-5058:12">+</code>, or <code data-sourcepos="5058:20-5058:20">*</code> character.</p> -<p data-sourcepos="5060:1-5064:18" dir="auto">An <a data-sourcepos="5060:4-5060:27" href="@">ordered list marker</a> -is a sequence of 1--9 arabic digits (<code data-sourcepos="5061:39-5061:41">0-9</code>), followed by either a -<code data-sourcepos="5062:2-5062:2">.</code> character or a <code data-sourcepos="5062:21-5062:21">)</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="5066:1-5066:40" dir="auto">The following rules define [list items]:</p> -<ol data-sourcepos="5068:1-5087:0" dir="auto"> -<li data-sourcepos="5068:1-5087:0"> -<p data-sourcepos="5068:5-5076:45"><strong data-sourcepos="5068:5-5068:19">Basic case.</strong> If a sequence of lines <em data-sourcepos="5068:45-5068:48">Ls</em> constitute a sequence of -blocks <em data-sourcepos="5069:12-5069:15">Bs</em> starting with a [non-whitespace character], and <em data-sourcepos="5069:65-5069:67">M</em> is a -list marker of width <em data-sourcepos="5070:26-5070:28">W</em> followed by 1 ≤ <em data-sourcepos="5070:48-5070:50">N</em> ≤ 4 spaces, then the result -of prepending <em data-sourcepos="5071:19-5071:21">M</em> and the following spaces to the first line of -<em data-sourcepos="5072:5-5072:8">Ls</em>, and indenting subsequent lines of <em data-sourcepos="5072:45-5072:48">Ls</em> by <em data-sourcepos="5072:53-5072:59">W + N</em> spaces, is a -list item with <em data-sourcepos="5073:20-5073:23">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="5078:5-5078:15">Exceptions:</p> -<ol data-sourcepos="5080:5-5087:0"> -<li data-sourcepos="5080:5-5084: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 data-sourcepos="5083:18-5083:21">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="5085:5-5087: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="5088:1-5088:34" dir="auto">For example, let <em data-sourcepos="5088:18-5088:21">Ls</em> be the lines</p> -<div> -<div><a href="#example-231">Example 231</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5093:1-5100:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5102:1-5110:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5114:1-5116:30" dir="auto">And let <em data-sourcepos="5114:9-5114:11">M</em> be the marker <code data-sourcepos="5114:28-5114:29">1.</code>, and <em data-sourcepos="5114:37-5114:39">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 data-sourcepos="5116:26-5116:29">Ls</em>:</p> -<div> -<div><a href="#example-232">Example 232</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5121:1-5128:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5130:1-5142:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5146:1-5152: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="5154:1-5155:24" dir="auto">Here are some examples showing how far content must be indented to be -put under the list item:</p> -<div> -<div><a href="#example-233">Example 233</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5160:1-5164:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5166:1-5171:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-234">Example 234</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5178:1-5182:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5184:1-5191:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-235">Example 235</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5198:1-5202:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5204:1-5210:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-236">Example 236</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5217:1-5221:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5223:1-5230:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="5234:1-5240: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 -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> -<div><a href="#example-237">Example 237</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5245:1-5249:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5251:1-5262:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5266:1-5268:67" dir="auto">Here <code data-sourcepos="5266:7-5266:9">two</code> occurs in the same column as the list marker <code data-sourcepos="5266:58-5266:59">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="5270:1-5273:38" dir="auto">The converse is also possible. In the following example, the word <code data-sourcepos="5270:69-5270:71">two</code> -occurs far to the right of the initial text of the list item, <code data-sourcepos="5271:64-5271:66">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> -<div><a href="#example-238">Example 238</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5278:1-5282:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5284:1-5293:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5297:1-5298: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> -<div><a href="#example-239">Example 239</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5303:1-5307:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5309:1-5312:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5316:1-5317:15" dir="auto">A list item may contain blocks that are separated by more than -one blank line.</p> -<div> -<div><a href="#example-240">Example 240</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5322:1-5327:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5329:1-5336:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="5340:1-5340:42" dir="auto">A list item may contain any kind of block:</p> -<div> -<div><a href="#example-241">Example 241</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5345:1-5355:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<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"></span> -<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="5357:1-5369:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5373:1-5374:43" dir="auto">A list item that contains an indented code block will preserve -empty lines within the code block verbatim.</p> -<div> -<div><a href="#example-242">Example 242</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5379:1-5386:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5388:1-5399:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5402:1-5402:65" dir="auto">Note that ordered list start numbers must be nine digits or less:</p> -<div> -<div><a href="#example-243">Example 243</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5407:1-5409:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="5411:1-5415:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-244">Example 244</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5422:1-5424:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="5426:1-5428:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>1234567890. not ok</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="5432:1-5432:33" dir="auto">A start number may begin with 0s:</p> -<div> -<div><a href="#example-245">Example 245</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5437:1-5439:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">0. ok</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5441:1-5445:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<div> -<div><a href="#example-246">Example 246</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5452:1-5454:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="5456:1-5460:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5464:1-5464:35" dir="auto">A start number may not be negative:</p> -<div> -<div><a href="#example-247">Example 247</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5469:1-5471:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="5473:1-5475:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>-1. not ok</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<ol data-sourcepos="5480:1-5490:0" start="2" dir="auto"> -<li data-sourcepos="5480:1-5490:0"> -<strong data-sourcepos="5480:5-5480:41">Item starting with indented code.</strong> If a sequence of lines <em data-sourcepos="5480:67-5480:70">Ls</em> -constitute a sequence of blocks <em data-sourcepos="5481:37-5481:40">Bs</em> starting with an indented code -block, and <em data-sourcepos="5482:16-5482:18">M</em> is a list marker of width <em data-sourcepos="5482:46-5482:48">W</em> followed by -one space, then the result of prepending <em data-sourcepos="5483:46-5483:48">M</em> and the following -space to the first line of <em data-sourcepos="5484:32-5484:35">Ls</em>, and indenting subsequent lines of -<em data-sourcepos="5485:5-5485:8">Ls</em> by <em data-sourcepos="5485:13-5485:19">W + 1</em> spaces, is a list item with <em data-sourcepos="5485:49-5485:52">Bs</em> as its contents. -If a line is empty, then it need not be indented. 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.</li> -</ol> -<p data-sourcepos="5491:1-5493: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> -<div><a href="#example-248">Example 248</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5498:1-5502:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5504:1-5512:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5516:1-5516:33" dir="auto">And in this case it is 11 spaces:</p> -<div> -<div><a href="#example-249">Example 249</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5521:1-5525:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5527:1-5535:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5539:1-5541:12" dir="auto">If the <em data-sourcepos="5539:8-5539:14">first</em> block in the list item is an indented code block, -then by rule #2, the contents must be indented <em data-sourcepos="5540:48-5540:52">one</em> space after the -list marker:</p> -<div> -<div><a href="#example-250">Example 250</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5546:1-5552:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5554:1-5560:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-251">Example 251</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5567:1-5573:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5575:1-5585:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5589:1-5590:22" dir="auto">Note that an additional space indent is interpreted as space -inside the code block:</p> -<div> -<div><a href="#example-252">Example 252</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5595:1-5601:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5603:1-5613:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5617:1-5623: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 -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> -<div><a href="#example-253">Example 253</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5628:1-5632:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5634:1-5637:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-254">Example 254</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5644:1-5648:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5650:1-5655:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5659:1-5662: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> -<div><a href="#example-255">Example 255</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5667:1-5671:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5673:1-5680:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<ol data-sourcepos="5684:1-5695:0" start="3" dir="auto"> -<li data-sourcepos="5684:1-5695:0"> -<strong data-sourcepos="5684:5-5684:40">Item starting with a blank line.</strong> If a sequence of lines <em data-sourcepos="5684:66-5684:69">Ls</em> -starting with a single [blank line] constitute a (possibly empty) -sequence of blocks <em data-sourcepos="5686:24-5686:27">Bs</em>, not separated from each other by more than -one blank line, and <em data-sourcepos="5687:25-5687:27">M</em> is a list marker of width <em data-sourcepos="5687:55-5687:57">W</em>, -then the result of prepending <em data-sourcepos="5688:35-5688:37">M</em> to the first line of <em data-sourcepos="5688:60-5688:63">Ls</em>, and -indenting subsequent lines of <em data-sourcepos="5689:35-5689:38">Ls</em> by <em data-sourcepos="5689:43-5689:49">W + 1</em> spaces, is a list -item with <em data-sourcepos="5690:15-5690:18">Bs</em> as its contents. -If a line is empty, then it need not be indented. 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.</li> -</ol> -<p data-sourcepos="5696:1-5696:72" dir="auto">Here are some list items that start with a blank line but are not empty:</p> -<div> -<div><a href="#example-256">Example 256</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5701:1-5710:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5712:1-5724:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5727:1-5728: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> -<div><a href="#example-257">Example 257</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5733:1-5736:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="5738:1-5742:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5746:1-5748:5" dir="auto">A list item can begin with at most one blank line. -In the following example, <code data-sourcepos="5747:28-5747:30">foo</code> is not part of the list -item:</p> -<div> -<div><a href="#example-258">Example 258</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5753:1-5757:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5759:1-5764:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5768:1-5768:34" dir="auto">Here is an empty bullet list item:</p> -<div> -<div><a href="#example-259">Example 259</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5773:1-5777:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5779:1-5785:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5789:1-5789:72" dir="auto">It does not matter whether there are spaces following the [list marker]:</p> -<div> -<div><a href="#example-260">Example 260</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5794:1-5798:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5800:1-5806:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5810:1-5810:35" dir="auto">Here is an empty ordered list item:</p> -<div> -<div><a href="#example-261">Example 261</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5815:1-5819:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5821:1-5827:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5831:1-5831:48" dir="auto">A list may start or end with an empty list item:</p> -<div> -<div><a href="#example-262">Example 262</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5836:1-5838:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="5840:1-5844:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5847:1-5847:57" dir="auto">However, an empty list item cannot interrupt a paragraph:</p> -<div> -<div><a href="#example-263">Example 263</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5852:1-5858:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5860:1-5865:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<ol data-sourcepos="5869:1-5874:0" start="4" dir="auto"> -<li data-sourcepos="5869:1-5874:0"> -<strong data-sourcepos="5869:5-5869:20">Indentation.</strong> If a sequence of lines <em data-sourcepos="5869:46-5869:49">Ls</em> constitutes a list item -according to rule #1, #2, or #3, then the result of indenting each line -of <em data-sourcepos="5871:8-5871:11">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="5875:1-5875:19" dir="auto">Indented one space:</p> -<div> -<div><a href="#example-264">Example 264</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5880:1-5887:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5889:1-5901:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5905:1-5905:20" dir="auto">Indented two spaces:</p> -<div> -<div><a href="#example-265">Example 265</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5910:1-5917:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5919:1-5931:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5935:1-5935:22" dir="auto">Indented three spaces:</p> -<div> -<div><a href="#example-266">Example 266</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5940:1-5947:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5949:1-5961:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="5965:1-5965:38" dir="auto">Four spaces indent gives a code block:</p> -<div> -<div><a href="#example-267">Example 267</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5970:1-5977:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="5979:1-5987:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<ol data-sourcepos="5992:1-6000:0" start="5" dir="auto"> -<li data-sourcepos="5992:1-6000:0"> -<strong data-sourcepos="5992:5-5992:17">Laziness.</strong> If a string of lines <em data-sourcepos="5992:41-5992:44">Ls</em> constitute a <a data-sourcepos="5993:59-5993:22" href="#list-items">list -item</a> with contents <em data-sourcepos="5993:38-5993:41">Bs</em>, then the result of deleting -some or all of the indentation from one or more lines in which the -next [non-whitespace character] after the indentation is -[paragraph continuation text] is a -list item with the same contents and attributes. The unindented -lines are called -<a data-sourcepos="5999:5-5999:31" href="@">lazy continuation line</a>s.</li> -</ol> -<p data-sourcepos="6001:1-6001:50" dir="auto">Here is an example with [lazy continuation lines]:</p> -<div> -<div><a href="#example-268">Example 268</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6006:1-6013:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6015:1-6027:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="6031:1-6031:37" dir="auto">Indentation can be partially deleted:</p> -<div> -<div><a href="#example-269">Example 269</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6036:1-6039:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="6041:1-6046:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="6050:1-6050:63" dir="auto">These examples show how laziness can work in nested structures:</p> -<div> -<div><a href="#example-270">Example 270</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6055:1-6058:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="6060:1-6071:32" class="code highlight js-syntax-highlight language-plaintext" 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"><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> -<div> -<div><a href="#example-271">Example 271</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6078:1-6081:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="6083:1-6094:32" class="code highlight js-syntax-highlight language-plaintext" 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"><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> -<ol data-sourcepos="6099:1-6101:0" start="6" dir="auto"> -<li data-sourcepos="6099:1-6101:0"> -<strong data-sourcepos="6099:5-6099:19">That's all.</strong> Nothing that is not counted as a list item by rules -#1--5 counts as a <a data-sourcepos="6100:23-6100:46" href="#list-items">list item</a>.</li> -</ol> -<p data-sourcepos="6102:1-6105: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="6107:1-6107:43" dir="auto">So, in this case we need two spaces indent:</p> -<div> -<div><a href="#example-272">Example 272</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6112:1-6117:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6119:1-6135:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="6139:1-6139:18" dir="auto">One is not enough:</p> -<div> -<div><a href="#example-273">Example 273</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6144:1-6149:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6151:1-6158:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="6162:1-6162:52" dir="auto">Here we need four, because the list marker is wider:</p> -<div> -<div><a href="#example-274">Example 274</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6167:1-6170:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="6172:1-6180:32" class="code highlight js-syntax-highlight language-plaintext" 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>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> -</div> -<p data-sourcepos="6184:1-6184:20" dir="auto">Three is not enough:</p> -<div> -<div><a href="#example-275">Example 275</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6189:1-6192:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="6194:1-6201:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="6205:1-6205:45" dir="auto">A list may be the first block in a list item:</p> -<div> -<div><a href="#example-276">Example 276</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6210:1-6212:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="6214:1-6222:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-277">Example 277</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6229:1-6231:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="6233:1-6245:32" class="code highlight js-syntax-highlight language-plaintext" 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"><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"></ol></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="6249:1-6249:34" dir="auto">A list item can contain a heading:</p> -<div> -<div><a href="#example-278">Example 278</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6254:1-6259:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6261:1-6270:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<h3 data-sourcepos="6274:1-6274:14" dir="auto"> -<a href="#motivation" aria-hidden="true" class="anchor" id="user-content-motivation"></a>Motivation</h3> -<p data-sourcepos="6276:1-6276:64" dir="auto">John Gruber's Markdown spec says the following about list items:</p> -<ol data-sourcepos="6278:1-6297:0" dir="auto"> -<li data-sourcepos="6278:1-6281:0"> -<p data-sourcepos="6278:4-6280: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="6282:1-6284:0"> -<p data-sourcepos="6282:4-6283: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="6285:1-6288:0"> -<p data-sourcepos="6285:4-6287: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="6289:1-6291:0"> -<p data-sourcepos="6289:4-6290: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="6292:1-6294:0"> -<p data-sourcepos="6292:4-6293:35">"To put a blockquote within a list item, the blockquote's <code data-sourcepos="6292:63-6292:63">></code> -delimiters need to be indented."</p> -</li> -<li data-sourcepos="6295:1-6297:0"> -<p data-sourcepos="6295:4-6296: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="6298:1-6307: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 -that a block quote must be indented, but not by how much; however, the -example given has four spaces indentation. Although nothing is said -about other kinds of block-level content, it is certainly reasonable to -infer that <em data-sourcepos="6305:12-6305:16">all</em> block elements under a list item, including other -lists, must be indented four spaces. This principle has been called the -<em data-sourcepos="6307:1-6307:17">four-space rule</em>.</p> -<p data-sourcepos="6309:1-6320:48" dir="auto">The four-space rule is clear and principled, and if the reference -implementation <code data-sourcepos="6310:17-6310:27">Markdown.pl</code> had followed it, it probably would have -become the standard. However, <code data-sourcepos="6311:33-6311:43">Markdown.pl</code> allowed paragraphs and -sublists to start with only two spaces indentation, at least on the -outer level. Worse, its behavior was inconsistent: a sublist of an -outer-level list needed two spaces indentation, but a sublist of this -sublist needed three spaces. It is not surprising, then, that different -implementations of Markdown have developed very different rules for -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 data-sourcepos="6320:11-6320:21">Markdown.pl</code>'s behavior more closely.)</p> -<p data-sourcepos="6322:1-6327: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 data-sourcepos="6326:21-6326:31">Markdown.pl</code> behavior, provided they are laid out -in a way that is natural for a human to read.</p> -<p data-sourcepos="6329:1-6335: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="6337:1-6339: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="6341:1-6347:3" data-canonical-lang="markdown" class="code highlight js-syntax-highlight language-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="6349:1-6349: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="6351:1-6359:3" data-canonical-lang="html" class="code highlight js-syntax-highlight language-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> -<span id="LC5" class="line" lang="html"><span class="nt"><ul></span></span> -<span id="LC6" class="line" lang="html"><span class="nt"><li></span>baz<span class="nt"></li></span></span> -<span id="LC7" class="line" lang="html"><span class="nt"></ul></span></span></code></pre> -<copy-code></copy-code> -</div> -<p data-sourcepos="6361:1-6361: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="6363:1-6373:3" data-canonical-lang="html" class="code highlight js-syntax-highlight language-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> -<span id="LC5" class="line" lang="html"><span class="nt"><ul></span></span> -<span id="LC6" class="line" lang="html"><span class="nt"><li></span>baz<span class="nt"></li></span></span> -<span id="LC7" class="line" lang="html"><span class="nt"></ul></span></span> -<span id="LC8" class="line" lang="html"><span class="nt"></li></span></span> -<span id="LC9" class="line" lang="html"><span class="nt"></ul></span></span></code></pre> -<copy-code></copy-code> -</div> -<p data-sourcepos="6375:1-6376: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="6378:1-6382: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 data-sourcepos="6380:51-6380:61">less than</em> the -original list marker to be included in the list item. For example, -<code data-sourcepos="6382:2-6382:12">Markdown.pl</code> parses</p> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6384:1-6388:3" data-canonical-lang="markdown" class="code highlight js-syntax-highlight language-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="6390:1-6390:59" dir="auto">as a single list item, with <code data-sourcepos="6390:30-6390:32">two</code> a continuation paragraph:</p> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6392:1-6399:3" data-canonical-lang="html" class="code highlight js-syntax-highlight language-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> -<span id="LC5" class="line" lang="html"><span class="nt"></li></span></span> -<span id="LC6" class="line" lang="html"><span class="nt"></ul></span></span></code></pre> -<copy-code></copy-code> -</div> -<p data-sourcepos="6401:1-6401:13" dir="auto">and similarly</p> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6403:1-6407:3" data-canonical-lang="markdown" class="code highlight js-syntax-highlight language-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="6409:1-6409:2" dir="auto">as</p> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6411:1-6420:3" data-canonical-lang="html" class="code highlight js-syntax-highlight language-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> -<span id="LC5" class="line" lang="html"><span class="nt"><p></span>two<span class="nt"></p></span></span> -<span id="LC6" class="line" lang="html"><span class="nt"></li></span></span> -<span id="LC7" class="line" lang="html"><span class="nt"></ul></span></span> -<span id="LC8" class="line" lang="html"><span class="nt"></blockquote></span></span></code></pre> -<copy-code></copy-code> -</div> -<p data-sourcepos="6422:1-6422:30" dir="auto">This is extremely unintuitive.</p> -<p data-sourcepos="6424:1-6429: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 data-sourcepos="6428:64-6428:66">bar</code> -is not indented as far as the first paragraph <code data-sourcepos="6429:48-6429:50">foo</code>:</p> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6431:1-6435:3" data-canonical-lang="markdown" class="code highlight js-syntax-highlight language-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="6437:1-6440:62" dir="auto">Arguably this text does read like a list item with <code data-sourcepos="6437:53-6437:55">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="6442:1-6446:3" data-canonical-lang="markdown" class="code highlight js-syntax-highlight language-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="6448:1-6450: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 data-sourcepos="6450:24-6450:26">foo</code>.</p> -<p data-sourcepos="6452:1-6458:62" dir="auto">The one case that needs special treatment is a list item that <em data-sourcepos="6452:63-6452:70">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 -(and then the normal four spaces for the indented code). This will match the -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="6462:1-6462:30"> -<a href="#task-list-items-extension" aria-hidden="true" class="anchor" id="user-content-task-list-items-extension"></a>Task list items (extension)</h2> -<p data-sourcepos="6464:1-6465:26">GFM enables the <code data-sourcepos="6464:18-6464:25">tasklist</code> extension, where an additional processing step is -performed on [list items].</p> -<p data-sourcepos="6467:1-6469:46">A <a data-sourcepos="6467:3-6467:21" 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="6471:1-6473:55">A <a data-sourcepos="6471:3-6471:28" href="@">task list item marker</a> consists of an optional number of spaces, a left -bracket (<code data-sourcepos="6472:11-6472:11">[</code>), either a whitespace character or the letter <code data-sourcepos="6472:61-6472:61">x</code> in either -lowercase or uppercase, and then a right bracket (<code data-sourcepos="6473:52-6473:52">]</code>).</p> -<p data-sourcepos="6475:1-6476:70">When rendered, the [task list item marker] is replaced with a semantic checkbox element; -in an HTML output, this would be an <code data-sourcepos="6476:38-6476:60"><input type="checkbox"></code> element.</p> -<p data-sourcepos="6478:1-6479:50">If the character between the brackets is a whitespace character, the checkbox -is unchecked. Otherwise, the checkbox is checked.</p> -<p data-sourcepos="6481:1-6484: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> -<div><a href="#example-279">Example 279</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6489:1-6492:32" data-canonical-lang="example" data-lang-params="disabled" class="code highlight js-syntax-highlight language-plaintext" 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="6494:1-6499:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="6502:1-6502:37">Task lists can be arbitrarily nested:</p> -<div> -<div><a href="#example-280">Example 280</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6507:1-6512:32" data-canonical-lang="example" data-lang-params="disabled" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6514:1-6524:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<h2 data-sourcepos="6529:1-6529:8" dir="auto"> -<a href="#lists" aria-hidden="true" class="anchor" id="user-content-lists"></a>Lists</h2> -<p data-sourcepos="6531:1-6533:46" dir="auto">A <a data-sourcepos="6531:3-6531:11" 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="6535:1-6540:30" dir="auto">Two list items are <a data-sourcepos="6535:20-6535:40" 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 data-sourcepos="6539:3-6539:3">-</code>, <code data-sourcepos="6539:8-6539:8">+</code>, or <code data-sourcepos="6539:16-6539:16">*</code>) or (b) they are ordered list numbers with the same -delimiter (either <code data-sourcepos="6540:20-6540:20">.</code> or <code data-sourcepos="6540:27-6540:27">)</code>).</p> -<p data-sourcepos="6542:1-6546:39" dir="auto">A list is an <a data-sourcepos="6542:14-6542:30" href="@">ordered list</a> -if its constituent list items begin with -[ordered list markers], and a -<a data-sourcepos="6545:1-6545:16" href="@">bullet list</a> if its constituent list -items begin with [bullet list markers].</p> -<p data-sourcepos="6548:1-6551:12" dir="auto">The <a data-sourcepos="6548:5-6548:21" 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="6553:1-6558:65" dir="auto">A list is <a data-sourcepos="6553:11-6553:20" 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 data-sourcepos="6556:36-6556:45" href="@">tight</a>. -(The difference in HTML output is that paragraphs in a loose list are -wrapped in <code data-sourcepos="6558:13-6558:15"><p></code> tags, while paragraphs in a tight list are not.)</p> -<p data-sourcepos="6560:1-6560:64" dir="auto">Changing the bullet or ordered list delimiter starts a new list:</p> -<div> -<div><a href="#example-281">Example 281</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6565:1-6569:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6571:1-6579:32" class="code highlight js-syntax-highlight language-plaintext" 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>baz</li></span> -<span id="LC7" class="line" lang="plaintext"></ul></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-282">Example 282</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6586:1-6590:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6592:1-6600:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="6604:1-6606: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> -<div><a href="#example-283">Example 283</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6611:1-6615:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6617:1-6623:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="6626:1-6627:37" dir="auto"><code data-sourcepos="6626:2-6626:12">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="6629:1-6632:3" data-canonical-lang="markdown" class="code highlight js-syntax-highlight language-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="6634:1-6636:6" dir="auto">Oddly, though, <code data-sourcepos="6634:17-6634:27">Markdown.pl</code> <em data-sourcepos="6634:30-6634:35">does</em> allow a blockquote to -interrupt a paragraph, even though the same considerations might -apply.</p> -<p data-sourcepos="6638:1-6640: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="6642:1-6647:3" data-canonical-lang="markdown" class="code highlight js-syntax-highlight language-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="6649:1-6649:29" dir="auto">Second, we are attracted to a</p> -<blockquote data-sourcepos="6651:1-6654:54" dir="auto"> -<p data-sourcepos="6651:3-6654:54"><a data-sourcepos="6651:3-6651:30" 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="6656:1-6657: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="6659:1-6664:3" data-canonical-lang="markdown" class="code highlight js-syntax-highlight language-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="6666:1-6669: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 data-sourcepos="6668:26-6668:28"><p></code> tags, since the list is "tight"), -then</p> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6671:1-6676:3" data-canonical-lang="markdown" class="code highlight js-syntax-highlight language-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="6678:1-6678:61" dir="auto">by itself should be a paragraph followed by a nested sublist.</p> -<p data-sourcepos="6680:1-6685: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 data-sourcepos="6683:9-6683:68" 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="6687:1-6689:28" dir="auto">In order to solve of unwanted lists in paragraphs with -hard-wrapped numerals, we allow only lists starting with <code data-sourcepos="6688:59-6688:59">1</code> to -interrupt paragraphs. Thus,</p> -<div> -<div><a href="#example-284">Example 284</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6694:1-6697:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6699:1-6702:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="6705:1-6705:51" dir="auto">We may still get an unintended result in cases like</p> -<div> -<div><a href="#example-285">Example 285</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6710:1-6713:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6715:1-6720:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="6723:1-6723:57" dir="auto">but this rule should prevent most spurious list captures.</p> -<p data-sourcepos="6725:1-6725:53" dir="auto">There can be any number of blank lines between items:</p> -<div> -<div><a href="#example-286">Example 286</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6730:1-6737:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6739:1-6751:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-287">Example 287</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6757:1-6764:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6766:1-6781:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="6785:1-6788: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> -<div><a href="#example-288">Example 288</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6793:1-6801:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6803:1-6813:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-289">Example 289</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6820:1-6830:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<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"></span> -<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="6832:1-6845:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="6849:1-6852: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> -<div><a href="#example-290">Example 290</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6857:1-6865:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6867:1-6877:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-291">Example 291</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6884:1-6890:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6892:1-6904:32" class="code highlight js-syntax-highlight language-plaintext" 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>c</p></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> -</div> -<p data-sourcepos="6907:1-6909:52" dir="auto">Note, however, that list items may not be indented more than -three spaces. Here <code data-sourcepos="6908:22-6908:24">- e</code> is treated as a paragraph continuation -line, because it is indented more than three spaces:</p> -<div> -<div><a href="#example-292">Example 292</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6914:1-6920:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6922:1-6930:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="6933:1-6935:11" dir="auto">And here, <code data-sourcepos="6933:12-6933:15">3. c</code> is treated as in indented code block, -because it is indented four spaces and preceded by a -blank line.</p> -<div> -<div><a href="#example-293">Example 293</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6940:1-6946:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6948:1-6959:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="6963:1-6964:22" dir="auto">This is a loose list, because there is a blank line between -two of the list items:</p> -<div> -<div><a href="#example-294">Example 294</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6969:1-6974:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6976:1-6988:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="6992:1-6992:37" dir="auto">So is this, with a empty second item:</p> -<div> -<div><a href="#example-295">Example 295</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="6997:1-7002:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7004:1-7014:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="7018:1-7020: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> -<div><a href="#example-296">Example 296</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7025:1-7031:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7033:1-7046:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-297">Example 297</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7053:1-7059:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7061:1-7073:32" class="code highlight js-syntax-highlight language-plaintext" 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>d</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> -<p data-sourcepos="7077:1-7077:66" dir="auto">This is a tight list, because the blank lines are in a code block:</p> -<div> -<div><a href="#example-298">Example 298</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7082:1-7090:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7092:1-7103:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="7107:1-7109: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> -<div><a href="#example-299">Example 299</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7114:1-7120:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7122:1-7134:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="7138:1-7139:12" dir="auto">This is a tight list, because the blank line is inside the -block quote:</p> -<div> -<div><a href="#example-300">Example 300</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7144:1-7149:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7151:1-7160:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="7164:1-7165:33" dir="auto">This list is tight, because the consecutive block elements -are not separated by blank lines:</p> -<div> -<div><a href="#example-301">Example 301</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7170:1-7177:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7179:1-7190:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="7194:1-7194:33" dir="auto">A single-paragraph list is tight:</p> -<div> -<div><a href="#example-302">Example 302</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7199:1-7201:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="7203:1-7207:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-303">Example 303</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7214:1-7217:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7219:1-7227:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="7231:1-7232:36" dir="auto">This list is loose, because of the blank line between the -two block elements in the list item:</p> -<div> -<div><a href="#example-304">Example 304</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7237:1-7243:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7245:1-7253:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="7257:1-7257:51" dir="auto">Here the outer list is loose, the inner list tight:</p> -<div> -<div><a href="#example-305">Example 305</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7262:1-7267:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7269:1-7279:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-306">Example 306</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7286:1-7294:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7296:1-7313:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<h1 data-sourcepos="7317:1-7317:9" dir="auto"> -<a href="#inlines" aria-hidden="true" class="anchor" id="user-content-inlines"></a>Inlines</h1> -<p data-sourcepos="7319:1-7321: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> -<div><a href="#example-307">Example 307</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7326:1-7328:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">`hi`lo`</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7330:1-7332:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="7335:1-7336:9" dir="auto"><code data-sourcepos="7335:2-7335:3">hi</code> is parsed as code, leaving the backtick at the end as a literal -backtick.</p> -<h2 data-sourcepos="7339:1-7339:20" dir="auto"> -<a href="#backslash-escapes" aria-hidden="true" class="anchor" id="user-content-backslash-escapes"></a>Backslash escapes</h2> -<p data-sourcepos="7341:1-7341:57" dir="auto">Any ASCII punctuation character may be backslash-escaped:</p> -<div> -<div><a href="#example-308">Example 308</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7346:1-7348:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="7350:1-7352:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="7356:1-7357:12" dir="auto">Backslashes before other characters are treated as literal -backslashes:</p> -<div> -<div><a href="#example-309">Example 309</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7362:1-7364:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\→\A\a\ \3\φ\«</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7366:1-7368:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>\→\A\a\ \3\φ\«</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="7372:1-7373:39" dir="auto">Escaped characters are treated as regular characters and do -not have their usual Markdown meanings:</p> -<div> -<div><a href="#example-310">Example 310</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7378:1-7388:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<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 "not a reference"</span> -<span id="LC9" class="line" lang="plaintext">\&ouml; not a character entity</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7390:1-7400:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="7404:1-7404:65" dir="auto">If a backslash is itself escaped, the following character is not:</p> -<div> -<div><a href="#example-311">Example 311</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7409:1-7411:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">\\*emphasis*</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7413:1-7415:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>\<em>emphasis</em></p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="7419:1-7419:58" dir="auto">A backslash at the end of the line is a [hard line break]:</p> -<div> -<div><a href="#example-312">Example 312</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7424:1-7427:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="7429:1-7432:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="7436:1-7437:9" dir="auto">Backslash escapes do not work in code blocks, code spans, autolinks, or -raw HTML:</p> -<div> -<div><a href="#example-313">Example 313</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7442:1-7444:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="7446:1-7448:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>\[\`</code></p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-314">Example 314</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7455:1-7457:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="7459:1-7462:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-315">Example 315</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7469:1-7473:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7475:1-7478:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-316">Example 316</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7485:1-7487:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="7489:1-7491:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-317">Example 317</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7498:1-7500:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="/bar\/)"></span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7502:1-7504:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><a href="/bar\/)"></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="7508:1-7509: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> -<div><a href="#example-318">Example 318</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7514:1-7516:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="7518:1-7520:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-319">Example 319</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7527:1-7531:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7533:1-7535:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-320">Example 320</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7542:1-7546:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7548:1-7551:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<h2 data-sourcepos="7556:1-7556:42" dir="auto"> -<a href="#entity-and-numeric-character-references" aria-hidden="true" class="anchor" id="user-content-entity-and-numeric-character-references"></a>Entity and numeric character references</h2> -<p data-sourcepos="7558:1-7560: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="7562:1-7571:0" dir="auto"> -<li data-sourcepos="7562:1-7564:0"> -<p data-sourcepos="7562:3-7563:24">Entity and character references are not recognized in code -blocks and code spans.</p> -</li> -<li data-sourcepos="7565:1-7571:0"> -<p data-sourcepos="7565:3-7570:9">Entity and character references cannot stand in place of -special characters that define structural elements in -CommonMark. For example, although <code data-sourcepos="7567:39-7567:43">&#42;</code> can be used -in place of a literal <code data-sourcepos="7568:26-7568:26">*</code> character, <code data-sourcepos="7568:41-7568:45">&#42;</code> cannot replace -<code data-sourcepos="7569:4-7569:4">*</code> in emphasis delimiters, bullet list markers, or thematic -breaks.</p> -</li> -</ul> -<p data-sourcepos="7572:1-7574: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="7576:1-7580:47" dir="auto"><a data-sourcepos="7576:1-7576:22" href="@">Entity references</a> consist of <code data-sourcepos="7576:36-7576:36">&</code> + any of the valid -HTML5 entity names + <code data-sourcepos="7577:23-7577:23">;</code>. The -document <a data-sourcepos="7578:11-7578:64" 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> -<div><a href="#example-321">Example 321</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7585:1-7589:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7591:1-7595:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="7599:1-7605:58" dir="auto"><a data-sourcepos="7600:1-7600:14" href="@">Decimal numeric character -references</a> -consist of <code data-sourcepos="7601:13-7601:14">&#</code> + a string of 1--7 arabic digits + <code data-sourcepos="7601:53-7601:53">;</code>. A -numeric character reference is parsed as the corresponding -Unicode character. Invalid Unicode code points will be replaced by -the REPLACEMENT CHARACTER (<code data-sourcepos="7604:29-7604:34">U+FFFD</code>). For security reasons, -the code point <code data-sourcepos="7605:17-7605:22">U+0000</code> will also be replaced by <code data-sourcepos="7605:51-7605:56">U+FFFD</code>.</p> -<div> -<div><a href="#example-322">Example 322</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7610:1-7612:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&#35; &#1234; &#992; &#0;</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7614:1-7616:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p># Ó’ Ï ï¿½</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="7620:1-7624:62" dir="auto"><a data-sourcepos="7621:1-7621:14" href="@">Hexadecimal numeric character -references</a> consist of <code data-sourcepos="7621:28-7621:29">&#</code> + -either <code data-sourcepos="7622:9-7622:9">X</code> or <code data-sourcepos="7622:16-7622:16">x</code> + a string of 1-6 hexadecimal digits + <code data-sourcepos="7622:59-7622:59">;</code>. -They too are parsed as the corresponding Unicode character (this -time specified with a hexadecimal numeral instead of decimal).</p> -<div> -<div><a href="#example-323">Example 323</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7629:1-7631:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">&#X22; &#XD06; &#xcab;</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7633:1-7635:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&quot; à´† ಫ</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="7639:1-7639:26" dir="auto">Here are some nonentities:</p> -<div> -<div><a href="#example-324">Example 324</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7644:1-7649:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7651:1-7656:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="7660:1-7662:60" dir="auto">Although HTML5 does accept some entity references -without a trailing semicolon (such as <code data-sourcepos="7661:40-7661:44">&copy</code>), these are not -recognized here, because it makes the grammar too ambiguous:</p> -<div> -<div><a href="#example-325">Example 325</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7667:1-7669:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="7671:1-7673:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&amp;copy</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="7677:1-7678:39" dir="auto">Strings that are not on the list of HTML5 named entities are not -recognized as entity references either:</p> -<div> -<div><a href="#example-326">Example 326</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7683:1-7685:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="7687:1-7689:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&amp;MadeUpEntity;</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="7693:1-7695: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> -<div><a href="#example-327">Example 327</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7700:1-7702:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="7704:1-7706:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-328">Example 328</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7713:1-7715:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="7717:1-7719:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-329">Example 329</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7726:1-7730:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7732:1-7734:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-330">Example 330</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7741:1-7745:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7747:1-7750:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="7754:1-7755:35" dir="auto">Entity and numeric character references are treated as literal -text in code spans and code blocks:</p> -<div> -<div><a href="#example-331">Example 331</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7760:1-7762:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="7764:1-7766:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<div> -<div><a href="#example-332">Example 332</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7773:1-7775:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="7777:1-7780:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="7784:1-7786:10" dir="auto">Entity and numeric character references cannot be used -in place of symbols indicating structure in CommonMark -documents.</p> -<div> -<div><a href="#example-333">Example 333</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7791:1-7794:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="7796:1-7799:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-334">Example 334</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7805:1-7809:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7811:1-7816:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-335">Example 335</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7822:1-7824:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="7826:1-7830:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-336">Example 336</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7836:1-7838:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="7840:1-7842:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>→foo</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-337">Example 337</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7849:1-7851:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[a](url &quot;tit&quot;)</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7853:1-7855:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<h2 data-sourcepos="7859:1-7859:13" dir="auto"> -<a href="#code-spans" aria-hidden="true" class="anchor" id="user-content-code-spans"></a>Code spans</h2> -<p data-sourcepos="7861:1-7863:36" dir="auto">A <a data-sourcepos="7861:3-7861:22" href="@">backtick string</a> -is a string of one or more backtick characters (<code data-sourcepos="7862:51-7862:53">`</code>) that is neither -preceded nor followed by a backtick.</p> -<p data-sourcepos="7865:1-7868:15" dir="auto">A <a data-sourcepos="7865:3-7865:16" 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="7870:1-7877:0" dir="auto"> -<li data-sourcepos="7870:1-7870:50">First, [line endings] are converted to [spaces].</li> -<li data-sourcepos="7871:1-7877:0">If the resulting string both begins <em data-sourcepos="7871:39-7871:43">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="7878:1-7878:27" dir="auto">This is a simple code span:</p> -<div> -<div><a href="#example-338">Example 338</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7883:1-7885:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="7887:1-7889:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>foo</code></p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="7893:1-7895: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> -<div><a href="#example-339">Example 339</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7900:1-7902:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="7904:1-7906:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="7910:1-7911:7" dir="auto">This example shows the motivation for stripping leading and trailing -spaces:</p> -<div> -<div><a href="#example-340">Example 340</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7916:1-7918:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="7920:1-7922:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>``</code></p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="7925:1-7925:39" dir="auto">Note that only <em data-sourcepos="7925:16-7925:20">one</em> space is stripped:</p> -<div> -<div><a href="#example-341">Example 341</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7930:1-7932:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="7934:1-7936:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code> `` </code></p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="7939:1-7940:20" dir="auto">The stripping only happens if the space is on both -sides of the string:</p> -<div> -<div><a href="#example-342">Example 342</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7945:1-7947:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="7949:1-7951:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code> a</code></p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="7954:1-7955:21" dir="auto">Only [spaces], and not [unicode whitespace] in general, are -stripped in this way:</p> -<div> -<div><a href="#example-343">Example 343</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7960:1-7962:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="7964:1-7966:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code> b </code></p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="7969:1-7969:58" dir="auto">No stripping occurs if the code span contains only spaces:</p> -<div> -<div><a href="#example-344">Example 344</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7974:1-7977:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="7979:1-7982:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="7986:1-7986:39" dir="auto">[Line endings] are treated like spaces:</p> -<div> -<div><a href="#example-345">Example 345</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="7991:1-7997:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></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" 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> -<div> -<div><a href="#example-346">Example 346</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8007:1-8011:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8013:1-8015:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><code>foo </code></p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="8019:1-8019:34" dir="auto">Interior spaces are not collapsed:</p> -<div> -<div><a href="#example-347">Example 347</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8024:1-8027:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8029:1-8031:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="8034:1-8036:26" dir="auto">Note that browsers will typically collapse consecutive spaces -when rendering <code data-sourcepos="8035:17-8035:22"><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="8038:5-8040:0" class="code highlight js-syntax-highlight language-plaintext" 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="8041:1-8042:22" dir="auto">Note that backslash escapes do not work in code spans. All backslashes -are treated literally:</p> -<div> -<div><a href="#example-348">Example 348</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8047:1-8049:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8051:1-8053:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="8057:1-8059:59" dir="auto">Backslash escapes are never needed, because one can always choose a -string of <em data-sourcepos="8058:11-8058:13">n</em> backtick characters as delimiters, where the code does -not contain any strings of exactly <em data-sourcepos="8059:36-8059:38">n</em> backtick characters.</p> -<div> -<div><a href="#example-349">Example 349</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8064:1-8066:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8068:1-8070:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<div> -<div><a href="#example-350">Example 350</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8076:1-8078:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8080:1-8082:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="8086:1-8089: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 data-sourcepos="8088:50-8088:50">*</code> is part of a code -span:</p> -<div> -<div><a href="#example-351">Example 351</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8094:1-8096:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8098:1-8100:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*foo<code>*</code></p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="8104:1-8104:33" dir="auto">And this is not parsed as a link:</p> -<div> -<div><a href="#example-352">Example 352</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8109:1-8111:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[not a `link](/foo`)</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8113:1-8115:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="8119:1-8120:19" dir="auto">Code spans, HTML tags, and autolinks have the same precedence. -Thus, this is code:</p> -<div> -<div><a href="#example-353">Example 353</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8125:1-8127:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8129:1-8131:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="8135:1-8135:24" dir="auto">But this is an HTML tag:</p> -<div> -<div><a href="#example-354">Example 354</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8140:1-8142:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8144:1-8146:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a href="`">`</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="8150:1-8150:17" dir="auto">And this is code:</p> -<div> -<div><a href="#example-355">Example 355</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8155:1-8157:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8159:1-8161:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="8165:1-8165:24" dir="auto">But this is an autolink:</p> -<div> -<div><a href="#example-356">Example 356</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8170:1-8172:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8174:1-8176:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="8180:1-8181:31" dir="auto">When a backtick string is not closed by a matching backtick string, -we just have literal backticks:</p> -<div> -<div><a href="#example-357">Example 357</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8186:1-8188:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8190:1-8192:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>```foo``</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-358">Example 358</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8199:1-8201:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8203:1-8205:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>`foo</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="8208:1-8209:47" dir="auto">The following case also illustrates the need for opening and -closing backtick strings to be equal in length:</p> -<div> -<div><a href="#example-359">Example 359</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8214:1-8216:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8218:1-8220:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<h2 data-sourcepos="8224:1-8224:31" dir="auto"> -<a href="#emphasis-and-strong-emphasis" aria-hidden="true" class="anchor" id="user-content-emphasis-and-strong-emphasis"></a>Emphasis and strong emphasis</h2> -<p data-sourcepos="8226:1-8227:73" dir="auto">John Gruber's original <a data-sourcepos="8227:24-8227:67" href="http://daringfireball.net/projects/markdown/syntax#em" rel="nofollow noreferrer noopener" target="_blank">Markdown syntax -description</a> says:</p> -<blockquote data-sourcepos="8229:1-8232:6" dir="auto"> -<p data-sourcepos="8229:3-8232:6">Markdown treats asterisks (<code data-sourcepos="8229:31-8229:31">*</code>) and underscores (<code data-sourcepos="8229:53-8229:53">_</code>) as indicators of -emphasis. Text wrapped with one <code data-sourcepos="8230:36-8230:36">*</code> or <code data-sourcepos="8230:43-8230:43">_</code> will be wrapped with an HTML -<code data-sourcepos="8231:4-8231:7"><em></code> tag; double <code data-sourcepos="8231:23-8231:23">*</code>'s or <code data-sourcepos="8231:32-8231:32">_</code>'s will be wrapped with an HTML <code data-sourcepos="8231:67-8231:74"><strong></code> -tag.</p> -</blockquote> -<p data-sourcepos="8234:1-8238: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 data-sourcepos="8236:2-8236:12">Markdown.pl</code> test suite makes it clear that triple <code data-sourcepos="8236:54-8236:56">***</code> and -<code data-sourcepos="8237:2-8237:4">___</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="8240:1-8246:3" data-canonical-lang="markdown" class="code highlight js-syntax-highlight language-markdown" v-pre="true"><code><span id="LC1" class="line" lang="markdown"><span class="ges">***strong emph***</span></span> -<span id="LC2" class="line" lang="markdown"><span class="ge">***strong** in emph*</span></span> -<span id="LC3" class="line" lang="markdown"><span class="ge">***emph*</span> in strong<span class="ge">**</span></span> -<span id="LC4" class="line" lang="markdown"><span class="ge">**</span>in strong <span class="ge">*emph***</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="8248:1-8250: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="8252:1-8255:3" data-canonical-lang="markdown" class="code highlight js-syntax-highlight language-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="ge">**</span> in it<span class="ge">**</span></span></code></pre> -<copy-code></copy-code> -</div> -<p data-sourcepos="8257:1-8260:31" dir="auto">Many implementations have also restricted intraword emphasis to -the <code data-sourcepos="8258:6-8258:6">*</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="8262:1-8265:3" data-canonical-lang="markdown" class="code highlight js-syntax-highlight language-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="8267:1-8268: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="8270:1-8274:38" dir="auto">First, some definitions. A <a data-sourcepos="8270:29-8270:46" href="@">delimiter run</a> is either -a sequence of one or more <code data-sourcepos="8271:28-8271:28">*</code> characters that is not preceded or -followed by a non-backslash-escaped <code data-sourcepos="8272:38-8272:38">*</code> character, or a sequence -of one or more <code data-sourcepos="8273:17-8273:17">_</code> characters that is not preceded or followed by -a non-backslash-escaped <code data-sourcepos="8274:26-8274:26">_</code> character.</p> -<p data-sourcepos="8276:1-8282:37" dir="auto">A <a data-sourcepos="8276:3-8276:34" 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="8284:1-8290:37" dir="auto">A <a data-sourcepos="8284:3-8284:35" 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="8292:1-8292:41" dir="auto">Here are some examples of delimiter runs.</p> -<ul data-sourcepos="8294:3-8325:0" dir="auto"> -<li data-sourcepos="8294:3-8302:0"> -<p data-sourcepos="8294:5-8294:41">left-flanking but not right-flanking:</p> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8296:5-8301:7" class="code highlight js-syntax-highlight language-plaintext" 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="8303:3-8311:0"> -<p data-sourcepos="8303:5-8303:41">right-flanking but not left-flanking:</p> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8305:5-8310:7" class="code highlight js-syntax-highlight language-plaintext" 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="8312:3-8318:0"> -<p data-sourcepos="8312:5-8312:33">Both left and right-flanking:</p> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8314:5-8317:7" class="code highlight js-syntax-highlight language-plaintext" 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="8319:3-8325:0"> -<p data-sourcepos="8319:5-8319:36">Neither left nor right-flanking:</p> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8321:5-8324:7" class="code highlight js-syntax-highlight language-plaintext" 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="8326:1-8332: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 data-sourcepos="8329:1-8329:92" 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="8334:1-8334:56" dir="auto">The following rules define emphasis and strong emphasis:</p> -<ol data-sourcepos="8336:1-8400:0" dir="auto"> -<li data-sourcepos="8336:1-8338:0"> -<p data-sourcepos="8336:5-8337:71">A single <code data-sourcepos="8336:15-8336:15">*</code> character <a data-sourcepos="8336:28-8336:49" href="@">can open emphasis</a> -iff (if and only if) it is part of a [left-flanking delimiter run].</p> -</li> -<li data-sourcepos="8339:1-8344:0"> -<p data-sourcepos="8339:5-8343:28">A single <code data-sourcepos="8339:15-8339:15">_</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="8345:1-8347:0"> -<p data-sourcepos="8345:5-8346:55">A single <code data-sourcepos="8345:15-8345:15">*</code> character <a data-sourcepos="8345:28-8345:50" href="@">can close emphasis</a> -iff it is part of a [right-flanking delimiter run].</p> -</li> -<li data-sourcepos="8348:1-8353:0"> -<p data-sourcepos="8348:5-8352:28">A single <code data-sourcepos="8348:15-8348:15">_</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="8354:1-8356:0"> -<p data-sourcepos="8354:5-8355:54">A double <code data-sourcepos="8354:15-8354:16">**</code> <a data-sourcepos="8354:19-8354:47" href="@">can open strong emphasis</a> -iff it is part of a [left-flanking delimiter run].</p> -</li> -<li data-sourcepos="8357:1-8362:0"> -<p data-sourcepos="8357:5-8361:28">A double <code data-sourcepos="8357:15-8357:16">__</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="8363:1-8365:0"> -<p data-sourcepos="8363:5-8364:55">A double <code data-sourcepos="8363:15-8363:16">**</code> <a data-sourcepos="8363:19-8363:48" href="@">can close strong emphasis</a> -iff it is part of a [right-flanking delimiter run].</p> -</li> -<li data-sourcepos="8366:1-8371:0"> -<p data-sourcepos="8366:5-8370:28">A double <code data-sourcepos="8366:15-8366:16">__</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="8372:1-8381:0"> -<p data-sourcepos="8372:5-8380: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 data-sourcepos="8374:17-8374:17">_</code> or <code data-sourcepos="8374:24-8374:24">*</code>) as the opening delimiter. The -opening and closing delimiters must belong to separate -[delimiter runs]. If one of the delimiters can both -open and close emphasis, then the sum of the lengths of 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="8382:1-8392:0"> -<p data-sourcepos="8382:5-8391: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 data-sourcepos="8385:7-8385:7">_</code> or <code data-sourcepos="8385:14-8385:14">*</code>) as the opening delimiter. The -opening and closing delimiters must belong to separate -[delimiter runs]. If one of the delimiters can both open -and close strong emphasis, then the sum of the lengths of -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="8393:1-8396:0"> -<p data-sourcepos="8393:5-8395:25">A literal <code data-sourcepos="8393:16-8393:16">*</code> character cannot occur at the beginning or end of -<code data-sourcepos="8394:6-8394:6">*</code>-delimited emphasis or <code data-sourcepos="8394:32-8394:33">**</code>-delimited strong emphasis, unless it -is backslash-escaped.</p> -</li> -<li data-sourcepos="8397:1-8400:0"> -<p data-sourcepos="8397:5-8399:25">A literal <code data-sourcepos="8397:16-8397:16">_</code> character cannot occur at the beginning or end of -<code data-sourcepos="8398:6-8398:6">_</code>-delimited emphasis or <code data-sourcepos="8398:32-8398:33">__</code>-delimited strong emphasis, unless it -is backslash-escaped.</p> -</li> -</ol> -<p data-sourcepos="8401:1-8402:43" dir="auto">Where rules 1--12 above are compatible with multiple parsings, -the following principles resolve ambiguity:</p> -<ol data-sourcepos="8404:1-8429:0" start="13" dir="auto"> -<li data-sourcepos="8404:1-8407:0"> -<p data-sourcepos="8404:5-8406:28">The number of nestings should be minimized. Thus, for example, -an interpretation <code data-sourcepos="8405:24-8405:43"><strong>...</strong></code> is always preferred to -<code data-sourcepos="8406:6-8406:26"><em><em>...</em></em></code>.</p> -</li> -<li data-sourcepos="8408:1-8410:0"> -<p data-sourcepos="8408:5-8409:49">An interpretation <code data-sourcepos="8408:24-8408:52"><em><strong>...</strong></em></code> is always -preferred to <code data-sourcepos="8409:19-8409:47"><strong><em>...</em></strong></code>.</p> -</li> -<li data-sourcepos="8411:1-8416:0"> -<p data-sourcepos="8411:5-8415: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 data-sourcepos="8414:6-8414:20">*foo _bar* baz_</code> is parsed as <code data-sourcepos="8414:37-8414:58"><em>foo _bar</em> baz_</code> rather -than <code data-sourcepos="8415:11-8415:32">*foo <em>bar* baz</em></code>.</p> -</li> -<li data-sourcepos="8417:1-8422:0"> -<p data-sourcepos="8417:5-8421: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 data-sourcepos="8420:6-8420:22">**foo **bar baz**</code> is parsed as <code data-sourcepos="8420:39-8420:68">**foo <strong>bar baz</strong></code> -rather than <code data-sourcepos="8421:18-8421:47"><strong>foo **bar baz</strong></code>.</p> -</li> -<li data-sourcepos="8423:1-8429:0"> -<p data-sourcepos="8423:5-8428: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 data-sourcepos="8426:46-8426:57">*[foo*](bar)</code> is -parsed as <code data-sourcepos="8427:16-8427:38">*<a href="bar">foo*</a></code> rather than as -<code data-sourcepos="8428:6-8428:24"><em>[foo</em>](bar)</code>.</p> -</li> -</ol> -<p data-sourcepos="8430:1-8430:60" dir="auto">These rules can be illustrated through a series of examples.</p> -<p data-sourcepos="8432:1-8432:7" dir="auto">Rule 1:</p> -<div> -<div><a href="#example-360">Example 360</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8437:1-8439:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8441:1-8443:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="8447:1-8448:66" dir="auto">This is not emphasis, because the opening <code data-sourcepos="8447:44-8447:44">*</code> is followed by -whitespace, and hence not part of a [left-flanking delimiter run]:</p> -<div> -<div><a href="#example-361">Example 361</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8453:1-8455:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">a * foo bar*</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8457:1-8459:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>a * foo bar*</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="8463:1-8465:44" dir="auto">This is not emphasis, because the opening <code data-sourcepos="8463:44-8463:44">*</code> is preceded -by an alphanumeric and followed by punctuation, and hence -not part of a [left-flanking delimiter run]:</p> -<div> -<div><a href="#example-362">Example 362</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8470:1-8472:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8474:1-8476:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="8480:1-8480:52" dir="auto">Unicode nonbreaking spaces count as whitespace, too:</p> -<div> -<div><a href="#example-363">Example 363</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8485:1-8487:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8489:1-8491:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>* a *</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="8495:1-8495:41" dir="auto">Intraword emphasis with <code data-sourcepos="8495:26-8495:26">*</code> is permitted:</p> -<div> -<div><a href="#example-364">Example 364</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8500:1-8502:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8504:1-8506:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-365">Example 365</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8513:1-8515:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8517:1-8519:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="8523:1-8523:7" dir="auto">Rule 2:</p> -<div> -<div><a href="#example-366">Example 366</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8528:1-8530:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8532:1-8534:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="8538:1-8539:11" dir="auto">This is not emphasis, because the opening <code data-sourcepos="8538:44-8538:44">_</code> is followed by -whitespace:</p> -<div> -<div><a href="#example-367">Example 367</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8544:1-8546:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8548:1-8550:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_ foo bar_</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="8554:1-8555:47" dir="auto">This is not emphasis, because the opening <code data-sourcepos="8554:44-8554:44">_</code> is preceded -by an alphanumeric and followed by punctuation:</p> -<div> -<div><a href="#example-368">Example 368</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8560:1-8562:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8564:1-8566:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="8570:1-8570:46" dir="auto">Emphasis with <code data-sourcepos="8570:16-8570:16">_</code> is not allowed inside words:</p> -<div> -<div><a href="#example-369">Example 369</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8575:1-8577:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8579:1-8581:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo_bar_</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-370">Example 370</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8588:1-8590:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8592:1-8594:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-371">Example 371</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8601:1-8603:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8605:1-8607:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>приÑтанÑм_ÑтремÑÑ‚ÑÑ_</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="8611:1-8612:47" dir="auto">Here <code data-sourcepos="8611:7-8611:7">_</code> does not generate emphasis, because the first delimiter run -is right-flanking and the second left-flanking:</p> -<div> -<div><a href="#example-372">Example 372</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8617:1-8619:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8621:1-8623:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="8627:1-8629: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> -<div><a href="#example-373">Example 373</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8634:1-8636:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8638:1-8640:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="8644:1-8644:7" dir="auto">Rule 3:</p> -<p data-sourcepos="8646:1-8647:32" dir="auto">This is not emphasis, because the closing delimiter does -not match the opening delimiter:</p> -<div> -<div><a href="#example-374">Example 374</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8652:1-8654:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8656:1-8658:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_foo*</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="8662:1-8663:11" dir="auto">This is not emphasis, because the closing <code data-sourcepos="8662:44-8662:44">*</code> is preceded by -whitespace:</p> -<div> -<div><a href="#example-375">Example 375</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8668:1-8670:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8672:1-8674:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*foo bar *</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="8678:1-8678:36" dir="auto">A newline also counts as whitespace:</p> -<div> -<div><a href="#example-376">Example 376</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8683:1-8686:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8688:1-8691:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="8695:1-8697:58" dir="auto">This is not emphasis, because the second <code data-sourcepos="8695:43-8695:43">*</code> is -preceded by punctuation and followed by an alphanumeric -(hence it is not part of a [right-flanking delimiter run]:</p> -<div> -<div><a href="#example-377">Example 377</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8702:1-8704:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8706:1-8708:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>*(*foo)</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="8712:1-8713:18" dir="auto">The point of this restriction is more easily appreciated -with this example:</p> -<div> -<div><a href="#example-378">Example 378</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8718:1-8720:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8722:1-8724:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="8728:1-8728:39" dir="auto">Intraword emphasis with <code data-sourcepos="8728:26-8728:26">*</code> is allowed:</p> -<div> -<div><a href="#example-379">Example 379</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8733:1-8735:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8737:1-8739:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="8744:1-8744:7" dir="auto">Rule 4:</p> -<p data-sourcepos="8746:1-8747:11" dir="auto">This is not emphasis, because the closing <code data-sourcepos="8746:44-8746:44">_</code> is preceded by -whitespace:</p> -<div> -<div><a href="#example-380">Example 380</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8752:1-8754:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8756:1-8758:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_foo bar _</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="8762:1-8763:56" dir="auto">This is not emphasis, because the second <code data-sourcepos="8762:43-8762:43">_</code> is -preceded by punctuation and followed by an alphanumeric:</p> -<div> -<div><a href="#example-381">Example 381</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8768:1-8770:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8772:1-8774:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_(_foo)</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="8778:1-8778:33" dir="auto">This is emphasis within emphasis:</p> -<div> -<div><a href="#example-382">Example 382</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8783:1-8785:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8787:1-8789:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="8793:1-8793:41" dir="auto">Intraword emphasis is disallowed for <code data-sourcepos="8793:39-8793:39">_</code>:</p> -<div> -<div><a href="#example-383">Example 383</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8798:1-8800:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8802:1-8804:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_foo_bar</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-384">Example 384</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8811:1-8813:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8815:1-8817:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>_приÑтанÑм_ÑтремÑÑ‚ÑÑ</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-385">Example 385</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8824:1-8826:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8828:1-8830:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="8834:1-8836: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> -<div><a href="#example-386">Example 386</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8841:1-8843:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8845:1-8847:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><em>(bar)</em>.</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="8851:1-8851:7" dir="auto">Rule 5:</p> -<div> -<div><a href="#example-387">Example 387</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8856:1-8858:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8860:1-8862:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="8866:1-8867:23" dir="auto">This is not strong emphasis, because the opening delimiter is -followed by whitespace:</p> -<div> -<div><a href="#example-388">Example 388</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8872:1-8874:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8876:1-8878:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>** foo bar**</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="8882:1-8884:44" dir="auto">This is not strong emphasis, because the opening <code data-sourcepos="8882:51-8882:52">**</code> is preceded -by an alphanumeric and followed by punctuation, and hence -not part of a [left-flanking delimiter run]:</p> -<div> -<div><a href="#example-389">Example 389</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8889:1-8891:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8893:1-8895:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="8899:1-8899:49" dir="auto">Intraword strong emphasis with <code data-sourcepos="8899:33-8899:34">**</code> is permitted:</p> -<div> -<div><a href="#example-390">Example 390</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8904:1-8906:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8908:1-8910:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="8914:1-8914:7" dir="auto">Rule 6:</p> -<div> -<div><a href="#example-391">Example 391</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8919:1-8921:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8923:1-8925:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="8929:1-8930:23" dir="auto">This is not strong emphasis, because the opening delimiter is -followed by whitespace:</p> -<div> -<div><a href="#example-392">Example 392</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8935:1-8937:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8939:1-8941:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__ foo bar__</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="8945:1-8945:31" dir="auto">A newline counts as whitespace:</p> -<div> -<div><a href="#example-393">Example 393</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8949:1-8952:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8954:1-8957:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="8961:1-8962:47" dir="auto">This is not strong emphasis, because the opening <code data-sourcepos="8961:51-8961:52">__</code> is preceded -by an alphanumeric and followed by punctuation:</p> -<div> -<div><a href="#example-394">Example 394</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8967:1-8969:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8971:1-8973:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="8977:1-8977:49" dir="auto">Intraword strong emphasis is forbidden with <code data-sourcepos="8977:46-8977:47">__</code>:</p> -<div> -<div><a href="#example-395">Example 395</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8982:1-8984:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8986:1-8988:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo__bar__</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-396">Example 396</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="8995:1-8997:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="8999:1-9001:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-397">Example 397</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9008:1-9010:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9012:1-9014:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>приÑтанÑм__ÑтремÑÑ‚ÑÑ__</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-398">Example 398</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9021:1-9023:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9025:1-9027:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="9031:1-9033: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> -<div><a href="#example-399">Example 399</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9038:1-9040:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9042:1-9044:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="9049:1-9049:7" dir="auto">Rule 7:</p> -<p data-sourcepos="9051:1-9052:14" dir="auto">This is not strong emphasis, because the closing delimiter is preceded -by whitespace:</p> -<div> -<div><a href="#example-400">Example 400</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9057:1-9059:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9061:1-9063:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>**foo bar **</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="9067:1-9068:9" dir="auto">(Nor can it be interpreted as an emphasized <code data-sourcepos="9067:46-9067:55">*foo bar *</code>, because of -Rule 11.)</p> -<p data-sourcepos="9070:1-9071:56" dir="auto">This is not strong emphasis, because the second <code data-sourcepos="9070:50-9070:51">**</code> is -preceded by punctuation and followed by an alphanumeric:</p> -<div> -<div><a href="#example-401">Example 401</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9076:1-9078:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9080:1-9082:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>**(**foo)</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="9086:1-9087:20" dir="auto">The point of this restriction is more easily appreciated -with these examples:</p> -<div> -<div><a href="#example-402">Example 402</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9092:1-9094:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9096:1-9098:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-403">Example 403</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9105:1-9108:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9110:1-9113:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-404">Example 404</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9120:1-9122:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9124:1-9126:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="9130:1-9130:19" dir="auto">Intraword emphasis:</p> -<div> -<div><a href="#example-405">Example 405</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9135:1-9137:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9139:1-9141:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="9145:1-9145:7" dir="auto">Rule 8:</p> -<p data-sourcepos="9147:1-9148:23" dir="auto">This is not strong emphasis, because the closing delimiter is -preceded by whitespace:</p> -<div> -<div><a href="#example-406">Example 406</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9153:1-9155:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9157:1-9159:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__foo bar __</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="9163:1-9164:56" dir="auto">This is not strong emphasis, because the second <code data-sourcepos="9163:50-9163:51">__</code> is -preceded by punctuation and followed by an alphanumeric:</p> -<div> -<div><a href="#example-407">Example 407</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9169:1-9171:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9173:1-9175:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__(__foo)</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="9179:1-9180:18" dir="auto">The point of this restriction is more easily appreciated -with this example:</p> -<div> -<div><a href="#example-408">Example 408</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9185:1-9187:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9189:1-9191:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="9195:1-9195:49" dir="auto">Intraword strong emphasis is forbidden with <code data-sourcepos="9195:46-9195:47">__</code>:</p> -<div> -<div><a href="#example-409">Example 409</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9200:1-9202:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9204:1-9206:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__foo__bar</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-410">Example 410</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9213:1-9215:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9217:1-9219:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__приÑтанÑм__ÑтремÑÑ‚ÑÑ</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-411">Example 411</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9226:1-9228:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9230:1-9232:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="9236:1-9238: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> -<div><a href="#example-412">Example 412</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9243:1-9245:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9247:1-9249:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><strong>(bar)</strong>.</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="9253:1-9253:7" dir="auto">Rule 9:</p> -<p data-sourcepos="9255:1-9256:16" dir="auto">Any nonempty sequence of inline elements can be the contents of an -emphasized span.</p> -<div> -<div><a href="#example-413">Example 413</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9261:1-9263:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9265:1-9267:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-414">Example 414</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9274:1-9277:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9279:1-9282:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="9286:1-9287:16" dir="auto">In particular, emphasis and strong emphasis can be nested -inside emphasis:</p> -<div> -<div><a href="#example-415">Example 415</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9292:1-9294:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9296:1-9298:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-416">Example 416</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9305:1-9307:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9309:1-9311:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-417">Example 417</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9318:1-9320:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9322:1-9324:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<div> -<div><a href="#example-418">Example 418</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9331:1-9333:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9335:1-9337:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-419">Example 419</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9344:1-9346:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9348:1-9350:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-420">Example 420</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9356:1-9358:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9360:1-9362:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="9365:1-9365: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="9367:1-9369:3" data-canonical-lang="markdown" class="code highlight js-syntax-highlight language-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="9372:1-9377:32" dir="auto">is precluded by the condition that a delimiter that -can both open and close (like the <code data-sourcepos="9373:36-9373:36">*</code> after <code data-sourcepos="9373:46-9373:48">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="9380:1-9381:34" dir="auto">For the same reason, we don't get two consecutive -emphasis sections in this example:</p> -<div> -<div><a href="#example-421">Example 421</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9386:1-9388:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9390:1-9392:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="9396:1-9399: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> -<div><a href="#example-422">Example 422</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9405:1-9407:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9409:1-9411:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-423">Example 423</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9418:1-9420:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9422:1-9424:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<div> -<div><a href="#example-424">Example 424</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9431:1-9433:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9435:1-9437:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="9441:1-9443:34" dir="auto">When the lengths of the interior closing and opening -delimiter runs are <em data-sourcepos="9442:20-9442:25">both</em> multiples of 3, though, -they can match to create emphasis:</p> -<div> -<div><a href="#example-425">Example 425</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9448:1-9450:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9452:1-9454:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-426">Example 426</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9460:1-9462:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9464:1-9466:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="9470:1-9470:42" dir="auto">Indefinite levels of nesting are possible:</p> -<div> -<div><a href="#example-427">Example 427</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9475:1-9477:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9479:1-9481:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<div> -<div><a href="#example-428">Example 428</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9488:1-9490:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9492:1-9494:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="9498:1-9498:50" dir="auto">There can be no empty emphasis or strong emphasis:</p> -<div> -<div><a href="#example-429">Example 429</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9503:1-9505:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9507:1-9509:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-430">Example 430</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9516:1-9518:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9520:1-9522:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="9527:1-9527:8" dir="auto">Rule 10:</p> -<p data-sourcepos="9529:1-9530:25" dir="auto">Any nonempty sequence of inline elements can be the contents of an -strongly emphasized span.</p> -<div> -<div><a href="#example-431">Example 431</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9535:1-9537:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9539:1-9541:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<div> -<div><a href="#example-432">Example 432</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9548:1-9551:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9553:1-9556:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="9560:1-9561:23" dir="auto">In particular, emphasis and strong emphasis can be nested -inside strong emphasis:</p> -<div> -<div><a href="#example-433">Example 433</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9566:1-9568:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9570:1-9572:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-434">Example 434</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9579:1-9581:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9583:1-9585:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-435">Example 435</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9592:1-9594:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9596:1-9598:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-436">Example 436</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9605:1-9607:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9609:1-9611:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-437">Example 437</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9618:1-9620:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9622:1-9624:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-438">Example 438</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9631:1-9633:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9635:1-9637:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-439">Example 439</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9644:1-9646:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9648:1-9650:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-440">Example 440</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9657:1-9659:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9661:1-9663:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="9667:1-9667:42" dir="auto">Indefinite levels of nesting are possible:</p> -<div> -<div><a href="#example-441">Example 441</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9672:1-9675:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9677:1-9680:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-442">Example 442</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9687:1-9689:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9691:1-9693:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="9697:1-9697:50" dir="auto">There can be no empty emphasis or strong emphasis:</p> -<div> -<div><a href="#example-443">Example 443</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9702:1-9704:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9706:1-9708:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-444">Example 444</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9715:1-9717:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9719:1-9721:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="9726:1-9726:8" dir="auto">Rule 11:</p> -<div> -<div><a href="#example-445">Example 445</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9731:1-9733:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9735:1-9737:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo ***</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-446">Example 446</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9744:1-9746:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9748:1-9750:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-447">Example 447</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9757:1-9759:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9761:1-9763:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-448">Example 448</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9770:1-9772:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9774:1-9776:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo *****</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-449">Example 449</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9783:1-9785:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9787:1-9789:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-450">Example 450</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9796:1-9798:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9800:1-9802:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="9806:1-9808:32" dir="auto">Note that when delimiters do not match evenly, Rule 11 determines -that the excess literal <code data-sourcepos="9807:26-9807:26">*</code> characters will appear outside of the -emphasis, rather than inside it:</p> -<div> -<div><a href="#example-451">Example 451</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9813:1-9815:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9817:1-9819:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-452">Example 452</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9826:1-9828:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9830:1-9832:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-453">Example 453</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9839:1-9841:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9843:1-9845:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-454">Example 454</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9852:1-9854:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9856:1-9858:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-455">Example 455</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9865:1-9867:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9869:1-9871:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-456">Example 456</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9878:1-9880:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9882:1-9884:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="9889:1-9889:8" dir="auto">Rule 12:</p> -<div> -<div><a href="#example-457">Example 457</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9894:1-9896:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9898:1-9900:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo ___</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-458">Example 458</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9907:1-9909:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9911:1-9913:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-459">Example 459</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9920:1-9922:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9924:1-9926:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-460">Example 460</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9933:1-9935:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9937:1-9939:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo _____</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-461">Example 461</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9946:1-9948:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9950:1-9952:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-462">Example 462</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9959:1-9961:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9963:1-9965:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-463">Example 463</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9972:1-9974:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9976:1-9978:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="9982:1-9984:32" dir="auto">Note that when delimiters do not match evenly, Rule 12 determines -that the excess literal <code data-sourcepos="9983:26-9983:26">_</code> characters will appear outside of the -emphasis, rather than inside it:</p> -<div> -<div><a href="#example-464">Example 464</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="9989:1-9991:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="9993:1-9995:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-465">Example 465</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10002:1-10004:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10006:1-10008:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-466">Example 466</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10015:1-10017:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10019:1-10021:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-467">Example 467</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10028:1-10030:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10032:1-10034:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-468">Example 468</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10041:1-10043:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10045:1-10047:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="10051:1-10052:44" dir="auto">Rule 13 implies that if you want emphasis nested directly inside -emphasis, you must use different delimiters:</p> -<div> -<div><a href="#example-469">Example 469</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10057:1-10059:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10061:1-10063:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-470">Example 470</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10070:1-10072:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10074:1-10076:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-471">Example 471</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10083:1-10085:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10087:1-10089:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-472">Example 472</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10096:1-10098:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10100:1-10102:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="10106:1-10107:21" dir="auto">However, strong emphasis within strong emphasis is possible without -switching delimiters:</p> -<div> -<div><a href="#example-473">Example 473</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10112:1-10114:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10116:1-10118:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-474">Example 474</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10125:1-10127:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10129:1-10131:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="10136:1-10137:11" dir="auto">Rule 13 can be applied to arbitrarily long sequences of -delimiters:</p> -<div> -<div><a href="#example-475">Example 475</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10142:1-10144:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10146:1-10148:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10152:1-10152:8" dir="auto">Rule 14:</p> -<div> -<div><a href="#example-476">Example 476</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10157:1-10159:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10161:1-10163:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-477">Example 477</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10170:1-10172:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10174:1-10176:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10180:1-10180:8" dir="auto">Rule 15:</p> -<div> -<div><a href="#example-478">Example 478</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10185:1-10187:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10189:1-10191:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<div> -<div><a href="#example-479">Example 479</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10198:1-10200:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10202:1-10204:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10208:1-10208:8" dir="auto">Rule 16:</p> -<div> -<div><a href="#example-480">Example 480</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10213:1-10215:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10217:1-10219:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-481">Example 481</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10226:1-10228:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10230:1-10232:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10236:1-10236:8" dir="auto">Rule 17:</p> -<div> -<div><a href="#example-482">Example 482</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10241:1-10243:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10245:1-10247:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-483">Example 483</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10254:1-10256:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10258:1-10260:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-484">Example 484</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10267:1-10269:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10271:1-10273:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-485">Example 485</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10280:1-10282:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10284:1-10286:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>**<a href="**"></p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-486">Example 486</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10293:1-10295:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10297:1-10299:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>__<a href="__"></p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-487">Example 487</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10306:1-10308:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10310:1-10312:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-488">Example 488</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10319:1-10321:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10323:1-10325:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-489">Example 489</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10332:1-10334:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10336:1-10338:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-490">Example 490</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10345:1-10347:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10349:1-10351:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<h2 data-sourcepos="10357:1-10357:28"> -<a href="#strikethrough-extension" aria-hidden="true" class="anchor" id="user-content-strikethrough-extension"></a>Strikethrough (extension)</h2> -<p data-sourcepos="10359:1-10360:10">GFM enables the <code data-sourcepos="10359:18-10359:30">strikethrough</code> extension, where an additional emphasis type is -available.</p> -<p data-sourcepos="10362:1-10362:59">Strikethrough text is any text wrapped in two tildes (<code data-sourcepos="10362:56-10362:56">~</code>).</p> -<div> -<div><a href="#example-491">Example 491</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10367:1-10369:32" data-canonical-lang="example" data-lang-params="strikethrough" class="code highlight js-syntax-highlight language-plaintext" 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="10371:1-10373:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10376:1-10377:17">As with regular emphasis delimiters, a new paragraph will cause strikethrough -parsing to cease:</p> -<div> -<div><a href="#example-492">Example 492</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10382:1-10386:32" data-canonical-lang="example" data-lang-params="strikethrough" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10388:1-10391:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -</div> -<h2 data-sourcepos="10396:1-10396:8" dir="auto"> -<a href="#links" aria-hidden="true" class="anchor" id="user-content-links"></a>Links</h2> -<p data-sourcepos="10398:1-10403: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="10405:1-10407:22" dir="auto">A <a data-sourcepos="10405:3-10405:16" href="@">link text</a> consists of a sequence of zero or more -inline elements enclosed by square brackets (<code data-sourcepos="10406:47-10406:47">[</code> and <code data-sourcepos="10406:55-10406:55">]</code>). The -following rules apply:</p> -<ul data-sourcepos="10409:1-10425:0" dir="auto"> -<li data-sourcepos="10409:1-10412:0"> -<p data-sourcepos="10409:3-10411: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="10413:1-10417:0"> -<p data-sourcepos="10413:3-10416: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 data-sourcepos="10415:25-10415:25">[</code>, a sequence of zero or more inlines, and -a close bracket <code data-sourcepos="10416:20-10416:20">]</code>.</p> -</li> -<li data-sourcepos="10418:1-10422:0"> -<p data-sourcepos="10418:3-10421:25">Backtick [code spans], [autolinks], and raw [HTML tags] bind more tightly -than the brackets in link text. Thus, for example, -<code data-sourcepos="10420:5-10420:13">[foo`]`</code> could not be a link text, since the second <code data-sourcepos="10420:61-10420:61">]</code> -is part of a code span.</p> -</li> -<li data-sourcepos="10423:1-10425:0"> -<p data-sourcepos="10423:3-10424:78">The brackets in link text bind more tightly than markers for -[emphasis and strong emphasis]. Thus, for example, <code data-sourcepos="10424:55-10424:66">*[foo*](url)</code> is a link.</p> -</li> -</ul> -<p data-sourcepos="10426:1-10426:42" dir="auto">A <a data-sourcepos="10426:3-10426:23" href="@">link destination</a> consists of either</p> -<ul data-sourcepos="10428:1-10439:0" dir="auto"> -<li data-sourcepos="10428:1-10431:0"> -<p data-sourcepos="10428:3-10430:27">a sequence of zero or more characters between an opening <code data-sourcepos="10428:61-10428:61"><</code> and a -closing <code data-sourcepos="10429:12-10429:12">></code> that contains no line breaks or unescaped -<code data-sourcepos="10430:4-10430:4"><</code> or <code data-sourcepos="10430:11-10430:11">></code> characters, or</p> -</li> -<li data-sourcepos="10432:1-10439:0"> -<p data-sourcepos="10432:3-10438:23">a nonempty sequence of characters that does not start with -<code data-sourcepos="10433:4-10433:4"><</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. -(Implementations may impose limits on parentheses nesting to -avoid performance issues, but at least three levels of nesting -should be supported.)</p> -</li> -</ul> -<p data-sourcepos="10440:1-10440:37" dir="auto">A <a data-sourcepos="10440:3-10440:17" href="@">link title</a> consists of either</p> -<ul data-sourcepos="10442:1-10453:0" dir="auto"> -<li data-sourcepos="10442:1-10445:0"> -<p data-sourcepos="10442:3-10444:23">a sequence of zero or more characters between straight double-quote -characters (<code data-sourcepos="10443:16-10443:16">"</code>), including a <code data-sourcepos="10443:34-10443:34">"</code> character only if it is -backslash-escaped, or</p> -</li> -<li data-sourcepos="10446:1-10449:0"> -<p data-sourcepos="10446:3-10448:23">a sequence of zero or more characters between straight single-quote -characters (<code data-sourcepos="10447:16-10447:16">'</code>), including a <code data-sourcepos="10447:34-10447:34">'</code> character only if it is -backslash-escaped, or</p> -</li> -<li data-sourcepos="10450:1-10453:0"> -<p data-sourcepos="10450:3-10452:20">a sequence of zero or more characters between matching parentheses -(<code data-sourcepos="10451:5-10451:9">(...)</code>), including a <code data-sourcepos="10451:27-10451:27">(</code> or <code data-sourcepos="10451:34-10451:34">)</code> character only if it is -backslash-escaped.</p> -</li> -</ul> -<p data-sourcepos="10454:1-10455:15" dir="auto">Although [link titles] may span multiple lines, they may not contain -a [blank line].</p> -<p data-sourcepos="10457:1-10467:6" dir="auto">An <a data-sourcepos="10457:4-10457:19" href="@">inline link</a> consists of a [link text] followed immediately -by a left parenthesis <code data-sourcepos="10458:24-10458:24">(</code>, optional [whitespace], an optional -[link destination], an optional [link title] separated from the link -destination by [whitespace], optional [whitespace], and a right -parenthesis <code data-sourcepos="10461:14-10461:14">)</code>. The link's text consists of the inlines contained -in the [link text] (excluding the enclosing square brackets). -The link's URI consists of the link destination, excluding enclosing -<code data-sourcepos="10464:2-10464:6"><...></code> if present, with backslash-escapes in effect as described -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="10469:1-10469:29" dir="auto">Here is a simple inline link:</p> -<div> -<div><a href="#example-493">Example 493</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10474:1-10476:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/uri "title")</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10478:1-10480:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10484:1-10484:25" dir="auto">The title may be omitted:</p> -<div> -<div><a href="#example-494">Example 494</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10489:1-10491:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10493:1-10495:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10499:1-10499:50" dir="auto">Both the title and the destination may be omitted:</p> -<div> -<div><a href="#example-495">Example 495</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10504:1-10506:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10508:1-10510:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-496">Example 496</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10517:1-10519:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10521:1-10523:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="10526:1-10527:28" dir="auto">The destination can only contain spaces if it is -enclosed in pointy brackets:</p> -<div> -<div><a href="#example-497">Example 497</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10532:1-10534:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10536:1-10538:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-498">Example 498</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10544:1-10546:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10548:1-10550:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10553:1-10554:36" dir="auto">The destination cannot contain line breaks, -even if enclosed in pointy brackets:</p> -<div> -<div><a href="#example-499">Example 499</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10559:1-10562:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10564:1-10567:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-500">Example 500</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10573:1-10576:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10578:1-10581:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="10584:1-10585:19" dir="auto">The destination can contain <code data-sourcepos="10584:30-10584:30">)</code> if it is enclosed -in pointy brackets:</p> -<div> -<div><a href="#example-501">Example 501</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10590:1-10592:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10594:1-10596:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10599:1-10599:53" dir="auto">Pointy brackets that enclose links must be unescaped:</p> -<div> -<div><a href="#example-502">Example 502</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10604:1-10606:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](<foo\>)</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10608:1-10610:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10613:1-10614:24" dir="auto">These are not links, because the opening pointy bracket -is not matched properly:</p> -<div> -<div><a href="#example-503">Example 503</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10619:1-10623:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10625:1-10629:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10632:1-10632:55" dir="auto">Parentheses inside the link destination may be escaped:</p> -<div> -<div><a href="#example-504">Example 504</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10637:1-10639:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](\(foo\))</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" 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> -</div> -<p data-sourcepos="10646:1-10647:9" dir="auto">Any number of parentheses are allowed without escaping, as long as they are -balanced:</p> -<div> -<div><a href="#example-505">Example 505</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10652:1-10654:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10656:1-10658:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10661:1-10662:13" dir="auto">However, if you have unbalanced parentheses, you need to escape or use the -<code data-sourcepos="10662:2-10662:6"><...></code> form:</p> -<div> -<div><a href="#example-506">Example 506</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10667:1-10669:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10671:1-10673:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<div> -<div><a href="#example-507">Example 507</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10680:1-10682:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10684:1-10686:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10690:1-10691:12" dir="auto">Parentheses and other symbols can also be escaped, as usual -in Markdown:</p> -<div> -<div><a href="#example-508">Example 508</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10696:1-10698:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](foo\)\:)</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10700:1-10702:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10706:1-10706:52" dir="auto">A link can contain fragment identifiers and queries:</p> -<div> -<div><a href="#example-509">Example 509</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10711:1-10717:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10719:1-10723:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10727:1-10728:17" dir="auto">Note that a backslash before a non-escapable character is -just a backslash:</p> -<div> -<div><a href="#example-510">Example 510</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10733:1-10735:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](foo\bar)</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10737:1-10739:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10743:1-10750: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 -be optionally URL-escaped when written as HTML, but this spec -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> -<div><a href="#example-511">Example 511</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10755:1-10757:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10759:1-10761:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10765:1-10767: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> -<div><a href="#example-512">Example 512</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10772:1-10774:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link]("title")</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10776:1-10778:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10782:1-10782:62" dir="auto">Titles may be in single quotes, double quotes, or parentheses:</p> -<div> -<div><a href="#example-513">Example 513</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10787:1-10791:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10793:1-10797:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10801:1-10802:22" dir="auto">Backslash escapes and entity and numeric character references -may be used in titles:</p> -<div> -<div><a href="#example-514">Example 514</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10807:1-10809:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[link](/url "title \"&quot;")</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10811:1-10813:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10817:1-10818: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> -<div><a href="#example-515">Example 515</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10823:1-10825:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10827:1-10829:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10833:1-10833:56" dir="auto">Nested balanced quotes are not allowed without escaping:</p> -<div> -<div><a href="#example-516">Example 516</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10838:1-10840:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10842:1-10844:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10848:1-10848:67" dir="auto">But it is easy to work around this by using a different quote type:</p> -<div> -<div><a href="#example-517">Example 517</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10853:1-10855:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10857:1-10859:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10863:1-10876:61" dir="auto">(Note: <code data-sourcepos="10863:10-10863:20">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, -entity and numeric character references, or using a different -quote type for the enclosing title---to write titles containing -double quotes. <code data-sourcepos="10869:18-10869:28">Markdown.pl</code>'s handling of titles has a number -of other strange features. For example, it allows single-quoted -titles in inline links, but not reference links. And, in -reference links but not inline links, it allows a title to begin -with <code data-sourcepos="10873:7-10873:7">"</code> and end with <code data-sourcepos="10873:24-10873:24">)</code>. <code data-sourcepos="10873:30-10873:40">Markdown.pl</code> 1.0.1 even allows -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="10878:1-10878:57" dir="auto">[Whitespace] is allowed around the destination and title:</p> -<div> -<div><a href="#example-518">Example 518</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10883:1-10886:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10888:1-10890:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10894:1-10895:22" dir="auto">But it is not allowed between the link text and the -following parenthesis:</p> -<div> -<div><a href="#example-519">Example 519</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10900:1-10902:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10904:1-10906:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[link] (/uri)</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="10910:1-10911:24" dir="auto">The link text may contain balanced brackets, but not unbalanced ones, -unless they are escaped:</p> -<div> -<div><a href="#example-520">Example 520</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10916:1-10918:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10920:1-10922:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-521">Example 521</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10929:1-10931:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10933:1-10935:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-522">Example 522</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10942:1-10944:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10946:1-10948:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-523">Example 523</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10955:1-10957:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10959:1-10961:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10965:1-10965:41" dir="auto">The link text may contain inline content:</p> -<div> -<div><a href="#example-524">Example 524</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10970:1-10972:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="10974:1-10976:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-525">Example 525</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10983:1-10985:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" 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="10987:1-10989:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="10993:1-10993:68" dir="auto">However, links may not contain other links, at any level of nesting.</p> -<div> -<div><a href="#example-526">Example 526</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="10998:1-11000:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[foo [bar](/uri)](/uri)</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11002:1-11004:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-527">Example 527</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11011:1-11013:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11015:1-11017:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-528">Example 528</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11024:1-11026:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">](uri2)](uri3)</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11028:1-11030:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="11034:1-11035:18" dir="auto">These cases illustrate the precedence of link text grouping over -emphasis grouping:</p> -<div> -<div><a href="#example-529">Example 529</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11040:1-11042:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="11044:1-11046:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-530">Example 530</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11053:1-11055:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="11057:1-11059:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="11063:1-11064:11" dir="auto">Note that brackets that <em data-sourcepos="11063:25-11063:32">aren't</em> part of links do not take -precedence:</p> -<div> -<div><a href="#example-531">Example 531</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11069:1-11071:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="11073:1-11075:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="11079:1-11080:33" dir="auto">These cases illustrate the precedence of HTML tags, code spans, -and autolinks over link grouping:</p> -<div> -<div><a href="#example-532">Example 532</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11085:1-11087:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="11089:1-11091:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-533">Example 533</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11098:1-11100:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="11102:1-11104:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-534">Example 534</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11111:1-11113:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="11115:1-11117:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="11121:1-11123:41" dir="auto">There are three kinds of <a data-sourcepos="11121:26-11121:44" href="@">reference link</a>s: -<a data-sourcepos="11122:1-11122:28" href="#full-reference-link">full</a>, <a data-sourcepos="11122:31-11122:68" href="#collapsed-reference-link">collapsed</a>, -and <a data-sourcepos="11123:5-11123:40" href="#shortcut-reference-link">shortcut</a>.</p> -<p data-sourcepos="11125:1-11127:71" dir="auto">A <a data-sourcepos="11125:3-11125:26" 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="11129:1-11135:9" dir="auto">A <a data-sourcepos="11129:3-11129:17" href="@">link label</a> begins with a left bracket (<code data-sourcepos="11129:49-11129:49">[</code>) and ends -with the first right bracket (<code data-sourcepos="11130:32-11130:32">]</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="11137:1-11144:69" dir="auto">One label <a data-sourcepos="11137:11-11137:22" 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 data-sourcepos="11140:13-11140:31">Unicode case fold</em>, strip leading and trailing -[whitespace] and collapse consecutive internal -[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="11146:1-11148: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="11150:1-11150:25" dir="auto">Here is a simple example:</p> -<div> -<div><a href="#example-535">Example 535</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11155:1-11159:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11161:1-11163:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="11167:1-11168:22" dir="auto">The rules for the [link text] are the same as with -[inline links]. Thus:</p> -<p data-sourcepos="11170:1-11171:24" dir="auto">The link text may contain balanced brackets, but not unbalanced ones, -unless they are escaped:</p> -<div> -<div><a href="#example-536">Example 536</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11176:1-11180:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11182:1-11184:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-537">Example 537</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11191:1-11195:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11197:1-11199:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="11203:1-11203:41" dir="auto">The link text may contain inline content:</p> -<div> -<div><a href="#example-538">Example 538</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11208:1-11212:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11214:1-11216:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-539">Example 539</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11223:1-11227:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[][ref]</span> -<span id="LC2" class="line" lang="plaintext"></span> -<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="11229:1-11231:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="11235:1-11235:68" dir="auto">However, links may not contain other links, at any level of nesting.</p> -<div> -<div><a href="#example-540">Example 540</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11240:1-11244:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11246:1-11248:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-541">Example 541</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11255:1-11259:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11261:1-11263:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="11267:1-11268:38" dir="auto">(In the examples above, we have two [shortcut reference links] -instead of one [full reference link].)</p> -<p data-sourcepos="11270:1-11271:18" dir="auto">The following cases illustrate the precedence of link text grouping over -emphasis grouping:</p> -<div> -<div><a href="#example-542">Example 542</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11276:1-11280:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11282:1-11284:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-543">Example 543</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11291:1-11295:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11297:1-11299:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="11303:1-11304:33" dir="auto">These cases illustrate the precedence of HTML tags, code spans, -and autolinks over link grouping:</p> -<div> -<div><a href="#example-544">Example 544</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11309:1-11313:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11315:1-11317:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-545">Example 545</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11324:1-11328:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11330:1-11332:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-546">Example 546</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11339:1-11343:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11345:1-11347:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="11351:1-11351:29" dir="auto">Matching is case-insensitive:</p> -<div> -<div><a href="#example-547">Example 547</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11356:1-11360:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11362:1-11364:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="11368:1-11368:26" dir="auto">Unicode case fold is used:</p> -<div> -<div><a href="#example-548">Example 548</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11373:1-11377:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11379:1-11381:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="11385:1-11386:33" dir="auto">Consecutive internal [whitespace] is treated as one space for -purposes of determining matching:</p> -<div> -<div><a href="#example-549">Example 549</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11391:1-11396:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11398:1-11400:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="11404:1-11405:13" dir="auto">No [whitespace] is allowed between the [link text] and the -[link label]:</p> -<div> -<div><a href="#example-550">Example 550</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11410:1-11414:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11416:1-11418:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-551">Example 551</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11425:1-11430:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11432:1-11435:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="11439:1-11448: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 -this spec) cannot have whitespace after the link text. More -importantly, it prevents inadvertent capture of consecutive -[shortcut reference links]. If whitespace is allowed between the -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="11450:1-11456:3" data-canonical-lang="markdown" class="code highlight js-syntax-highlight language-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="11458:1-11464:20" dir="auto">(Note that [shortcut reference links] were introduced by Gruber -himself in a beta version of <code data-sourcepos="11459:31-11459:41">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="11466:1-11467:18" dir="auto">When there are multiple matching [link reference definitions], -the first is used:</p> -<div> -<div><a href="#example-552">Example 552</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11472:1-11478:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11480:1-11482:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="11486:1-11488: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> -<div><a href="#example-553">Example 553</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11493:1-11497:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11499:1-11501:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[bar][foo!]</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="11505:1-11506:18" dir="auto">[Link labels] cannot contain brackets, unless they are -backslash-escaped:</p> -<div> -<div><a href="#example-554">Example 554</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11511:1-11515:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11517:1-11520:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-555">Example 555</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11527:1-11531:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11533:1-11536:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-556">Example 556</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11543:1-11547:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11549:1-11552:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-557">Example 557</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11559:1-11563:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11565:1-11567:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="11571:1-11571:55" dir="auto">Note that in this example <code data-sourcepos="11571:28-11571:28">]</code> is not backslash-escaped:</p> -<div> -<div><a href="#example-558">Example 558</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11576:1-11580:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11582:1-11584:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="11588:1-11588:68" dir="auto">A [link label] must contain at least one [non-whitespace character]:</p> -<div> -<div><a href="#example-559">Example 559</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11593:1-11597:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11599:1-11602:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-560">Example 560</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11609:1-11615:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11617:1-11622:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="11626:1-11633:40" dir="auto">A <a data-sourcepos="11626:3-11626:31" 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 data-sourcepos="11629:35-11629:36">[]</code>. -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 reference link definition. Thus, -<code data-sourcepos="11633:2-11633:8">[foo][]</code> is equivalent to <code data-sourcepos="11633:29-11633:38">[foo][foo]</code>.</p> -<div> -<div><a href="#example-561">Example 561</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11638:1-11642:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11644:1-11646:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-562">Example 562</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11653:1-11657:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11659:1-11661:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="11665:1-11665:37" dir="auto">The link labels are case-insensitive:</p> -<div> -<div><a href="#example-563">Example 563</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11670:1-11674:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11676:1-11678:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="11683:1-11684:41" dir="auto">As with full reference links, [whitespace] is not -allowed between the two sets of brackets:</p> -<div> -<div><a href="#example-564">Example 564</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11689:1-11694:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11696:1-11699:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="11703:1-11710:41" dir="auto">A <a data-sourcepos="11703:3-11703:30" 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 data-sourcepos="11706:34-11706:35">[]</code> or a link label. -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. -Thus, <code data-sourcepos="11710:8-11710:12">[foo]</code> is equivalent to <code data-sourcepos="11710:33-11710:39">[foo][]</code>.</p> -<div> -<div><a href="#example-565">Example 565</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11715:1-11719:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11721:1-11723:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-566">Example 566</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11730:1-11734:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11736:1-11738:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-567">Example 567</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11745:1-11749:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11751:1-11753:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-568">Example 568</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11760:1-11764:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11766:1-11768:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="11772:1-11772:37" dir="auto">The link labels are case-insensitive:</p> -<div> -<div><a href="#example-569">Example 569</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11777:1-11781:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11783:1-11785:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="11789:1-11789:48" dir="auto">A space after the link text should be preserved:</p> -<div> -<div><a href="#example-570">Example 570</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11794:1-11798:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11800:1-11802:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="11806:1-11807:31" dir="auto">If you just want bracketed text, you can backslash-escape the -opening bracket to avoid links:</p> -<div> -<div><a href="#example-571">Example 571</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11812:1-11816:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11818:1-11820:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>[foo]</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="11824:1-11825:26" dir="auto">Note that this is a link, because a link label ends with the first -following closing bracket:</p> -<div> -<div><a href="#example-572">Example 572</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11830:1-11834:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11836:1-11838:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="11842:1-11843:11" dir="auto">Full and compact references take precedence over shortcut -references:</p> -<div> -<div><a href="#example-573">Example 573</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11848:1-11853:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11855:1-11857:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-574">Example 574</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11863:1-11867:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11869:1-11871:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="11874:1-11874:34" dir="auto">Inline links also take precedence:</p> -<div> -<div><a href="#example-575">Example 575</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11879:1-11883:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11885:1-11887:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-576">Example 576</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11893:1-11897:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11899:1-11901:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="11904:1-11905:23" dir="auto">In the following case <code data-sourcepos="11904:24-11904:33">[bar][baz]</code> is parsed as a reference, -<code data-sourcepos="11905:2-11905:6">[foo]</code> as normal text:</p> -<div> -<div><a href="#example-577">Example 577</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11910:1-11914:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11916:1-11918:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="11922:1-11923:19" dir="auto">Here, though, <code data-sourcepos="11922:16-11922:25">[foo][bar]</code> is parsed as a reference, since -<code data-sourcepos="11923:2-11923:6">[bar]</code> is defined:</p> -<div> -<div><a href="#example-578">Example 578</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11928:1-11933:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11935:1-11937:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="11941:1-11942:65" dir="auto">Here <code data-sourcepos="11941:7-11941:11">[foo]</code> is not parsed as a shortcut reference, because it -is followed by a link label (even though <code data-sourcepos="11942:43-11942:47">[bar]</code> is not defined):</p> -<div> -<div><a href="#example-579">Example 579</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11947:1-11952:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11954:1-11956:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<h2 data-sourcepos="11961:1-11961:9" dir="auto"> -<a href="#images" aria-hidden="true" class="anchor" id="user-content-images"></a>Images</h2> -<p data-sourcepos="11963:1-11971:55" dir="auto">Syntax for images is like the syntax for links, with one -difference. Instead of [link text], we have an -<a data-sourcepos="11965:1-11965:22" href="@">image description</a>. The rules for this are the -same as for [link text], except that (a) an -image description starts with <code data-sourcepos="11967:32-11967:33"></span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11980:1-11982:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-581">Example 581</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11989:1-11993:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="11995:1-11997:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-582">Example 582</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12004:1-12006:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">](/url2)</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12008:1-12010:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-583">Example 583</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12017:1-12019:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">](/url2)</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12021:1-12023:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="12027:1-12032: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 data-sourcepos="12030:50-12030:56">foo bar</code>, not <code data-sourcepos="12030:65-12031:11">foo [bar](/url)</code> or <code data-sourcepos="12031:18-12031:43">foo <a href="/url">bar</a></code>. Only the plain string -content is rendered, without formatting.</p> -<div> -<div><a href="#example-584">Example 584</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12037:1-12041:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12043:1-12045:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-585">Example 585</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12052:1-12056:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12058:1-12060:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-586">Example 586</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12067:1-12069:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="12071:1-12073:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-587">Example 587</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12080:1-12082:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">My </span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12084:1-12086:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<div> -<div><a href="#example-588">Example 588</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12093:1-12095:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="12097:1-12099:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-589">Example 589</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12106:1-12108:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="12110:1-12112:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12116:1-12116:16" dir="auto">Reference-style:</p> -<div> -<div><a href="#example-590">Example 590</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12121:1-12125:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12127:1-12129:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-591">Example 591</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12136:1-12140:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12142:1-12144:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="12148:1-12148:10" dir="auto">Collapsed:</p> -<div> -<div><a href="#example-592">Example 592</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12153:1-12157:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12159:1-12161:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-593">Example 593</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12168:1-12172:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12174:1-12176:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12180:1-12180:32" dir="auto">The labels are case-insensitive:</p> -<div> -<div><a href="#example-594">Example 594</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12185:1-12189:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12191:1-12193:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="12197:1-12198:33" dir="auto">As with reference links, [whitespace] is not allowed -between the two sets of brackets:</p> -<div> -<div><a href="#example-595">Example 595</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12203:1-12208:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12210:1-12213:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12217:1-12217:9" dir="auto">Shortcut:</p> -<div> -<div><a href="#example-596">Example 596</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12222:1-12226:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12228:1-12230:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-597">Example 597</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12237:1-12241:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12243:1-12245:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12249:1-12249:56" dir="auto">Note that link labels cannot contain unescaped brackets:</p> -<div> -<div><a href="#example-598">Example 598</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12254:1-12258:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12260:1-12263:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12267:1-12267:37" dir="auto">The link labels are case-insensitive:</p> -<div> -<div><a href="#example-599">Example 599</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12272:1-12276:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12278:1-12280:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="12284:1-12285:33" dir="auto">If you just want a literal <code data-sourcepos="12284:29-12284:29">!</code> followed by bracketed text, you can -backslash-escape the opening <code data-sourcepos="12285:31-12285:31">[</code>:</p> -<div> -<div><a href="#example-600">Example 600</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12290:1-12294:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12296:1-12298:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>![foo]</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="12302:1-12303:4" dir="auto">If you want a link after a literal <code data-sourcepos="12302:37-12302:37">!</code>, backslash-escape the -<code data-sourcepos="12303:2-12303:2">!</code>:</p> -<div> -<div><a href="#example-601">Example 601</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12308:1-12312:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12314:1-12316:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<h2 data-sourcepos="12320:1-12320:12" dir="auto"> -<a href="#autolinks" aria-hidden="true" class="anchor" id="user-content-autolinks"></a>Autolinks</h2> -<p data-sourcepos="12322:1-12324:18" dir="auto"><a data-sourcepos="12322:1-12322:13" href="@">Autolink</a>s are absolute URIs and email addresses inside -<code data-sourcepos="12323:2-12323:2"><</code> and <code data-sourcepos="12323:10-12323:10">></code>. They are parsed as links, with the URL or email address -as the link label.</p> -<p data-sourcepos="12326:1-12328:52" dir="auto">A <a data-sourcepos="12326:3-12326:19" href="@">URI autolink</a> consists of <code data-sourcepos="12326:34-12326:34"><</code>, followed by an -[absolute URI] followed by <code data-sourcepos="12327:29-12327:29">></code>. It is parsed as -a link to the URI, with the URI as the link's label.</p> -<p data-sourcepos="12330:1-12335:25" dir="auto">An <a data-sourcepos="12330:4-12330:20" href="@">absolute URI</a>, -for these purposes, consists of a [scheme] followed by a colon (<code data-sourcepos="12331:66-12331:66">:</code>) -followed by zero or more characters other than ASCII -[whitespace] and control characters, <code data-sourcepos="12333:39-12333:39"><</code>, and <code data-sourcepos="12333:48-12333:48">></code>. If -the URI includes these characters, they must be percent-encoded -(e.g. <code data-sourcepos="12335:8-12335:10">%20</code> for a space).</p> -<p data-sourcepos="12337:1-12340:37" dir="auto">For purposes of this spec, a <a data-sourcepos="12337:30-12337:40" 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="12342:1-12342:30" dir="auto">Here are some valid autolinks:</p> -<div> -<div><a href="#example-602">Example 602</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12347:1-12349:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="12351:1-12353:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-603">Example 603</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12360:1-12362:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="12364:1-12366:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<div> -<div><a href="#example-604">Example 604</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12373:1-12375:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><irc://foo.bar:2233/baz></span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12377:1-12379:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12383:1-12383:23" dir="auto">Uppercase is also fine:</p> -<div> -<div><a href="#example-605">Example 605</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12388:1-12390:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="12392:1-12394:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12398:1-12401: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> -<div><a href="#example-606">Example 606</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12406:1-12408:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="12410:1-12412:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-607">Example 607</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12419:1-12421:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="12423:1-12425:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-608">Example 608</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12432:1-12434:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="12436:1-12438:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-609">Example 609</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12445:1-12447:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="12449:1-12451:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12455:1-12455:36" dir="auto">Spaces are not allowed in autolinks:</p> -<div> -<div><a href="#example-610">Example 610</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12460:1-12462:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><http://foo.bar/baz bim></span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12464:1-12466:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12470:1-12470:47" dir="auto">Backslash-escapes do not work inside autolinks:</p> -<div> -<div><a href="#example-611">Example 611</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12475:1-12477:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="12479:1-12481:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12485:1-12488:55" dir="auto">An <a data-sourcepos="12485:4-12485:22" href="@">email autolink</a> -consists of <code data-sourcepos="12486:14-12486:14"><</code>, followed by an [email address], -followed by <code data-sourcepos="12487:14-12487:14">></code>. The link's label is the email address, -and the URL is <code data-sourcepos="12488:17-12488:23">mailto:</code> followed by the email address.</p> -<p data-sourcepos="12490:1-12493:83" dir="auto">An <a data-sourcepos="12490:4-12490:21" href="@">email address</a>, -for these purposes, is anything that matches -the <a data-sourcepos="12493:5-12493:82" 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="12495:5-12497:0" class="code highlight js-syntax-highlight language-plaintext" 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="12498:1-12498:28" dir="auto">Examples of email autolinks:</p> -<div> -<div><a href="#example-612">Example 612</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12503:1-12505:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="12507:1-12509:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-613">Example 613</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12516:1-12518:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="12520:1-12522:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12526:1-12526:53" dir="auto">Backslash-escapes do not work inside email autolinks:</p> -<div> -<div><a href="#example-614">Example 614</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12531:1-12533:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="12535:1-12537:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12541:1-12541:24" dir="auto">These are not autolinks:</p> -<div> -<div><a href="#example-615">Example 615</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12546:1-12548:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="12550:1-12552:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>&lt;&gt;</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-616">Example 616</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12559:1-12561:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="12563:1-12565:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-617">Example 617</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12572:1-12574:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="12576:1-12578:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-618">Example 618</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12585:1-12587:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="12589:1-12591:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-619">Example 619</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12598:1-12600:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="12602:1-12604:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-620">Example 620</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12611:1-12613:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="12615:1-12617:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<h2 data-sourcepos="12622:1-12622:24"> -<a href="#autolinks-extension" aria-hidden="true" class="anchor" id="user-content-autolinks-extension"></a>Autolinks (extension)</h2> -<p data-sourcepos="12624:1-12625:29">GFM enables the <code data-sourcepos="12624:18-12624:25">autolink</code> extension, where autolinks will be recognised in a -greater number of conditions.</p> -<p data-sourcepos="12627:1-12631:8">[Autolink]s can also be constructed without requiring the use of <code data-sourcepos="12627:67-12627:67"><</code> and to <code data-sourcepos="12627:78-12627:78">></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 data-sourcepos="12630:64-12630:64">*</code>, <code data-sourcepos="12630:69-12630:69">_</code>, <code data-sourcepos="12630:74-12630:74">~</code>, -and <code data-sourcepos="12631:6-12631:6">(</code>.</p> -<p data-sourcepos="12633:1-12639:73">An <a data-sourcepos="12633:4-12633:29" href="@">extended www autolink</a> will be recognized -when the text <code data-sourcepos="12634:16-12634:19">www.</code> is found followed by a [valid domain]. -A <a data-sourcepos="12635:3-12635:19" href="@">valid domain</a> consists of segments -of alphanumeric characters, underscores (<code data-sourcepos="12636:43-12636:43">_</code>) and hyphens (<code data-sourcepos="12636:61-12636:61">-</code>) -separated by periods (<code data-sourcepos="12637:24-12637:24">.</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="12641:1-12641:49">The scheme <code data-sourcepos="12641:13-12641:16">http</code> will be inserted automatically:</p> -<div> -<div><a href="#example-621">Example 621</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12646:1-12648:32" data-canonical-lang="example" data-lang-params="autolink" class="code highlight js-syntax-highlight language-plaintext" 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="12650:1-12652:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12655:1-12655:77">After a [valid domain], zero or more non-space non-<code data-sourcepos="12655:53-12655:53"><</code> characters may follow:</p> -<div> -<div><a href="#example-622">Example 622</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12660:1-12662:32" data-canonical-lang="example" data-lang-params="autolink" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12664:1-12666:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12669:1-12669:64">We then apply <a data-sourcepos="12669:15-12669:52" href="@">extended autolink path validation</a> as follows:</p> -<p data-sourcepos="12671:1-12673:21">Trailing punctuation (specifically, <code data-sourcepos="12671:38-12671:38">?</code>, <code data-sourcepos="12671:43-12671:43">!</code>, <code data-sourcepos="12671:48-12671:48">.</code>, <code data-sourcepos="12671:53-12671:53">,</code>, <code data-sourcepos="12671:58-12671:58">:</code>, <code data-sourcepos="12671:63-12671:63">*</code>, <code data-sourcepos="12671:68-12671:68">_</code>, and <code data-sourcepos="12671:77-12671:77">~</code>) -will not be considered part of the autolink, though they may be included in the -interior of the link:</p> -<div> -<div><a href="#example-623">Example 623</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12678:1-12682:32" data-canonical-lang="example" data-lang-params="autolink" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12684:1-12687:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12690:1-12693:76">When an autolink ends in <code data-sourcepos="12690:27-12690:27">)</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> -<div><a href="#example-624">Example 624</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12698:1-12706:32" data-canonical-lang="example" data-lang-params="autolink" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12708:1-12713:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12716:1-12718:8">This check is only done when the link ends in a closing parentheses <code data-sourcepos="12716:70-12716:70">)</code>, so if -the only parentheses are in the interior of the autolink, no special rules are -applied:</p> -<div> -<div><a href="#example-625">Example 625</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12723:1-12725:32" data-canonical-lang="example" data-lang-params="autolink" class="code highlight js-syntax-highlight language-plaintext" 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="12727:1-12729:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12732:1-12735:13">If an autolink ends in a semicolon (<code data-sourcepos="12732:38-12732:38">;</code>), we check to see if it appears to -resemble an [entity reference][entity references]; if the preceding text is <code data-sourcepos="12733:78-12733:78">&</code> -followed by one or more alphanumeric characters. If so, it is excluded from -the autolink:</p> -<div> -<div><a href="#example-626">Example 626</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12740:1-12744:32" data-canonical-lang="example" data-lang-params="autolink" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12746:1-12749:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12752:1-12752:33"><code data-sourcepos="12752:2-12752:2"><</code> immediately ends an autolink.</p> -<div> -<div><a href="#example-627">Example 627</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12757:1-12759:32" data-canonical-lang="example" data-lang-params="autolink" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">www.commonmark.org/he<lp</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12761:1-12763:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12766:1-12769:36">An <a data-sourcepos="12766:4-12766:29" href="@">extended url autolink</a> will be recognised when one of the schemes -<code data-sourcepos="12767:2-12767:8">http://</code>, <code data-sourcepos="12767:13-12767:20">https://</code>, or <code data-sourcepos="12767:28-12767:33">ftp://</code>, followed by a [valid domain], then zero or -more non-space non-<code data-sourcepos="12768:21-12768:21"><</code> characters according to -[extended autolink path validation]:</p> -<div> -<div><a href="#example-628">Example 628</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12774:1-12780:32" data-canonical-lang="example" data-lang-params="autolink" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12782:1-12786:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12790:1-12792:20">An <a data-sourcepos="12790:4-12790:31" 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="12794:1-12800:0"> -<li data-sourcepos="12794:1-12794:75">One ore more characters which are alphanumeric, or <code data-sourcepos="12794:55-12794:55">.</code>, <code data-sourcepos="12794:60-12794:60">-</code>, <code data-sourcepos="12794:65-12794:65">_</code>, or <code data-sourcepos="12794:73-12794:73">+</code>.</li> -<li data-sourcepos="12795:1-12795:16">An <code data-sourcepos="12795:7-12795:7">@</code> symbol.</li> -<li data-sourcepos="12796:1-12800:0">One or more characters which are alphanumeric, or <code data-sourcepos="12796:54-12796:54">-</code> or <code data-sourcepos="12796:61-12796:61">_</code>, -separated by periods (<code data-sourcepos="12797:26-12797:26">.</code>). -There must be at least one period. -The last character must not be one of <code data-sourcepos="12799:42-12799:42">-</code> or <code data-sourcepos="12799:49-12799:49">_</code>.</li> -</ul> -<p data-sourcepos="12801:1-12801:71">The scheme <code data-sourcepos="12801:13-12801:19">mailto:</code> will automatically be added to the generated link:</p> -<div> -<div><a href="#example-629">Example 629</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12806:1-12808:32" data-canonical-lang="example" data-lang-params="autolink" class="code highlight js-syntax-highlight language-plaintext" 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="12810:1-12812:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12815:1-12815:44"><code data-sourcepos="12815:2-12815:2">+</code> can occur before the <code data-sourcepos="12815:27-12815:27">@</code>, but not after.</p> -<div> -<div><a href="#example-630">Example 630</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12820:1-12822:32" data-canonical-lang="example" data-lang-params="autolink" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12824:1-12826:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12829:1-12831:12"><code data-sourcepos="12829:2-12829:2">.</code>, <code data-sourcepos="12829:7-12829:7">-</code>, and <code data-sourcepos="12829:16-12829:16">_</code> can occur on both sides of the <code data-sourcepos="12829:51-12829:51">@</code>, but only <code data-sourcepos="12829:65-12829:65">.</code> may occur at -the end of the email address, in which case it will not be considered part of -the address:</p> -<div> -<div><a href="#example-631">Example 631</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12836:1-12844:32" data-canonical-lang="example" data-lang-params="autolink" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12846:1-12851:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<h2 data-sourcepos="12856:1-12856:11" dir="auto"> -<a href="#raw-html" aria-hidden="true" class="anchor" id="user-content-raw-html"></a>Raw HTML</h2> -<p data-sourcepos="12858:1-12861:57" dir="auto">Text between <code data-sourcepos="12858:15-12858:15"><</code> and <code data-sourcepos="12858:23-12858:23">></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="12863:1-12863:29" dir="auto">Here is the grammar for tags:</p> -<p data-sourcepos="12865:1-12867:14" dir="auto">A <a data-sourcepos="12865:3-12865:15" href="@">tag name</a> consists of an ASCII letter -followed by zero or more ASCII letters, digits, or -hyphens (<code data-sourcepos="12867:11-12867:11">-</code>).</p> -<p data-sourcepos="12869:1-12871:32" dir="auto">An <a data-sourcepos="12869:4-12869:17" href="@">attribute</a> consists of [whitespace], -an [attribute name], and an optional -[attribute value specification].</p> -<p data-sourcepos="12873:1-12876:52" dir="auto">An <a data-sourcepos="12873:4-12873:22" href="@">attribute name</a> -consists of an ASCII letter, <code data-sourcepos="12874:31-12874:31">_</code>, or <code data-sourcepos="12874:39-12874:39">:</code>, followed by zero or more ASCII -letters, digits, <code data-sourcepos="12875:19-12875:19">_</code>, <code data-sourcepos="12875:24-12875:24">.</code>, <code data-sourcepos="12875:29-12875:29">:</code>, or <code data-sourcepos="12875:37-12875:37">-</code>. (Note: This is the XML -specification restricted to ASCII. HTML5 is laxer.)</p> -<p data-sourcepos="12878:1-12881:7" dir="auto">An <a data-sourcepos="12878:4-12878:37" href="@">attribute value specification</a> -consists of optional [whitespace], -a <code data-sourcepos="12880:4-12880:4">=</code> character, optional [whitespace], and an [attribute -value].</p> -<p data-sourcepos="12883:1-12885:72" dir="auto">An <a data-sourcepos="12883:4-12883:23" 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="12887:1-12889:60" dir="auto">An <a data-sourcepos="12887:4-12887:32" href="@">unquoted attribute value</a> -is a nonempty string of characters not -including [whitespace], <code data-sourcepos="12889:26-12889:26">"</code>, <code data-sourcepos="12889:31-12889:31">'</code>, <code data-sourcepos="12889:36-12889:36">=</code>, <code data-sourcepos="12889:41-12889:41"><</code>, <code data-sourcepos="12889:46-12889:46">></code>, or <code data-sourcepos="12889:55-12889:57">`</code>.</p> -<p data-sourcepos="12891:1-12893:46" dir="auto">A <a data-sourcepos="12891:3-12891:36" href="@">single-quoted attribute value</a> -consists of <code data-sourcepos="12892:14-12892:14">'</code>, zero or more -characters not including <code data-sourcepos="12893:27-12893:27">'</code>, and a final <code data-sourcepos="12893:44-12893:44">'</code>.</p> -<p data-sourcepos="12895:1-12897:46" dir="auto">A <a data-sourcepos="12895:3-12895:36" href="@">double-quoted attribute value</a> -consists of <code data-sourcepos="12896:14-12896:14">"</code>, zero or more -characters not including <code data-sourcepos="12897:27-12897:27">"</code>, and a final <code data-sourcepos="12897:44-12897:44">"</code>.</p> -<p data-sourcepos="12899:1-12901:31" dir="auto">An <a data-sourcepos="12899:4-12899:16" href="@">open tag</a> consists of a <code data-sourcepos="12899:33-12899:33"><</code> character, a [tag name], -zero or more [attributes], optional [whitespace], an optional <code data-sourcepos="12900:64-12900:64">/</code> -character, and a <code data-sourcepos="12901:19-12901:19">></code> character.</p> -<p data-sourcepos="12903:1-12904:57" dir="auto">A <a data-sourcepos="12903:3-12903:18" href="@">closing tag</a> consists of the string <code data-sourcepos="12903:44-12903:45"></</code>, a -[tag name], optional [whitespace], and the character <code data-sourcepos="12904:55-12904:55">></code>.</p> -<p data-sourcepos="12906:1-12909:63" dir="auto">An <a data-sourcepos="12906:4-12906:20" href="@">HTML comment</a> consists of <code data-sourcepos="12906:35-12906:38"><!--</code> + <em data-sourcepos="12906:43-12906:48">text</em> + <code data-sourcepos="12906:53-12906:55">--></code>, -where <em data-sourcepos="12907:7-12907:12">text</em> does not start with <code data-sourcepos="12907:35-12907:35">></code> or <code data-sourcepos="12907:42-12907:43">-></code>, does not end with <code data-sourcepos="12907:66-12907:66">-</code>, -and does not contain <code data-sourcepos="12908:23-12908:24">--</code>. (See the -<a data-sourcepos="12909:1-12909:61" href="http://www.w3.org/TR/html5/syntax.html#comments" rel="nofollow noreferrer noopener" target="_blank">HTML5 spec</a>.)</p> -<p data-sourcepos="12911:1-12914:5" dir="auto">A <a data-sourcepos="12911:3-12911:29" href="@">processing instruction</a> -consists of the string <code data-sourcepos="12912:25-12912:26"><?</code>, a string -of characters not including the string <code data-sourcepos="12913:41-12913:42">?></code>, and the string -<code data-sourcepos="12914:2-12914:3">?></code>.</p> -<p data-sourcepos="12916:1-12919:37" dir="auto">A <a data-sourcepos="12916:3-12916:18" href="@">declaration</a> consists of the -string <code data-sourcepos="12917:9-12917:10"><!</code>, a name consisting of one or more uppercase ASCII letters, -[whitespace], a string of characters not including the -character <code data-sourcepos="12919:12-12919:12">></code>, and the character <code data-sourcepos="12919:35-12919:35">></code>.</p> -<p data-sourcepos="12921:1-12923:28" dir="auto">A <a data-sourcepos="12921:3-12921:20" href="@">CDATA section</a> consists of -the string <code data-sourcepos="12922:13-12922:21"><![CDATA[</code>, a string of characters not including the string -<code data-sourcepos="12923:2-12923:4">]]></code>, and the string <code data-sourcepos="12923:24-12923:26">]]></code>.</p> -<p data-sourcepos="12925:1-12927:21" dir="auto">An <a data-sourcepos="12925:4-12925:16" 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="12929:1-12929:31" dir="auto">Here are some simple open tags:</p> -<div> -<div><a href="#example-632">Example 632</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12934:1-12936:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="12938:1-12940:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a><bab><c2c></p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="12944:1-12944:15" dir="auto">Empty elements:</p> -<div> -<div><a href="#example-633">Example 633</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12949:1-12951:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="12953:1-12955:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><a/><b2/></p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="12959:1-12959:24" dir="auto">[Whitespace] is allowed:</p> -<div> -<div><a href="#example-634">Example 634</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12964:1-12967:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12969:1-12972:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12976:1-12976:16" dir="auto">With attributes:</p> -<div> -<div><a href="#example-635">Example 635</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12981:1-12984:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12986:1-12989:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="12993:1-12993:29" dir="auto">Custom tag names can be used:</p> -<div> -<div><a href="#example-636">Example 636</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="12998:1-13000:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13002:1-13004:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13008:1-13008:38" dir="auto">Illegal tag names, not parsed as HTML:</p> -<div> -<div><a href="#example-637">Example 637</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13013:1-13015:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><33> <__></span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13017:1-13019:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13023:1-13023:24" dir="auto">Illegal attribute names:</p> -<div> -<div><a href="#example-638">Example 638</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13028:1-13030:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13032:1-13034:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13038:1-13038:25" dir="auto">Illegal attribute values:</p> -<div> -<div><a href="#example-639">Example 639</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13043:1-13045:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13047:1-13049:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13053:1-13053:21" dir="auto">Illegal [whitespace]:</p> -<div> -<div><a href="#example-640">Example 640</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13058:1-13063:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13065:1-13070:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13074:1-13074:21" dir="auto">Missing [whitespace]:</p> -<div> -<div><a href="#example-641">Example 641</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13079:1-13081:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13083:1-13085:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13089:1-13089:13" dir="auto">Closing tags:</p> -<div> -<div><a href="#example-642">Example 642</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13094:1-13096:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13098:1-13100:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p></a></foo ></p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="13104:1-13104:34" dir="auto">Illegal attributes in closing tag:</p> -<div> -<div><a href="#example-643">Example 643</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13109:1-13111:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"></a href="foo"></span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13113:1-13115:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13119:1-13119:9" dir="auto">Comments:</p> -<div> -<div><a href="#example-644">Example 644</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13124:1-13127:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13129:1-13132:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-645">Example 645</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13139:1-13141:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13143:1-13145:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13149:1-13149:13" dir="auto">Not comments:</p> -<div> -<div><a href="#example-646">Example 646</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13154:1-13158:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13160:1-13163:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13167:1-13167:24" dir="auto">Processing instructions:</p> -<div> -<div><a href="#example-647">Example 647</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13172:1-13174:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <?php echo $a; ?></span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13176:1-13178:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13182:1-13182:13" dir="auto">Declarations:</p> -<div> -<div><a href="#example-648">Example 648</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13187:1-13189:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <!ELEMENT br EMPTY></span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13191:1-13193:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13197:1-13197:15" dir="auto">CDATA sections:</p> -<div> -<div><a href="#example-649">Example 649</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13202:1-13204:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13206:1-13208:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo <![CDATA[>&<]]></p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="13212:1-13213:11" dir="auto">Entity and numeric character references are preserved in HTML -attributes:</p> -<div> -<div><a href="#example-650">Example 650</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13218:1-13220:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">foo <a href="&ouml;"></span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13222:1-13224:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13228:1-13228:49" dir="auto">Backslash escapes do not work in HTML attributes:</p> -<div> -<div><a href="#example-651">Example 651</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13233:1-13235:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13237:1-13239:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-652">Example 652</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13246:1-13248:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13250:1-13252:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<h2 data-sourcepos="13258:1-13258:34"> -<a href="#disallowed-raw-html-extension" aria-hidden="true" class="anchor" id="user-content-disallowed-raw-html-extension"></a>Disallowed Raw HTML (extension)</h2> -<p data-sourcepos="13260:1-13261:36">GFM enables the <code data-sourcepos="13260:18-13260:26">tagfilter</code> extension, where the following HTML tags will be -filtered when rendering HTML output:</p> -<ul data-sourcepos="13263:1-13272:0"> -<li data-sourcepos="13263:1-13263:11"><code data-sourcepos="13263:4-13263:10"><title></code></li> -<li data-sourcepos="13264:1-13264:14"><code data-sourcepos="13264:4-13264:13"><textarea></code></li> -<li data-sourcepos="13265:1-13265:11"><code data-sourcepos="13265:4-13265:10"><style></code></li> -<li data-sourcepos="13266:1-13266:9"><code data-sourcepos="13266:4-13266:8"><xmp></code></li> -<li data-sourcepos="13267:1-13267:12"><code data-sourcepos="13267:4-13267:11"><iframe></code></li> -<li data-sourcepos="13268:1-13268:13"><code data-sourcepos="13268:4-13268:12"><noembed></code></li> -<li data-sourcepos="13269:1-13269:14"><code data-sourcepos="13269:4-13269:13"><noframes></code></li> -<li data-sourcepos="13270:1-13270:12"><code data-sourcepos="13270:4-13270:11"><script></code></li> -<li data-sourcepos="13271:1-13272:0"><code data-sourcepos="13271:4-13271:14"><plaintext></code></li> -</ul> -<p data-sourcepos="13273:1-13276:71">Filtering is done by replacing the leading <code data-sourcepos="13273:45-13273:45"><</code> with the entity <code data-sourcepos="13273:65-13273:68">&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="13278:1-13278:39">All other HTML tags are left untouched.</p> -<div> -<div><a href="#example-653">Example 653</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13283:1-13289:32" data-canonical-lang="example" data-lang-params="tagfilter" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13291:1-13296:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<h2 data-sourcepos="13301:1-13301:19" dir="auto"> -<a href="#hard-line-breaks" aria-hidden="true" class="anchor" id="user-content-hard-line-breaks"></a>Hard line breaks</h2> -<p data-sourcepos="13303:1-13306: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 data-sourcepos="13305:16-13305:35" href="@">hard line break</a> (rendered -in HTML as a <code data-sourcepos="13306:15-13306:20"><br /></code> tag):</p> -<div> -<div><a href="#example-654">Example 654</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13311:1-13314:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13316:1-13319:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13323:1-13324:48" dir="auto">For a more visible alternative, a backslash before the -[line ending] may be used instead of two spaces:</p> -<div> -<div><a href="#example-655">Example 655</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13329:1-13332:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13334:1-13337:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13341:1-13341:33" dir="auto">More than two spaces can be used:</p> -<div> -<div><a href="#example-656">Example 656</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13346:1-13349:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13351:1-13354:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13358:1-13358:61" dir="auto">Leading spaces at the beginning of the next line are ignored:</p> -<div> -<div><a href="#example-657">Example 657</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13363:1-13366:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13368:1-13371:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-658">Example 658</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13378:1-13381:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13383:1-13386:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="13390:1-13391:26" dir="auto">Line breaks can occur inside emphasis, links, and other constructs -that allow inline content:</p> -<div> -<div><a href="#example-659">Example 659</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13396:1-13399:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13401:1-13404:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-660">Example 660</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13411:1-13414:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13416:1-13419:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="13423:1-13423:42" dir="auto">Line breaks do not occur inside code spans</p> -<div> -<div><a href="#example-661">Example 661</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13428:1-13431:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13433:1-13435:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-662">Example 662</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13442:1-13445:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13447:1-13449:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="13453:1-13453:13" dir="auto">or HTML tags:</p> -<div> -<div><a href="#example-663">Example 663</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13458:1-13461:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13463:1-13466:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<div> -<div><a href="#example-664">Example 664</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13473:1-13476:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13478:1-13481:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13485:1-13487: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> -<div><a href="#example-665">Example 665</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13492:1-13494:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13496:1-13498:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo\</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-666">Example 666</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13505:1-13507:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13509:1-13511:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>foo</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-667">Example 667</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13518:1-13520:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13522:1-13524:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h3>foo\</h3></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-668">Example 668</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13531:1-13533:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13535:1-13537:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><h3>foo</h3></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h2 data-sourcepos="13541:1-13541:19" dir="auto"> -<a href="#soft-line-breaks" aria-hidden="true" class="anchor" id="user-content-soft-line-breaks"></a>Soft line breaks</h2> -<p data-sourcepos="13543:1-13547: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 data-sourcepos="13545:1-13545:14" 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> -<div><a href="#example-669">Example 669</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13552:1-13555:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13557:1-13560:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13564:1-13565:8" dir="auto">Spaces at the end of the line and beginning of the next line are -removed:</p> -<div> -<div><a href="#example-670">Example 670</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13570:1-13573:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13575:1-13578:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13582:1-13583: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="13585:1-13586:20" dir="auto">A renderer may also provide an option to render soft line breaks -as hard line breaks.</p> -<h2 data-sourcepos="13588:1-13588:18" dir="auto"> -<a href="#textual-content" aria-hidden="true" class="anchor" id="user-content-textual-content"></a>Textual content</h2> -<p data-sourcepos="13590:1-13591:35" dir="auto">Any characters not given an interpretation by the above rules will -be parsed as plain textual content.</p> -<div> -<div><a href="#example-671">Example 671</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13596:1-13598:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13600:1-13602:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>hello $.;'there</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-672">Example 672</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13609:1-13611:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13613:1-13615:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Foo χÏῆν</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="13619:1-13619:39" dir="auto">Internal spaces are preserved verbatim:</p> -<div> -<div><a href="#example-673">Example 673</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13624:1-13626:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="13628:1-13630:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Multiple spaces</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h1 data-sourcepos="13634:1-13634:40" dir="auto"> -<a href="#gitlab-official-specification-markdown" aria-hidden="true" class="anchor" id="user-content-gitlab-official-specification-markdown"></a>GitLab Official Specification Markdown</h1> -<p data-sourcepos="13636:1-13638:104" dir="auto">Note: This specification is a work in progress. Only some of the official GLFM extensions -are defined. We will continue to add any additional ones found in the -<a data-sourcepos="13638:1-13638:103" 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="13640:1-13641: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="13643:1-13643:18" dir="auto"> -<a href="#task-list-items" aria-hidden="true" class="anchor" id="user-content-task-list-items"></a>Task list items</h2> -<p data-sourcepos="13645:1-13646:117" dir="auto">See -<a data-sourcepos="13646:1-13646:70" 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="13648:1-13651: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="13653:1-13653:85" dir="auto">Some of the behavior of task list items is implemented as client-side JavaScript/CSS.</p> -<p data-sourcepos="13655:1-13655:80" dir="auto">The following are some basic examples; more examples may be added in the future.</p> -<p data-sourcepos="13657:1-13657:16" dir="auto">Incomplete task:</p> -<div> -<div><a href="#example-674">Example 674</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13662:1-13664:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [ ] incomplete</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13666:1-13674:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13677:1-13677:15" dir="auto">Completed task:</p> -<div> -<div><a href="#example-675">Example 675</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13682:1-13684:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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="13686:1-13694:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13697:1-13697:18" dir="auto">Inapplicable task:</p> -<div> -<div><a href="#example-676">Example 676</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13702:1-13704:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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="13706:1-13716:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13719:1-13720:50" dir="auto">Inapplicable task in a "loose" list. Note that the <code data-sourcepos="13719:53-13719:57"><del></code> tag is not applied to the -loose text; it has strikethrough applied with CSS.</p> -<div> -<div><a href="#example-677">Example 677</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13725:1-13729:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13731:1-13746:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<h2 data-sourcepos="13749:1-13749:15" dir="auto"> -<a href="#front-matter" aria-hidden="true" class="anchor" id="user-content-front-matter"></a>Front matter</h2> -<p data-sourcepos="13751:1-13752:121" dir="auto">See -<a data-sourcepos="13752:1-13752:74" 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="13754:1-13755: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="13757:1-13757:18" dir="auto">YAML front matter:</p> -<div> -<div><a href="#example-678">Example 678</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13762:1-13766:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13768:1-13774:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13777:1-13777:18" dir="auto">TOML front matter:</p> -<div> -<div><a href="#example-679">Example 679</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13782:1-13786:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13788:1-13794:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13797:1-13797:18" dir="auto">JSON front matter:</p> -<div> -<div><a href="#example-680">Example 680</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13802:1-13808:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13810:1-13818:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13821:1-13821:66" dir="auto">Front matter blocks should be inserted at the top of the document:</p> -<div> -<div><a href="#example-681">Example 681</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13826:1-13832:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13834:1-13838:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13841:1-13841:74" dir="auto">Front matter block delimiters shouldn’t be preceded by space characters:</p> -<div> -<div><a href="#example-682">Example 682</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13846:1-13850:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13852:1-13855:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<h2 data-sourcepos="13858:1-13858:20" dir="auto"> -<a href="#table-of-contents" aria-hidden="true" class="anchor" id="user-content-table-of-contents"></a>Table of contents</h2> -<p data-sourcepos="13860:1-13862:46" dir="auto">See -<a data-sourcepos="13861:1-13861:84" 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="13864:1-13868:23" dir="auto">NOTE: Because of this bug (<a href="https://gitlab.com/gitlab-org/gitlab/-/issues/359077" rel="nofollow noreferrer noopener" target="_blank">https://gitlab.com/gitlab-org/gitlab/-/issues/359077</a>), -we cannot actually include the <code data-sourcepos="13865:33-13865:35">TOC</code> tag with single brackets in backticks -in this Markdown document, otherwise it would render a table of contents inline -right here. So, it's been switched to <code data-sourcepos="13867:40-13867:40">[</code> + <code data-sourcepos="13867:46-13867:48">TOC</code> + <code data-sourcepos="13867:54-13867:54">]</code> instead. This can be reverted -once that bug is fixed.</p> -<p data-sourcepos="13870:1-13871:76" dir="auto">A table of contents is an unordered list that links to subheadings in the document. -Add either the <code data-sourcepos="13871:17-13871:25">[[_TOC_]]</code> tag or the <code data-sourcepos="13871:40-13871:40">[</code> + <code data-sourcepos="13871:46-13871:48">TOC</code> + <code data-sourcepos="13871:54-13871:54">]</code> tag on its own line.</p> -<div> -<div><a href="#example-683">Example 683</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13876:1-13882:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13884:1-13895:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-684">Example 684</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13901:1-13907:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13909:1-13920:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="13923:1-13924:5" dir="auto">A table of contents is a block element. It should preceded and followed by a blank -line.</p> -<div> -<div><a href="#example-685">Example 685</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13929:1-13935:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13937:1-13940:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13943:1-13943:60" dir="auto">A table of contents can be indented with up to three spaces.</p> -<div> -<div><a href="#example-686">Example 686</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13948:1-13952:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13954:1-13961:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<h1 data-sourcepos="13964:1-13964:36" dir="auto"> -<a href="#gitlab-internal-extension-markdown" aria-hidden="true" class="anchor" id="user-content-gitlab-internal-extension-markdown"></a>GitLab Internal Extension Markdown</h1> -<h2 data-sourcepos="13966:1-13966:8" dir="auto"> -<a href="#audio" aria-hidden="true" class="anchor" id="user-content-audio"></a>Audio</h2> -<p data-sourcepos="13968:1-13969:107" dir="auto">See -<a data-sourcepos="13969:1-13969:60" 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="13971:1-13973: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 data-sourcepos="13972:50-13972:53">.mp3</code>, <code data-sourcepos="13972:58-13972:61">.oga</code>, <code data-sourcepos="13972:66-13972:69">.ogg</code>, <code data-sourcepos="13972:74-13972:77">.spx</code>, and <code data-sourcepos="13972:86-13972:89">.wav</code>. -Audio ignore the alternative text part of an image declaration.</p> -<div> -<div><a href="#example-687">Example 687</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13978:1-13980:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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="13982:1-13984:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="13987:1-13987:41" dir="auto">Reference definitions work audio as well:</p> -<div> -<div><a href="#example-688">Example 688</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13992:1-13996:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="13998:1-14000:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<h2 data-sourcepos="14003:1-14003:8" dir="auto"> -<a href="#video" aria-hidden="true" class="anchor" id="user-content-video"></a>Video</h2> -<p data-sourcepos="14005:1-14006:109" dir="auto">See -<a data-sourcepos="14006:1-14006:62" 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="14008:1-14010: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 data-sourcepos="14009:51-14009:54">.mp4</code>, <code data-sourcepos="14009:59-14009:62">.m4v</code>, <code data-sourcepos="14009:67-14009:70">.mov</code>, <code data-sourcepos="14009:75-14009:79">.webm</code>, and <code data-sourcepos="14009:88-14009:91">.ogv</code>. -Videos ignore the alternative text part of an image declaration.</p> -<div> -<div><a href="#example-689">Example 689</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14016:1-14018:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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="14020:1-14022:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="14025:1-14025:41" dir="auto">Reference definitions work video as well:</p> -<div> -<div><a href="#example-690">Example 690</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14030:1-14034:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14036:1-14038:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<h2 data-sourcepos="14041:1-14041:41" dir="auto"> -<a href="#markdown-preview-api-request-overrides" aria-hidden="true" class="anchor" id="user-content-markdown-preview-api-request-overrides"></a>Markdown Preview API Request Overrides</h2> -<p data-sourcepos="14043:1-14045:42" dir="auto">This section contains examples of all controllers which use <code data-sourcepos="14043:62-14043:76">PreviewMarkdown</code> module -and use different <code data-sourcepos="14044:20-14044:42">markdown_context_params</code>. They exercise the various <code data-sourcepos="14044:73-14044:88">preview_markdown</code> -endpoints via <code data-sourcepos="14045:16-14045:40">glfm_example_metadata.yml</code>.</p> -<p data-sourcepos="14048:1-14048:75" dir="auto"><code data-sourcepos="14048:2-14048:17">preview_markdown</code> exercising <code data-sourcepos="14048:32-14048:37">groups</code> API endpoint and <code data-sourcepos="14048:58-14048:73">UploadLinkFilter</code>:</p> -<div> -<div><a href="#example-691">Example 691</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14053:1-14055:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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="14057:1-14059:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="14062:1-14062:81" dir="auto"><code data-sourcepos="14062:2-14062:17">preview_markdown</code> exercising <code data-sourcepos="14062:32-14062:39">projects</code> API endpoint and <code data-sourcepos="14062:60-14062:79">RepositoryLinkFilter</code>:</p> -<div> -<div><a href="#example-692">Example 692</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14067:1-14069:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14071:1-14073:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="14076:1-14076:83" dir="auto"><code data-sourcepos="14076:2-14076:17">preview_markdown</code> exercising <code data-sourcepos="14076:32-14076:39">projects</code> API endpoint and <code data-sourcepos="14076:60-14076:81">SnippetReferenceFilter</code>:</p> -<div> -<div><a href="#example-693">Example 693</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14081:1-14083:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14085:1-14087:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="14090:1-14093:50" dir="auto"><code data-sourcepos="14090:2-14090:17">preview_markdown</code> exercising personal (non-project) <code data-sourcepos="14090:55-14090:62">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 data-sourcepos="14093:2-14093:23">SnippetReferenceFilter</code>, even if the ID is valid.</p> -<div> -<div><a href="#example-694">Example 694</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14098:1-14100:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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="14102:1-14104:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="14107:1-14107:80" dir="auto"><code data-sourcepos="14107:2-14107:17">preview_markdown</code> exercising project <code data-sourcepos="14107:40-14107:44">wikis</code> API endpoint and <code data-sourcepos="14107:65-14107:78">WikiLinkFilter</code>:</p> -<div> -<div><a href="#example-695">Example 695</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14112:1-14114:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14116:1-14118:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="14121:1-14122:63" dir="auto"><code data-sourcepos="14121:2-14121:17">preview_markdown</code> exercising group <code data-sourcepos="14121:38-14121:42">wikis</code> API endpoint and <code data-sourcepos="14121:63-14121:76">WikiLinkFilter</code>. This example -also requires an EE license enabling the <code data-sourcepos="14122:43-14122:53">group_wikis</code> feature:</p> -<div> -<div><a href="#example-696">Example 696</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14127:1-14129:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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="14131:1-14133:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<h2 data-sourcepos="14136:1-14136:34" dir="auto"> -<a href="#migrated-golden-master-examples" aria-hidden="true" class="anchor" id="user-content-migrated-golden-master-examples"></a>Migrated golden master examples</h2> -<h3 data-sourcepos="14138:1-14138:30" dir="auto"> -<a href="#attachment_image_for_group" aria-hidden="true" class="anchor" id="user-content-attachment_image_for_group"></a>attachment_image_for_group</h3> -<div> -<div><a href="#example-697">Example 697</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14143:1-14145:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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="14147:1-14149:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14152:1-14152:32" dir="auto"> -<a href="#attachment_image_for_project" aria-hidden="true" class="anchor" id="user-content-attachment_image_for_project"></a>attachment_image_for_project</h3> -<div> -<div><a href="#example-698">Example 698</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14157:1-14159:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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="14161:1-14163:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14166:1-14166:37" dir="auto"> -<a href="#attachment_image_for_project_wiki" aria-hidden="true" class="anchor" id="user-content-attachment_image_for_project_wiki"></a>attachment_image_for_project_wiki</h3> -<div> -<div><a href="#example-699">Example 699</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14171:1-14173:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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="14175:1-14177:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14180:1-14180:29" dir="auto"> -<a href="#attachment_link_for_group" aria-hidden="true" class="anchor" id="user-content-attachment_link_for_group"></a>attachment_link_for_group</h3> -<div> -<div><a href="#example-700">Example 700</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14185:1-14187:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[test-file](/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.zip)</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14189:1-14191:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14194:1-14194:31" dir="auto"> -<a href="#attachment_link_for_project" aria-hidden="true" class="anchor" id="user-content-attachment_link_for_project"></a>attachment_link_for_project</h3> -<div> -<div><a href="#example-701">Example 701</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14199:1-14201:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[test-file](/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.zip)</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14203:1-14205:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14208:1-14208:36" dir="auto"> -<a href="#attachment_link_for_project_wiki" aria-hidden="true" class="anchor" id="user-content-attachment_link_for_project_wiki"></a>attachment_link_for_project_wiki</h3> -<div> -<div><a href="#example-702">Example 702</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14213:1-14215:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[test-file](test-file.zip)</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14217:1-14219:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14222:1-14222:34" dir="auto"> -<a href="#attachment_link_for_group_wiki" aria-hidden="true" class="anchor" id="user-content-attachment_link_for_group_wiki"></a>attachment_link_for_group_wiki</h3> -<div> -<div><a href="#example-703">Example 703</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14227:1-14229:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[test-file](test-file.zip)</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14231:1-14233:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14236:1-14236:9" dir="auto"> -<a href="#audio-1" aria-hidden="true" class="anchor" id="user-content-audio-1"></a>audio</h3> -<div> -<div><a href="#example-704">Example 704</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14241:1-14243:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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="14245:1-14247:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14250:1-14250:28" dir="auto"> -<a href="#audio_and_video_in_lists" aria-hidden="true" class="anchor" id="user-content-audio_and_video_in_lists"></a>audio_and_video_in_lists</h3> -<div> -<div><a href="#example-705">Example 705</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14255:1-14265:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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">1. </span> -<span id="LC5" class="line" lang="plaintext">2. </span> -<span id="LC6" class="line" lang="plaintext"></span> -<span id="LC7" class="line" lang="plaintext">* [x] </span> -<span id="LC8" class="line" lang="plaintext">* [x] </span> -<span id="LC9" class="line" lang="plaintext">* [x] </span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14267:1-14269:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14272:1-14272:14" dir="auto"> -<a href="#blockquote" aria-hidden="true" class="anchor" id="user-content-blockquote"></a>blockquote</h3> -<div> -<div><a href="#example-706">Example 706</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14277:1-14281:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">> This is a blockquote</span> -<span id="LC2" class="line" lang="plaintext">></span> -<span id="LC3" class="line" lang="plaintext">> This is another one</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14283:1-14285:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14288:1-14288:8" dir="auto"> -<a href="#bold" aria-hidden="true" class="anchor" id="user-content-bold"></a>bold</h3> -<div> -<div><a href="#example-707">Example 707</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14293:1-14295:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">**bold**</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14297:1-14299:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14302:1-14302:23" dir="auto"> -<a href="#bullet_list_style_1" aria-hidden="true" class="anchor" id="user-content-bullet_list_style_1"></a>bullet_list_style_1</h3> -<div> -<div><a href="#example-708">Example 708</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14307:1-14311:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">* list item 1</span> -<span id="LC2" class="line" lang="plaintext">* list item 2</span> -<span id="LC3" class="line" lang="plaintext"> * embedded list item 3</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14313:1-14315:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14318:1-14318:23" dir="auto"> -<a href="#bullet_list_style_2" aria-hidden="true" class="anchor" id="user-content-bullet_list_style_2"></a>bullet_list_style_2</h3> -<div> -<div><a href="#example-709">Example 709</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14323:1-14327:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- list item 1</span> -<span id="LC2" class="line" lang="plaintext">- list item 2</span> -<span id="LC3" class="line" lang="plaintext"> * embedded list item 3</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14329:1-14331:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14334:1-14334:23" dir="auto"> -<a href="#bullet_list_style_3" aria-hidden="true" class="anchor" id="user-content-bullet_list_style_3"></a>bullet_list_style_3</h3> -<div> -<div><a href="#example-710">Example 710</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14339:1-14343:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">+ list item 1</span> -<span id="LC2" class="line" lang="plaintext">+ list item 2</span> -<span id="LC3" class="line" lang="plaintext"> - embedded list item 3</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14345:1-14347:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14350:1-14350:25" dir="auto"> -<a href="#code_block_javascript" aria-hidden="true" class="anchor" id="user-content-code_block_javascript"></a>code_block_javascript</h3> -<div> -<div><a href="#example-711">Example 711</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14355:1-14359:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```javascript</span> -<span id="LC2" class="line" lang="plaintext"> console.log('hello world')</span> -<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="14361:1-14363:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14366:1-14366:24" dir="auto"> -<a href="#code_block_plaintext" aria-hidden="true" class="anchor" id="user-content-code_block_plaintext"></a>code_block_plaintext</h3> -<div> -<div><a href="#example-712">Example 712</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14371:1-14375:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```</span> -<span id="LC2" class="line" lang="plaintext"> plaintext</span> -<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="14377:1-14379:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14382:1-14382:22" dir="auto"> -<a href="#code_block_unknown" aria-hidden="true" class="anchor" id="user-content-code_block_unknown"></a>code_block_unknown</h3> -<div> -<div><a href="#example-713">Example 713</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14387:1-14391:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```foobar</span> -<span id="LC2" class="line" lang="plaintext"> custom_language = >> this <<</span> -<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="14393:1-14395:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14398:1-14398:15" dir="auto"> -<a href="#color_chips" aria-hidden="true" class="anchor" id="user-content-color_chips"></a>color_chips</h3> -<div> -<div><a href="#example-714">Example 714</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14403:1-14413:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- `#F00`</span> -<span id="LC2" class="line" lang="plaintext">- `#F00A`</span> -<span id="LC3" class="line" lang="plaintext">- `#FF0000`</span> -<span id="LC4" class="line" lang="plaintext">- `#FF0000AA`</span> -<span id="LC5" class="line" lang="plaintext">- `RGB(0,255,0)`</span> -<span id="LC6" class="line" lang="plaintext">- `RGB(0%,100%,0%)`</span> -<span id="LC7" class="line" lang="plaintext">- `RGBA(0,255,0,0.3)`</span> -<span id="LC8" class="line" lang="plaintext">- `HSL(540,70%,50%)`</span> -<span id="LC9" class="line" lang="plaintext">- `HSLA(540,70%,50%,0.3)`</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14415:1-14417:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14420:1-14420:20" dir="auto"> -<a href="#description_list" aria-hidden="true" class="anchor" id="user-content-description_list"></a>description_list</h3> -<div> -<div><a href="#example-715">Example 715</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14425:1-14442:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><dl></span> -<span id="LC2" class="line" lang="plaintext"><dt>Frog</dt></span> -<span id="LC3" class="line" lang="plaintext"><dd>Wet green thing</dd></span> -<span id="LC4" class="line" lang="plaintext"><dt>Rabbit</dt></span> -<span id="LC5" class="line" lang="plaintext"><dd>Warm fluffy thing</dd></span> -<span id="LC6" class="line" lang="plaintext"><dt>Punt</dt></span> -<span id="LC7" class="line" lang="plaintext"><dd>Kick a ball</dd></span> -<span id="LC8" class="line" lang="plaintext"><dd>Take a bet</dd></span> -<span id="LC9" class="line" lang="plaintext"><dt>Color</dt></span> -<span id="LC10" class="line" lang="plaintext"><dt>Colour</dt></span> -<span id="LC11" class="line" lang="plaintext"><dd></span> -<span id="LC12" class="line" lang="plaintext"></span> -<span id="LC13" class="line" lang="plaintext">Any hue except _white_ or **black**</span> -<span id="LC14" class="line" lang="plaintext"></span> -<span id="LC15" class="line" lang="plaintext"></dd></span> -<span id="LC16" class="line" lang="plaintext"></dl></span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14444:1-14446:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14449:1-14449:11" dir="auto"> -<a href="#details" aria-hidden="true" class="anchor" id="user-content-details"></a>details</h3> -<div> -<div><a href="#example-716">Example 716</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14454:1-14462:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><details></span> -<span id="LC2" class="line" lang="plaintext"><summary>This is the visible summary of the collapsible section</summary></span> -<span id="LC3" class="line" lang="plaintext"></span> -<span id="LC4" class="line" lang="plaintext">1. collapsed markdown</span> -<span id="LC5" class="line" lang="plaintext">2. more collapsed markdown</span> -<span id="LC6" class="line" lang="plaintext"></span> -<span id="LC7" class="line" lang="plaintext"></details></span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14464:1-14466:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14469:1-14469:25" dir="auto"> -<a href="#diagram_kroki_nomnoml" aria-hidden="true" class="anchor" id="user-content-diagram_kroki_nomnoml"></a>diagram_kroki_nomnoml</h3> -<div> -<div><a href="#example-717">Example 717</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14474:1-14486:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```nomnoml</span> -<span id="LC2" class="line" lang="plaintext"> #stroke: #a86128</span> -<span id="LC3" class="line" lang="plaintext"> [<frame>Decorator pattern|</span> -<span id="LC4" class="line" lang="plaintext"> [<abstract>Component||+ operation()]</span> -<span id="LC5" class="line" lang="plaintext"> [Client] depends --> [Component]</span> -<span id="LC6" class="line" lang="plaintext"> [Decorator|- next: Component]</span> -<span id="LC7" class="line" lang="plaintext"> [Decorator] decorates -- [ConcreteComponent]</span> -<span id="LC8" class="line" lang="plaintext"> [Component] <:- [Decorator]</span> -<span id="LC9" class="line" lang="plaintext"> [Component] <:- [ConcreteComponent]</span> -<span id="LC10" class="line" lang="plaintext"> ]</span> -<span id="LC11" 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="14488:1-14490:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14493:1-14493:20" dir="auto"> -<a href="#diagram_plantuml" aria-hidden="true" class="anchor" id="user-content-diagram_plantuml"></a>diagram_plantuml</h3> -<div> -<div><a href="#example-718">Example 718</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14498:1-14506:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```plantuml</span> -<span id="LC2" class="line" lang="plaintext"> Alice -> Bob: Authentication Request</span> -<span id="LC3" class="line" lang="plaintext"> Bob --> Alice: Authentication Response</span> -<span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext"> Alice -> Bob: Another authentication Request</span> -<span id="LC6" class="line" lang="plaintext"> Alice <-- Bob: Another authentication Response</span> -<span id="LC7" 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="14508:1-14510:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14513:1-14513:28" dir="auto"> -<a href="#diagram_plantuml_unicode" aria-hidden="true" class="anchor" id="user-content-diagram_plantuml_unicode"></a>diagram_plantuml_unicode</h3> -<div> -<div><a href="#example-719">Example 719</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14518:1-14522:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">```plantuml</span> -<span id="LC2" class="line" lang="plaintext">A -> B : Text with norwegian characters: æøå</span> -<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="14524:1-14526:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14529:1-14529:7" dir="auto"> -<a href="#div" aria-hidden="true" class="anchor" id="user-content-div"></a>div</h3> -<div> -<div><a href="#example-720">Example 720</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14534:1-14541:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><div>plain text</div></span> -<span id="LC2" class="line" lang="plaintext"><div></span> -<span id="LC3" class="line" lang="plaintext"></span> -<span id="LC4" class="line" lang="plaintext">just a plain ol' div, not much to _expect_!</span> -<span id="LC5" class="line" lang="plaintext"></span> -<span id="LC6" 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="14543:1-14545:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14548:1-14548:9" dir="auto"> -<a href="#emoji" aria-hidden="true" class="anchor" id="user-content-emoji"></a>emoji</h3> -<div> -<div><a href="#example-721">Example 721</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14553:1-14555:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">:sparkles: :heart: :100:</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14557:1-14559:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14562:1-14562:12" dir="auto"> -<a href="#emphasis" aria-hidden="true" class="anchor" id="user-content-emphasis"></a>emphasis</h3> -<div> -<div><a href="#example-722">Example 722</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14567:1-14569:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">_emphasized text_</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14571:1-14573:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14576:1-14576:10" dir="auto"> -<a href="#figure" aria-hidden="true" class="anchor" id="user-content-figure"></a>figure</h3> -<div> -<div><a href="#example-723">Example 723</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14581:1-14598:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><figure></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"><figcaption>An elephant at sunset</figcaption></span> -<span id="LC6" class="line" lang="plaintext"></figure></span> -<span id="LC7" class="line" lang="plaintext"><figure></span> -<span id="LC8" class="line" lang="plaintext"></span> -<span id="LC9" class="line" lang="plaintext"></span> -<span id="LC10" class="line" lang="plaintext"></span> -<span id="LC11" class="line" lang="plaintext"><figcaption></span> -<span id="LC12" class="line" lang="plaintext"></span> -<span id="LC13" class="line" lang="plaintext">A crocodile wearing _crocs_!</span> -<span id="LC14" class="line" lang="plaintext"></span> -<span id="LC15" class="line" lang="plaintext"></figcaption></span> -<span id="LC16" class="line" lang="plaintext"></figure></span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14600:1-14602:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14605:1-14605:13" dir="auto"> -<a href="#footnotes" aria-hidden="true" class="anchor" id="user-content-footnotes"></a>footnotes</h3> -<div> -<div><a href="#example-724">Example 724</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14610:1-14618:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">A footnote reference tag looks like this: [^1]</span> -<span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">This reference tag is a mix of letters and numbers. [^footnote]</span> -<span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext">[^1]: This is the text inside a footnote.</span> -<span id="LC6" class="line" lang="plaintext"></span> -<span id="LC7" class="line" lang="plaintext">[^footnote]: This is another footnote.</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14620:1-14622:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14625:1-14625:20" dir="auto"> -<a href="#frontmatter_json" aria-hidden="true" class="anchor" id="user-content-frontmatter_json"></a>frontmatter_json</h3> -<div> -<div><a href="#example-725">Example 725</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14630:1-14636:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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": "Page title"</span> -<span id="LC4" class="line" lang="plaintext">}</span> -<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="14638:1-14640:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14643:1-14643:20" dir="auto"> -<a href="#frontmatter_toml" aria-hidden="true" class="anchor" id="user-content-frontmatter_toml"></a>frontmatter_toml</h3> -<div> -<div><a href="#example-726">Example 726</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14648:1-14652:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">+++</span> -<span id="LC2" class="line" lang="plaintext">title = "Page title"</span> -<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="14654:1-14656:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14659:1-14659:20" dir="auto"> -<a href="#frontmatter_yaml" aria-hidden="true" class="anchor" id="user-content-frontmatter_yaml"></a>frontmatter_yaml</h3> -<div> -<div><a href="#example-727">Example 727</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14664:1-14668:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">---</span> -<span id="LC2" class="line" lang="plaintext">title: Page title</span> -<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="14670:1-14672:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14675:1-14675:14" dir="auto"> -<a href="#hard_break" aria-hidden="true" class="anchor" id="user-content-hard_break"></a>hard_break</h3> -<div> -<div><a href="#example-728">Example 728</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14680:1-14683:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">This is a line after a\</span> -<span id="LC2" class="line" lang="plaintext">hard break</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14685:1-14687:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14690:1-14690:12" dir="auto"> -<a href="#headings" aria-hidden="true" class="anchor" id="user-content-headings"></a>headings</h3> -<div> -<div><a href="#example-729">Example 729</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14695:1-14707:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"># Heading 1</span> -<span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">## Heading 2</span> -<span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext">### Heading 3</span> -<span id="LC6" class="line" lang="plaintext"></span> -<span id="LC7" class="line" lang="plaintext">#### Heading 4</span> -<span id="LC8" class="line" lang="plaintext"></span> -<span id="LC9" class="line" lang="plaintext">##### Heading 5</span> -<span id="LC10" class="line" lang="plaintext"></span> -<span id="LC11" class="line" lang="plaintext">###### Heading 6</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14709:1-14711:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14714:1-14714:19" dir="auto"> -<a href="#horizontal_rule" aria-hidden="true" class="anchor" id="user-content-horizontal_rule"></a>horizontal_rule</h3> -<div> -<div><a href="#example-730">Example 730</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14719:1-14721:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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="14723:1-14725:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14728:1-14728:14" dir="auto"> -<a href="#html_marks" aria-hidden="true" class="anchor" id="user-content-html_marks"></a>html_marks</h3> -<div> -<div><a href="#example-731">Example 731</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14733:1-14749:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">* Content editor is ~~great~~<ins>amazing</ins>.</span> -<span id="LC2" class="line" lang="plaintext">* If the changes <abbr title="Looks good to merge">LGTM</abbr>, please <abbr title="Merge when pipeline succeeds">MWPS</abbr>.</span> -<span id="LC3" class="line" lang="plaintext">* The English song <q>Oh I do like to be beside the seaside</q> looks like this in Hebrew: <span dir="rtl">××”, ×× ×™ ×והב להיות ליד חוף ×”×™×</span>. In the computer's memory, this is stored as <bdo dir="ltr">××”, ×× ×™ ×והב להיות ליד חוף ×”×™×</bdo>.</span> -<span id="LC4" class="line" lang="plaintext">* <cite>The Scream</cite> by Edvard Munch. Painted in 1893.</span> -<span id="LC5" class="line" lang="plaintext">* <dfn>HTML</dfn> is the standard markup language for creating web pages.</span> -<span id="LC6" class="line" lang="plaintext">* Do not forget to buy <mark>milk</mark> today.</span> -<span id="LC7" class="line" lang="plaintext">* This is a paragraph and <small>smaller text goes here</small>.</span> -<span id="LC8" class="line" lang="plaintext">* The concert starts at <time datetime="20:00">20:00</time> and you'll be able to enjoy the band for at least <time datetime="PT2H30M">2h 30m</time>.</span> -<span id="LC9" class="line" lang="plaintext">* Press <kbd>Ctrl</kbd> + <kbd>C</kbd> to copy text (Windows).</span> -<span id="LC10" class="line" lang="plaintext">* WWF's goal is to: <q>Build a future where people live in harmony with nature.</q> We hope they succeed.</span> -<span id="LC11" class="line" lang="plaintext">* The error occurred was: <samp>Keyboard not found. Press F1 to continue.</samp></span> -<span id="LC12" class="line" lang="plaintext">* The area of a triangle is: 1/2 x <var>b</var> x <var>h</var>, where <var>b</var> is the base, and <var>h</var> is the vertical height.</span> -<span id="LC13" class="line" lang="plaintext">* <ruby>æ¼¢<rt>ã„ㄢˋ</rt></ruby></span> -<span id="LC14" class="line" lang="plaintext">* C<sub>7</sub>H<sub>16</sub> + O<sub>2</sub> → CO<sub>2</sub> + H<sub>2</sub>O</span> -<span id="LC15" class="line" lang="plaintext">* The **Pythagorean theorem** is often expressed as <var>a<sup>2</sup></var> + <var>b<sup>2</sup></var> = <var>c<sup>2</sup></var></span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14751:1-14753:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14756:1-14756:9" dir="auto"> -<a href="#image" aria-hidden="true" class="anchor" id="user-content-image"></a>image</h3> -<div> -<div><a href="#example-732">Example 732</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14761:1-14763:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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="14765:1-14767:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14770:1-14770:15" dir="auto"> -<a href="#inline_code" aria-hidden="true" class="anchor" id="user-content-inline_code"></a>inline_code</h3> -<div> -<div><a href="#example-733">Example 733</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14775:1-14777:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" 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="14779:1-14781:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14784:1-14784:15" dir="auto"> -<a href="#inline_diff" aria-hidden="true" class="anchor" id="user-content-inline_diff"></a>inline_diff</h3> -<div> -<div><a href="#example-734">Example 734</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14789:1-14792:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">* {-deleted-}</span> -<span id="LC2" class="line" lang="plaintext">* {+added+}</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14794:1-14796:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14799:1-14799:9" dir="auto"> -<a href="#label" aria-hidden="true" class="anchor" id="user-content-label"></a>label</h3> -<div> -<div><a href="#example-735">Example 735</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14804:1-14806:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~bug</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14808:1-14810:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14813:1-14813:8" dir="auto"> -<a href="#link" aria-hidden="true" class="anchor" id="user-content-link"></a>link</h3> -<div> -<div><a href="#example-736">Example 736</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14818:1-14820:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">[GitLab](https://gitlab.com)</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14822:1-14824:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14827:1-14827:8" dir="auto"> -<a href="#math" aria-hidden="true" class="anchor" id="user-content-math"></a>math</h3> -<div> -<div><a href="#example-737">Example 737</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14832:1-14840:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">This math is inline $`a^2+b^2=c^2`$.</span> -<span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">This is on a separate line:</span> -<span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext">```math</span> -<span id="LC6" class="line" lang="plaintext">a^2+b^2=c^2</span> -<span id="LC7" 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="14842:1-14844:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14847:1-14847:16" dir="auto"> -<a href="#ordered_list" aria-hidden="true" class="anchor" id="user-content-ordered_list"></a>ordered_list</h3> -<div> -<div><a href="#example-738">Example 738</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14852:1-14856:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. list item 1</span> -<span id="LC2" class="line" lang="plaintext">2. list item 2</span> -<span id="LC3" class="line" lang="plaintext">3. list item 3</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14858:1-14860:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14863:1-14863:33" dir="auto"> -<a href="#ordered_list_with_start_order" aria-hidden="true" class="anchor" id="user-content-ordered_list_with_start_order"></a>ordered_list_with_start_order</h3> -<div> -<div><a href="#example-739">Example 739</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14868:1-14872:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">134. list item 1</span> -<span id="LC2" class="line" lang="plaintext">135. list item 2</span> -<span id="LC3" class="line" lang="plaintext">136. list item 3</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14874:1-14876:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14879:1-14879:21" dir="auto"> -<a href="#ordered_task_list" aria-hidden="true" class="anchor" id="user-content-ordered_task_list"></a>ordered_task_list</h3> -<div> -<div><a href="#example-740">Example 740</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14884:1-14891:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">1. [x] hello</span> -<span id="LC2" class="line" lang="plaintext">2. [x] world</span> -<span id="LC3" class="line" lang="plaintext">3. [ ] example</span> -<span id="LC4" class="line" lang="plaintext"> 1. [ ] of nested</span> -<span id="LC5" class="line" lang="plaintext"> 1. [x] task list</span> -<span id="LC6" class="line" lang="plaintext"> 2. [ ] items</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14893:1-14895:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14898:1-14898:32" dir="auto"> -<a href="#ordered_task_list_with_order" aria-hidden="true" class="anchor" id="user-content-ordered_task_list_with_order"></a>ordered_task_list_with_order</h3> -<div> -<div><a href="#example-741">Example 741</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14903:1-14907:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">4893. [x] hello</span> -<span id="LC2" class="line" lang="plaintext">4894. [x] world</span> -<span id="LC3" class="line" lang="plaintext">4895. [ ] example</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14909:1-14911:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14914:1-14914:30" dir="auto"> -<a href="#reference_for_project_wiki" aria-hidden="true" class="anchor" id="user-content-reference_for_project_wiki"></a>reference_for_project_wiki</h3> -<div> -<div><a href="#example-742">Example 742</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14919:1-14921:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Hi @gfm_user - thank you for reporting this ~"UX bug" (#1) we hope to fix it in %1.1 as part of !1</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14923:1-14925:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14928:1-14928:10" dir="auto"> -<a href="#strike" aria-hidden="true" class="anchor" id="user-content-strike"></a>strike</h3> -<div> -<div><a href="#example-743">Example 743</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14933:1-14935:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~del~~</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14937:1-14939:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14942:1-14942:9" dir="auto"> -<a href="#table" aria-hidden="true" class="anchor" id="user-content-table"></a>table</h3> -<div> -<div><a href="#example-744">Example 744</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14947:1-14954:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| header | header |</span> -<span id="LC2" class="line" lang="plaintext">|--------|--------|</span> -<span id="LC3" class="line" lang="plaintext">| `code` | cell with **bold** |</span> -<span id="LC4" class="line" lang="plaintext">| ~~strike~~ | cell with _italic_ |</span> -<span id="LC5" class="line" lang="plaintext"></span> -<span id="LC6" class="line" lang="plaintext"># content after table</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14956:1-14958:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14961:1-14961:21" dir="auto"> -<a href="#table_of_contents" aria-hidden="true" class="anchor" id="user-content-table_of_contents"></a>table_of_contents</h3> -<div> -<div><a href="#example-745">Example 745</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14966:1-14980:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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"># Lorem</span> -<span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext">Well, that's just like... your opinion.. man.</span> -<span id="LC6" class="line" lang="plaintext"></span> -<span id="LC7" class="line" lang="plaintext">## Ipsum</span> -<span id="LC8" class="line" lang="plaintext"></span> -<span id="LC9" class="line" lang="plaintext">### Dolar</span> -<span id="LC10" class="line" lang="plaintext"></span> -<span id="LC11" class="line" lang="plaintext"># Sit amit</span> -<span id="LC12" class="line" lang="plaintext"></span> -<span id="LC13" class="line" lang="plaintext">### I don't know</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14982:1-14984:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="14987:1-14987:13" dir="auto"> -<a href="#task_list" aria-hidden="true" class="anchor" id="user-content-task_list"></a>task_list</h3> -<div> -<div><a href="#example-746">Example 746</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="14992:1-14999:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">* [x] hello</span> -<span id="LC2" class="line" lang="plaintext">* [x] world</span> -<span id="LC3" class="line" lang="plaintext">* [ ] example</span> -<span id="LC4" class="line" lang="plaintext"> * [ ] of nested</span> -<span id="LC5" class="line" lang="plaintext"> * [x] task list</span> -<span id="LC6" class="line" lang="plaintext"> * [ ] items</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15001:1-15003:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="15006:1-15006:9" dir="auto"> -<a href="#video-1" aria-hidden="true" class="anchor" id="user-content-video-1"></a>video</h3> -<div> -<div><a href="#example-747">Example 747</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15011:1-15013:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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="15015:1-15017:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h3 data-sourcepos="15020:1-15020:14" dir="auto"> -<a href="#word_break" aria-hidden="true" class="anchor" id="user-content-word_break"></a>word_break</h3> -<div> -<div><a href="#example-748">Example 748</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15025:1-15027:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Fernstraßen<wbr>bau<wbr>privat<wbr>finanzierungs<wbr>gesetz</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15029:1-15031:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">TODO: Write canonical HTML for this example</span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h2 data-sourcepos="15034:1-15034:19" dir="auto"> -<a href="#image-attributes" aria-hidden="true" class="anchor" id="user-content-image-attributes"></a>Image Attributes</h2> -<p data-sourcepos="15036:1-15038:46" dir="auto">See -<a data-sourcepos="15037:1-15037:104" href="https://docs.gitlab.com/ee/user/markdown.html#change-the-image-dimensions" rel="nofollow noreferrer noopener" target="_blank">Change the image dimensions</a> -in the GitLab Flavored Markdown documentation.</p> -<p data-sourcepos="15040:1-15041:19" dir="auto">The <code data-sourcepos="15040:6-15040:10">width</code> and <code data-sourcepos="15040:18-15040:23">height</code> attributes for an image can be specified directly after -the image markdown.</p> -<p data-sourcepos="15043:1-15045:21" dir="auto">General syntax conforms to the -<a data-sourcepos="15044:1-15044:123" href="https://github.com/jgm/commonmark-hs/blob/master/commonmark-extensions/test/attributes.md" rel="nofollow noreferrer noopener" target="_blank">commonmark-hs attribute syntax</a> -where it makes sense.</p> -<div> -<div><a href="#example-749">Example 749</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15050:1-15052:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">{width="100" height="100"}</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15054:1-15056:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="https://gitlab.com/logo.png" width="100" height="100"></p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="15059:1-15059:41" dir="auto"><code data-sourcepos="15059:2-15059:2">%</code> and <code data-sourcepos="15059:10-15059:11">px</code> units may also be specified.</p> -<div> -<div><a href="#example-750">Example 750</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15064:1-15066:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">{width="100%"}</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15068:1-15070:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="https://gitlab.com/logo.png" width="100%"></p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<div> -<div><a href="#example-751">Example 751</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15076:1-15078:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">{height="100px"}</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15080:1-15082:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="https://gitlab.com/logo.png" height="100px"></p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="15085:1-15085:46" dir="auto">Whitespace is tolerated around the delimiters:</p> -<div> -<div><a href="#example-752">Example 752</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15090:1-15092:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">{ width="100" height="100" }</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15094:1-15096:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="https://gitlab.com/logo.png" width="100" height="100"></p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="15099:1-15099:54" dir="auto">Attributes must immediately follow the image markdown.</p> -<div> -<div><a href="#example-753">Example 753</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15104:1-15106:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"> {width="100" height="100"}</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15108:1-15110:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><img src="https://gitlab.com/logo.png"> {width="100" height="100"}</p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h2 data-sourcepos="15113:1-15113:12" dir="auto"> -<a href="#footnotes-1" aria-hidden="true" class="anchor" id="user-content-footnotes-1"></a>Footnotes</h2> -<p data-sourcepos="15115:1-15116:143" dir="auto">See -<a data-sourcepos="15116:1-15116:142" 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> -<div><a href="#example-754">Example 754</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15121:1-15125:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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="15127:1-15147:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<h1 data-sourcepos="15150:1-15150:50" dir="auto"> -<a href="#gfm-undocumented-extensions-and-more-robust-test" aria-hidden="true" class="anchor" id="user-content-gfm-undocumented-extensions-and-more-robust-test"></a>GFM undocumented extensions and more robust test</h1> -<p data-sourcepos="15152:1-15154:16" dir="auto">This section contains tests borrowed from <a href="https://github.com/github/cmark-gfm/blob/master/test/extensions.txt" rel="nofollow noreferrer noopener" target="_blank">https://github.com/github/cmark-gfm/blob/master/test/extensions.txt</a>. -It includes items not found in the official GFM specification, such as footnotes and additional tests for tables, -task lists, etc.</p> -<h2 data-sourcepos="15156:1-15156:12" dir="auto"> -<a href="#footnotes-2" aria-hidden="true" class="anchor" id="user-content-footnotes-2"></a>Footnotes</h2> -<div> -<div><a href="#example-755">Example 755</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15161:1-15188:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">This is some text![^1]. Other text.[^footnote].</span> -<span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">Here's a thing[^other-note].</span> -<span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext">And another thing[^codeblock-note].</span> -<span id="LC6" class="line" lang="plaintext"></span> -<span id="LC7" class="line" lang="plaintext">This doesn't have a referent[^nope].</span> -<span id="LC8" class="line" lang="plaintext"></span> -<span id="LC9" class="line" lang="plaintext"></span> -<span id="LC10" class="line" lang="plaintext">[^other-note]: no code block here (spaces are stripped away)</span> -<span id="LC11" class="line" lang="plaintext"></span> -<span id="LC12" class="line" lang="plaintext">[^codeblock-note]:</span> -<span id="LC13" class="line" lang="plaintext"> this is now a code block (8 spaces indentation)</span> -<span id="LC14" class="line" lang="plaintext"></span> -<span id="LC15" class="line" lang="plaintext">[^1]: Some *bolded* footnote definition.</span> -<span id="LC16" class="line" lang="plaintext"></span> -<span id="LC17" class="line" lang="plaintext">Hi!</span> -<span id="LC18" class="line" lang="plaintext"></span> -<span id="LC19" class="line" lang="plaintext">[^footnote]:</span> -<span id="LC20" class="line" lang="plaintext"> > Blockquotes can be in a footnote.</span> -<span id="LC21" class="line" lang="plaintext"></span> -<span id="LC22" class="line" lang="plaintext"> as well as code blocks</span> -<span id="LC23" class="line" lang="plaintext"></span> -<span id="LC24" class="line" lang="plaintext"> or, naturally, simple paragraphs.</span> -<span id="LC25" class="line" lang="plaintext"></span> -<span id="LC26" class="line" lang="plaintext">[^unused]: This is unused.</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15190:1-15219:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>This is some text!<sup class="footnote-ref"><a href="#fn-1" id="fnref-1" data-footnote-ref>1</a></sup>. Other text.<sup class="footnote-ref"><a href="#fn-footnote" id="fnref-footnote" data-footnote-ref>2</a></sup>.</p></span> -<span id="LC2" class="line" lang="plaintext"><p>Here's a thing<sup class="footnote-ref"><a href="#fn-other-note" id="fnref-other-note" data-footnote-ref>3</a></sup>.</p></span> -<span id="LC3" class="line" lang="plaintext"><p>And another thing<sup class="footnote-ref"><a href="#fn-codeblock-note" id="fnref-codeblock-note" data-footnote-ref>4</a></sup>.</p></span> -<span id="LC4" class="line" lang="plaintext"><p>This doesn't have a referent[^nope].</p></span> -<span id="LC5" class="line" lang="plaintext"><p>Hi!</p></span> -<span id="LC6" class="line" lang="plaintext"><section class="footnotes" data-footnotes></span> -<span id="LC7" class="line" lang="plaintext"><ol></span> -<span id="LC8" class="line" lang="plaintext"><li id="fn-1"></span> -<span id="LC9" class="line" lang="plaintext"><p>Some <em>bolded</em> footnote definition. <a href="#fnref-1" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1">↩</a></p></span> -<span id="LC10" class="line" lang="plaintext"></li></span> -<span id="LC11" class="line" lang="plaintext"><li id="fn-footnote"></span> -<span id="LC12" class="line" lang="plaintext"><blockquote></span> -<span id="LC13" class="line" lang="plaintext"><p>Blockquotes can be in a footnote.</p></span> -<span id="LC14" class="line" lang="plaintext"></blockquote></span> -<span id="LC15" class="line" lang="plaintext"><pre><code>as well as code blocks</span> -<span id="LC16" class="line" lang="plaintext"></code></pre></span> -<span id="LC17" class="line" lang="plaintext"><p>or, naturally, simple paragraphs. <a href="#fnref-footnote" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="2" aria-label="Back to reference 2">↩</a></p></span> -<span id="LC18" class="line" lang="plaintext"></li></span> -<span id="LC19" class="line" lang="plaintext"><li id="fn-other-note"></span> -<span id="LC20" class="line" lang="plaintext"><p>no code block here (spaces are stripped away) <a href="#fnref-other-note" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="3" aria-label="Back to reference 3">↩</a></p></span> -<span id="LC21" class="line" lang="plaintext"></li></span> -<span id="LC22" class="line" lang="plaintext"><li id="fn-codeblock-note"></span> -<span id="LC23" class="line" lang="plaintext"><pre><code>this is now a code block (8 spaces indentation)</span> -<span id="LC24" class="line" lang="plaintext"></code></pre></span> -<span id="LC25" class="line" lang="plaintext"><a href="#fnref-codeblock-note" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="4" aria-label="Back to reference 4">↩</a></span> -<span id="LC26" class="line" lang="plaintext"></li></span> -<span id="LC27" class="line" lang="plaintext"></ol></span> -<span id="LC28" class="line" lang="plaintext"></section></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h2 data-sourcepos="15222:1-15222:71" dir="auto"> -<a href="#when-a-footnote-is-used-multiple-times-we-insert-multiple-backrefs" aria-hidden="true" class="anchor" id="user-content-when-a-footnote-is-used-multiple-times-we-insert-multiple-backrefs"></a>When a footnote is used multiple times, we insert multiple backrefs.</h2> -<div> -<div><a href="#example-756">Example 756</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15227:1-15233:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">This is some text. It has a footnote[^a-footnote].</span> -<span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">This footnote is referenced[^a-footnote] multiple times, in lots of different places.[^a-footnote]</span> -<span id="LC4" class="line" lang="plaintext"></span> -<span id="LC5" class="line" lang="plaintext">[^a-footnote]: This footnote definition should have three backrefs.</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15235:1-15245:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>This is some text. It has a footnote<sup class="footnote-ref"><a href="#fn-a-footnote" id="fnref-a-footnote" data-footnote-ref>1</a></sup>.</p></span> -<span id="LC2" class="line" lang="plaintext"><p>This footnote is referenced<sup class="footnote-ref"><a href="#fn-a-footnote" id="fnref-a-footnote-2" data-footnote-ref>1</a></sup> multiple times, in lots of different places.<sup class="footnote-ref"><a href="#fn-a-footnote" id="fnref-a-footnote-3" data-footnote-ref>1</a></sup></p></span> -<span id="LC3" class="line" lang="plaintext"><section class="footnotes" data-footnotes></span> -<span id="LC4" class="line" lang="plaintext"><ol></span> -<span id="LC5" class="line" lang="plaintext"><li id="fn-a-footnote"></span> -<span id="LC6" class="line" lang="plaintext"><p>This footnote definition should have three backrefs. <a href="#fnref-a-footnote" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1">↩</a> <a href="#fnref-a-footnote-2" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1-2" aria-label="Back to reference 1-2">↩<sup class="footnote-ref">2</sup></a> <a href="#fnref-a-footnote-3" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1-3" aria-label="Back to reference 1-3">↩<sup class="footnote-ref">3</sup></a></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"></section></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h2 data-sourcepos="15248:1-15248:45" dir="auto"> -<a href="#footnote-reference-labels-are-href-escaped" aria-hidden="true" class="anchor" id="user-content-footnote-reference-labels-are-href-escaped"></a>Footnote reference labels are href escaped</h2> -<div> -<div><a href="#example-757">Example 757</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15253:1-15257:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">Hello[^"><script>alert(1)</script>]</span> -<span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">[^"><script>alert(1)</script>]: pwned</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15259:1-15268:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p>Hello<sup class="footnote-ref"><a href="#fn-%22%3E%3Cscript%3Ealert(1)%3C/script%3E" id="fnref-%22%3E%3Cscript%3Ealert(1)%3C/script%3E" data-footnote-ref>1</a></sup></p></span> -<span id="LC2" class="line" lang="plaintext"><section class="footnotes" data-footnotes></span> -<span id="LC3" class="line" lang="plaintext"><ol></span> -<span id="LC4" class="line" lang="plaintext"><li id="fn-%22%3E%3Cscript%3Ealert(1)%3C/script%3E"></span> -<span id="LC5" class="line" lang="plaintext"><p>pwned <a href="#fnref-%22%3E%3Cscript%3Ealert(1)%3C/script%3E" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1">↩</a></p></span> -<span id="LC6" class="line" lang="plaintext"></li></span> -<span id="LC7" class="line" lang="plaintext"></ol></span> -<span id="LC8" class="line" lang="plaintext"></section></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<h2 data-sourcepos="15271:1-15271:10" dir="auto"> -<a href="#interop" aria-hidden="true" class="anchor" id="user-content-interop"></a>Interop</h2> -<p data-sourcepos="15273:1-15273:27" dir="auto">Autolink and strikethrough.</p> -<div> -<div><a href="#example-758">Example 758</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15278:1-15282:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">~~www.google.com~~</span> -<span id="LC2" class="line" lang="plaintext"></span> -<span id="LC3" class="line" lang="plaintext">~~http://google.com~~</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15284:1-15287:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><p><del><a href="http://www.google.com">www.google.com</a></del></p></span> -<span id="LC2" class="line" lang="plaintext"><p><del><a href="http://google.com">http://google.com</a></del></p></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="15290:1-15290:20" dir="auto">Autolink and tables.</p> -<div> -<div><a href="#example-759">Example 759</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15295:1-15299:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">| a | b |</span> -<span id="LC2" class="line" lang="plaintext">| --- | --- |</span> -<span id="LC3" class="line" lang="plaintext">| https://github.com www.github.com | http://pokemon.com |</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15301:1-15316:32" class="code highlight js-syntax-highlight language-plaintext" 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>a</th></span> -<span id="LC5" class="line" lang="plaintext"><th>b</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><a href="https://github.com">https://github.com</a> <a href="http://www.github.com">www.github.com</a></td></span> -<span id="LC11" class="line" lang="plaintext"><td><a href="http://pokemon.com">http://pokemon.com</a></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> -</div> -<h2 data-sourcepos="15319:1-15319:13" dir="auto"> -<a href="#task-lists" aria-hidden="true" class="anchor" id="user-content-task-lists"></a>Task lists</h2> -<div> -<div><a href="#example-760">Example 760</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15324:1-15327:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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="15329:1-15334:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> -<span id="LC2" class="line" lang="plaintext"><li><input type="checkbox" disabled="" /> foo</li></span> -<span id="LC3" class="line" lang="plaintext"><li><input type="checkbox" checked="" disabled="" /> bar</li></span> -<span id="LC4" class="line" lang="plaintext"></ul></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<p data-sourcepos="15337:1-15342:37" dir="auto">Show that a task list and a regular list get processed the same in -the way that sublists are created. If something works in a list -item, then it should work the same way with a task. The only -difference should be the tasklist marker. So, if we use something -other than a space or x, it won't be recognized as a task item, and -so will be treated as a regular item.</p> -<div> -<div><a href="#example-761">Example 761</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15347:1-15358:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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">Show a regular (non task) list to show that it has the same structure</span> -<span id="LC7" class="line" lang="plaintext">- [@] foo</span> -<span id="LC8" class="line" lang="plaintext"> - [@] bar</span> -<span id="LC9" class="line" lang="plaintext"> - [@] baz</span> -<span id="LC10" 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="15360:1-15380:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> -<span id="LC2" class="line" lang="plaintext"><li><input type="checkbox" checked="" disabled="" /> foo</span> -<span id="LC3" class="line" lang="plaintext"><ul></span> -<span id="LC4" class="line" lang="plaintext"><li><input type="checkbox" disabled="" /> bar</li></span> -<span id="LC5" class="line" lang="plaintext"><li><input type="checkbox" checked="" disabled="" /> 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 type="checkbox" disabled="" /> bim</li></span> -<span id="LC9" class="line" lang="plaintext"></ul></span> -<span id="LC10" class="line" lang="plaintext"><p>Show a regular (non task) list to show that it has the same structure</p></span> -<span id="LC11" class="line" lang="plaintext"><ul></span> -<span id="LC12" class="line" lang="plaintext"><li>[@] foo</span> -<span id="LC13" class="line" lang="plaintext"><ul></span> -<span id="LC14" class="line" lang="plaintext"><li>[@] bar</li></span> -<span id="LC15" class="line" lang="plaintext"><li>[@] baz</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"><li>[@] bim</li></span> -<span id="LC19" class="line" lang="plaintext"></ul></span></code></pre> -<copy-code></copy-code> -</div> -</div> -Use a larger indent -- a task list and a regular list should produce -the same structure. -<div> -<div><a href="#example-762">Example 762</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="15388:1-15399:32" data-canonical-lang="example" class="code highlight js-syntax-highlight language-plaintext" 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">Show a regular (non task) list to show that it has the same structure</span> -<span id="LC7" class="line" lang="plaintext">- [@] foo</span> -<span id="LC8" class="line" lang="plaintext"> - [@] bar</span> -<span id="LC9" class="line" lang="plaintext"> - [@] baz</span> -<span id="LC10" 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="15401:1-15421:32" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext"><ul></span> -<span id="LC2" class="line" lang="plaintext"><li><input type="checkbox" checked="" disabled="" /> foo</span> -<span id="LC3" class="line" lang="plaintext"><ul></span> -<span id="LC4" class="line" lang="plaintext"><li><input type="checkbox" disabled="" /> bar</li></span> -<span id="LC5" class="line" lang="plaintext"><li><input type="checkbox" checked="" disabled="" /> 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 type="checkbox" disabled="" /> bim</li></span> -<span id="LC9" class="line" lang="plaintext"></ul></span> -<span id="LC10" class="line" lang="plaintext"><p>Show a regular (non task) list to show that it has the same structure</p></span> -<span id="LC11" class="line" lang="plaintext"><ul></span> -<span id="LC12" class="line" lang="plaintext"><li>[@] foo</span> -<span id="LC13" class="line" lang="plaintext"><ul></span> -<span id="LC14" class="line" lang="plaintext"><li>[@] bar</li></span> -<span id="LC15" class="line" lang="plaintext"><li>[@] baz</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"><li>[@] bim</li></span> -<span id="LC19" class="line" lang="plaintext"></ul></span></code></pre> -<copy-code></copy-code> -</div> -</div> -<!-- end of the "GFM undocumented extensions and more robust test" section --> - -</body> -</html> - diff --git a/glfm_specification/output_example_snapshots/snapshot_spec.md b/glfm_specification/output_example_snapshots/snapshot_spec.md deleted file mode 100644 index a22d9b41ea786e18886d5123c84f470357a5d3de..0000000000000000000000000000000000000000 --- a/glfm_specification/output_example_snapshots/snapshot_spec.md +++ /dev/null @@ -1,10855 +0,0 @@ ---- -title: GitLab Flavored Markdown Internal Extensions -version: alpha -... -# Preliminaries - -## Characters and lines - -Any sequence of [characters] is a valid CommonMark -document. - -A [character](@) is a Unicode code point. Although some -code points (for example, combining accents) do not correspond to -characters in an intuitive sense, all code points count as characters -for purposes of this spec. - -This spec does not specify an encoding; it thinks of lines as composed -of [characters] rather than bytes. A conforming parser may be limited -to a certain encoding. - -A [line](@) is a sequence of zero or more [characters] -other than newline (`U+000A`) or carriage return (`U+000D`), -followed by a [line ending] or by the end of file. - -A [line ending](@) is a newline (`U+000A`), a carriage return -(`U+000D`) not followed by a newline, or a carriage return and a -following newline. - -A line containing no characters, or a line containing only spaces -(`U+0020`) or tabs (`U+0009`), is called a [blank line](@). - -The following definitions of character classes will be used in this spec: - -A [whitespace character](@) is a space -(`U+0020`), tab (`U+0009`), newline (`U+000A`), line tabulation (`U+000B`), -form feed (`U+000C`), or carriage return (`U+000D`). - -[Whitespace](@) is a sequence of one or more [whitespace -characters]. - -A [Unicode whitespace character](@) is -any code point in the Unicode `Zs` general category, or a tab (`U+0009`), -carriage return (`U+000D`), newline (`U+000A`), or form feed -(`U+000C`). - -[Unicode whitespace](@) is a sequence of one -or more [Unicode whitespace characters]. - -A [space](@) is `U+0020`. - -A [non-whitespace character](@) is any character -that is not a [whitespace character]. - -An [ASCII punctuation character](@) -is `!`, `"`, `#`, `$`, `%`, `&`, `'`, `(`, `)`, -`*`, `+`, `,`, `-`, `.`, `/` (U+0021–2F), -`:`, `;`, `<`, `=`, `>`, `?`, `@` (U+003A–0040), -`[`, `\`, `]`, `^`, `_`, `` ` `` (U+005B–0060), -`{`, `|`, `}`, or `~` (U+007B–007E). - -A [punctuation character](@) is an [ASCII -punctuation character] or anything in -the general Unicode categories `Pc`, `Pd`, `Pe`, `Pf`, `Pi`, `Po`, or `Ps`. - -## Tabs - -Tabs in lines are not expanded to [spaces]. However, -in contexts where whitespace helps to define block structure, -tabs behave as if they were replaced by spaces with a tab stop -of 4 characters. - -Thus, for example, a tab can be used instead of four spaces -in an indented code block. (Note, however, that internal -tabs are passed through as literal tabs, not expanded to -spaces.) - -```````````````````````````````` example -→foo→baz→→bim -. -<pre><code>foo→baz→→bim -</code></pre> -```````````````````````````````` - -```````````````````````````````` example - →foo→baz→→bim -. -<pre><code>foo→baz→→bim -</code></pre> -```````````````````````````````` - -```````````````````````````````` example - a→a - á½â†’a -. -<pre><code>a→a -á½â†’a -</code></pre> -```````````````````````````````` - -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: - -```````````````````````````````` example - - foo - -→bar -. -<ul> -<li> -<p>foo</p> -<p>bar</p> -</li> -</ul> -```````````````````````````````` - -```````````````````````````````` example -- foo - -→→bar -. -<ul> -<li> -<p>foo</p> -<pre><code> bar -</code></pre> -</li> -</ul> -```````````````````````````````` - -Normally the `>` that begins a block quote may be followed -optionally by a space, which is not considered part of the -content. In the following case `>` is followed by a tab, -which is treated as if it were expanded into three spaces. -Since one of these spaces is considered part of the -delimiter, `foo` is considered to be indented six spaces -inside the block quote context, so we get an indented -code block starting with two spaces. - -```````````````````````````````` example ->→→foo -. -<blockquote> -<pre><code> foo -</code></pre> -</blockquote> -```````````````````````````````` - -```````````````````````````````` example --→→foo -. -<ul> -<li> -<pre><code> foo -</code></pre> -</li> -</ul> -```````````````````````````````` - - -```````````````````````````````` example - foo -→bar -. -<pre><code>foo -bar -</code></pre> -```````````````````````````````` - -```````````````````````````````` example - - foo - - bar -→ - baz -. -<ul> -<li>foo -<ul> -<li>bar -<ul> -<li>baz</li> -</ul> -</li> -</ul> -</li> -</ul> -```````````````````````````````` - -```````````````````````````````` example -#→Foo -. -<h1>Foo</h1> -```````````````````````````````` - -```````````````````````````````` example -*→*→*→ -. -<hr /> -```````````````````````````````` - - -## Insecure characters - -For security reasons, the Unicode character `U+0000` must be replaced -with the REPLACEMENT CHARACTER (`U+FFFD`). - -# Blocks and inlines - -We can think of a document as a sequence of -[blocks](@)---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 [inline](@) content---text, -links, emphasized text, images, code spans, and so on. - -## Precedence - -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: - -```````````````````````````````` example -- `one -- two` -. -<ul> -<li>`one</li> -<li>two`</li> -</ul> -```````````````````````````````` - - -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 -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. - -## Container blocks and leaf blocks - -We can divide blocks into two types: -[container blocks](@), -which can contain other blocks, and [leaf blocks](@), -which cannot. - -# Leaf blocks - -This section describes the different kinds of leaf block that make up a -Markdown document. - -## Thematic breaks - -A line consisting of 0-3 spaces of indentation, followed by a sequence -of three or more matching `-`, `_`, or `*` characters, each followed -optionally by any number of spaces or tabs, forms a -[thematic break](@). - -```````````````````````````````` example -*** ---- -___ -. -<hr /> -<hr /> -<hr /> -```````````````````````````````` - - -Wrong characters: - -```````````````````````````````` example -+++ -. -<p>+++</p> -```````````````````````````````` - - -```````````````````````````````` example -=== -. -<p>===</p> -```````````````````````````````` - - -Not enough characters: - -```````````````````````````````` example --- -** -__ -. -<p>-- -** -__</p> -```````````````````````````````` - - -One to three spaces indent are allowed: - -```````````````````````````````` example - *** - *** - *** -. -<hr /> -<hr /> -<hr /> -```````````````````````````````` - - -Four spaces is too many: - -```````````````````````````````` example - *** -. -<pre><code>*** -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example -Foo - *** -. -<p>Foo -***</p> -```````````````````````````````` - - -More than three characters may be used: - -```````````````````````````````` example -_____________________________________ -. -<hr /> -```````````````````````````````` - - -Spaces are allowed between the characters: - -```````````````````````````````` example - - - - -. -<hr /> -```````````````````````````````` - - -```````````````````````````````` example - ** * ** * ** * ** -. -<hr /> -```````````````````````````````` - - -```````````````````````````````` example -- - - - -. -<hr /> -```````````````````````````````` - - -Spaces are allowed at the end: - -```````````````````````````````` example -- - - - -. -<hr /> -```````````````````````````````` - - -However, no other characters may occur in the line: - -```````````````````````````````` example -_ _ _ _ a - -a------ - ----a--- -. -<p>_ _ _ _ a</p> -<p>a------</p> -<p>---a---</p> -```````````````````````````````` - - -It is required that all of the [non-whitespace characters] be the same. -So, this is not a thematic break: - -```````````````````````````````` example - *-* -. -<p><em>-</em></p> -```````````````````````````````` - - -Thematic breaks do not need blank lines before or after: - -```````````````````````````````` example -- foo -*** -- bar -. -<ul> -<li>foo</li> -</ul> -<hr /> -<ul> -<li>bar</li> -</ul> -```````````````````````````````` - - -Thematic breaks can interrupt a paragraph: - -```````````````````````````````` example -Foo -*** -bar -. -<p>Foo</p> -<hr /> -<p>bar</p> -```````````````````````````````` - - -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: - -```````````````````````````````` example -Foo ---- -bar -. -<h2>Foo</h2> -<p>bar</p> -```````````````````````````````` - - -When both a thematic break and a list item are possible -interpretations of a line, the thematic break takes precedence: - -```````````````````````````````` example -* Foo -* * * -* Bar -. -<ul> -<li>Foo</li> -</ul> -<hr /> -<ul> -<li>Bar</li> -</ul> -```````````````````````````````` - - -If you want a thematic break in a list item, use a different bullet: - -```````````````````````````````` example -- Foo -- * * * -. -<ul> -<li>Foo</li> -<li> -<hr /> -</li> -</ul> -```````````````````````````````` - - -## ATX headings - -An [ATX heading](@) -consists of a string of characters, parsed as inline content, between an -opening sequence of 1--6 unescaped `#` characters and an optional -closing sequence of any number of unescaped `#` characters. -The opening sequence of `#` characters must be followed by a -[space] or by the end of line. The optional closing sequence of `#`s must be -preceded by a [space] and may be followed by spaces only. The opening -`#` character may be indented 0-3 spaces. The raw contents of the -heading are stripped of leading and trailing spaces before being parsed -as inline content. The heading level is equal to the number of `#` -characters in the opening sequence. - -Simple headings: - -```````````````````````````````` example -# foo -## foo -### foo -#### foo -##### foo -###### foo -. -<h1>foo</h1> -<h2>foo</h2> -<h3>foo</h3> -<h4>foo</h4> -<h5>foo</h5> -<h6>foo</h6> -```````````````````````````````` - - -More than six `#` characters is not a heading: - -```````````````````````````````` example -####### foo -. -<p>####### foo</p> -```````````````````````````````` - - -At least one space is required between the `#` 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 -[original ATX implementation](http://www.aaronsw.com/2002/atx/atx.py), -and it helps prevent things like the following from being parsed as -headings: - -```````````````````````````````` example -#5 bolt - -#hashtag -. -<p>#5 bolt</p> -<p>#hashtag</p> -```````````````````````````````` - - -This is not a heading, because the first `#` is escaped: - -```````````````````````````````` example -\## foo -. -<p>## foo</p> -```````````````````````````````` - - -Contents are parsed as inlines: - -```````````````````````````````` example -# foo *bar* \*baz\* -. -<h1>foo <em>bar</em> *baz*</h1> -```````````````````````````````` - - -Leading and trailing [whitespace] is ignored in parsing inline content: - -```````````````````````````````` example -# foo -. -<h1>foo</h1> -```````````````````````````````` - - -One to three spaces indentation are allowed: - -```````````````````````````````` example - ### foo - ## foo - # foo -. -<h3>foo</h3> -<h2>foo</h2> -<h1>foo</h1> -```````````````````````````````` - - -Four spaces are too much: - -```````````````````````````````` example - # foo -. -<pre><code># foo -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example -foo - # bar -. -<p>foo -# bar</p> -```````````````````````````````` - - -A closing sequence of `#` characters is optional: - -```````````````````````````````` example -## foo ## - ### bar ### -. -<h2>foo</h2> -<h3>bar</h3> -```````````````````````````````` - - -It need not be the same length as the opening sequence: - -```````````````````````````````` example -# foo ################################## -##### foo ## -. -<h1>foo</h1> -<h5>foo</h5> -```````````````````````````````` - - -Spaces are allowed after the closing sequence: - -```````````````````````````````` example -### foo ### -. -<h3>foo</h3> -```````````````````````````````` - - -A sequence of `#` characters with anything but [spaces] following it -is not a closing sequence, but counts as part of the contents of the -heading: - -```````````````````````````````` example -### foo ### b -. -<h3>foo ### b</h3> -```````````````````````````````` - - -The closing sequence must be preceded by a space: - -```````````````````````````````` example -# foo# -. -<h1>foo#</h1> -```````````````````````````````` - - -Backslash-escaped `#` characters do not count as part -of the closing sequence: - -```````````````````````````````` example -### foo \### -## foo #\## -# foo \# -. -<h3>foo ###</h3> -<h2>foo ###</h2> -<h1>foo #</h1> -```````````````````````````````` - - -ATX headings need not be separated from surrounding content by blank -lines, and they can interrupt paragraphs: - -```````````````````````````````` example -**** -## foo -**** -. -<hr /> -<h2>foo</h2> -<hr /> -```````````````````````````````` - - -```````````````````````````````` example -Foo bar -# baz -Bar foo -. -<p>Foo bar</p> -<h1>baz</h1> -<p>Bar foo</p> -```````````````````````````````` - - -ATX headings can be empty: - -```````````````````````````````` example -## -# -### ### -. -<h2></h2> -<h1></h1> -<h3></h3> -```````````````````````````````` - - -## Setext headings - -A [setext heading](@) 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 -that, were they not followed by the setext heading underline, -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]. - -A [setext heading underline](@) is a sequence of -`=` characters or a sequence of `-` characters, with no more than 3 -spaces indentation and any number of trailing spaces. If a line -containing a single `-` can be interpreted as an -empty [list items], it should be interpreted this way -and not as a [setext heading underline]. - -The heading is a level 1 heading if `=` characters are used in -the [setext heading underline], and a level 2 heading if `-` -characters are used. The contents of the heading are the result -of parsing the preceding lines of text as CommonMark inline -content. - -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. - -Simple examples: - -```````````````````````````````` example -Foo *bar* -========= - -Foo *bar* ---------- -. -<h1>Foo <em>bar</em></h1> -<h2>Foo <em>bar</em></h2> -```````````````````````````````` - - -The content of the header may span more than one line: - -```````````````````````````````` example -Foo *bar -baz* -==== -. -<h1>Foo <em>bar -baz</em></h1> -```````````````````````````````` - -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]. - -```````````````````````````````` example - Foo *bar -baz*→ -==== -. -<h1>Foo <em>bar -baz</em></h1> -```````````````````````````````` - - -The underlining can be any length: - -```````````````````````````````` example -Foo -------------------------- - -Foo -= -. -<h2>Foo</h2> -<h1>Foo</h1> -```````````````````````````````` - - -The heading content can be indented up to three spaces, and need -not line up with the underlining: - -```````````````````````````````` example - Foo ---- - - Foo ------ - - Foo - === -. -<h2>Foo</h2> -<h2>Foo</h2> -<h1>Foo</h1> -```````````````````````````````` - - -Four spaces indent is too much: - -```````````````````````````````` example - Foo - --- - - Foo ---- -. -<pre><code>Foo ---- - -Foo -</code></pre> -<hr /> -```````````````````````````````` - - -The setext heading underline can be indented up to three spaces, and -may have trailing spaces: - -```````````````````````````````` example -Foo - ---- -. -<h2>Foo</h2> -```````````````````````````````` - - -Four spaces is too much: - -```````````````````````````````` example -Foo - --- -. -<p>Foo ----</p> -```````````````````````````````` - - -The setext heading underline cannot contain internal spaces: - -```````````````````````````````` example -Foo -= = - -Foo ---- - -. -<p>Foo -= =</p> -<p>Foo</p> -<hr /> -```````````````````````````````` - - -Trailing spaces in the content line do not cause a line break: - -```````````````````````````````` example -Foo ------ -. -<h2>Foo</h2> -```````````````````````````````` - - -Nor does a backslash at the end: - -```````````````````````````````` example -Foo\ ----- -. -<h2>Foo\</h2> -```````````````````````````````` - - -Since indicators of block structure take precedence over -indicators of inline structure, the following are setext headings: - -```````````````````````````````` example -`Foo ----- -` - -<a title="a lot ---- -of dashes"/> -. -<h2>`Foo</h2> -<p>`</p> -<h2><a title="a lot</h2> -<p>of dashes"/></p> -```````````````````````````````` - - -The setext heading underline cannot be a [lazy continuation -line] in a list item or block quote: - -```````````````````````````````` example -> Foo ---- -. -<blockquote> -<p>Foo</p> -</blockquote> -<hr /> -```````````````````````````````` - - -```````````````````````````````` example -> foo -bar -=== -. -<blockquote> -<p>foo -bar -===</p> -</blockquote> -```````````````````````````````` - - -```````````````````````````````` example -- Foo ---- -. -<ul> -<li>Foo</li> -</ul> -<hr /> -```````````````````````````````` - - -A blank line is needed between a paragraph and a following -setext heading, since otherwise the paragraph becomes part -of the heading's content: - -```````````````````````````````` example -Foo -Bar ---- -. -<h2>Foo -Bar</h2> -```````````````````````````````` - - -But in general a blank line is not required before or after -setext headings: - -```````````````````````````````` example ---- -Foo ---- -Bar ---- -Baz -. -<hr /> -<h2>Foo</h2> -<h2>Bar</h2> -<p>Baz</p> -```````````````````````````````` - - -Setext headings cannot be empty: - -```````````````````````````````` example - -==== -. -<p>====</p> -```````````````````````````````` - - -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: - -```````````````````````````````` example ---- ---- -. -<hr /> -<hr /> -```````````````````````````````` - - -```````````````````````````````` example -- foo ------ -. -<ul> -<li>foo</li> -</ul> -<hr /> -```````````````````````````````` - - -```````````````````````````````` example - foo ---- -. -<pre><code>foo -</code></pre> -<hr /> -```````````````````````````````` - - -```````````````````````````````` example -> foo ------ -. -<blockquote> -<p>foo</p> -</blockquote> -<hr /> -```````````````````````````````` - - -If you want a heading with `> foo` as its literal text, you can -use backslash escapes: - -```````````````````````````````` example -\> foo ------- -. -<h2>> foo</h2> -```````````````````````````````` - - -**Compatibility note:** 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 - -``` markdown -Foo -bar ---- -baz -``` - -One can find four different interpretations: - -1. paragraph "Foo", heading "bar", paragraph "baz" -2. paragraph "Foo bar", thematic break, paragraph "baz" -3. paragraph "Foo bar --- baz" -4. heading "Foo bar", paragraph "baz" - -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: - -```````````````````````````````` example -Foo - -bar ---- -baz -. -<p>Foo</p> -<h2>bar</h2> -<p>baz</p> -```````````````````````````````` - - -Authors who want interpretation 2 can put blank lines around -the thematic break, - -```````````````````````````````` example -Foo -bar - ---- - -baz -. -<p>Foo -bar</p> -<hr /> -<p>baz</p> -```````````````````````````````` - - -or use a thematic break that cannot count as a [setext heading -underline], such as - -```````````````````````````````` example -Foo -bar -* * * -baz -. -<p>Foo -bar</p> -<hr /> -<p>baz</p> -```````````````````````````````` - - -Authors who want interpretation 3 can use backslash escapes: - -```````````````````````````````` example -Foo -bar -\--- -baz -. -<p>Foo -bar ---- -baz</p> -```````````````````````````````` - - -## Indented code blocks - -An [indented code block](@) is composed of one or more -[indented chunks] separated by blank lines. -An [indented chunk](@) 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]. - -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.) - -```````````````````````````````` example - a simple - indented code block -. -<pre><code>a simple - indented code block -</code></pre> -```````````````````````````````` - - -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: - -```````````````````````````````` example - - foo - - bar -. -<ul> -<li> -<p>foo</p> -<p>bar</p> -</li> -</ul> -```````````````````````````````` - - -```````````````````````````````` example -1. foo - - - bar -. -<ol> -<li> -<p>foo</p> -<ul> -<li>bar</li> -</ul> -</li> -</ol> -```````````````````````````````` - - - -The contents of a code block are literal text, and do not get parsed -as Markdown: - -```````````````````````````````` example - <a/> - *hi* - - - one -. -<pre><code><a/> -*hi* - -- one -</code></pre> -```````````````````````````````` - - -Here we have three chunks separated by blank lines: - -```````````````````````````````` example - chunk1 - - chunk2 - - - - chunk3 -. -<pre><code>chunk1 - -chunk2 - - - -chunk3 -</code></pre> -```````````````````````````````` - - -Any initial spaces beyond four will be included in the content, even -in interior blank lines: - -```````````````````````````````` example - chunk1 - - chunk2 -. -<pre><code>chunk1 - - chunk2 -</code></pre> -```````````````````````````````` - - -An indented code block cannot interrupt a paragraph. (This -allows hanging indents and the like.) - -```````````````````````````````` example -Foo - bar - -. -<p>Foo -bar</p> -```````````````````````````````` - - -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: - -```````````````````````````````` example - foo -bar -. -<pre><code>foo -</code></pre> -<p>bar</p> -```````````````````````````````` - - -And indented code can occur immediately before and after other kinds of -blocks: - -```````````````````````````````` example -# Heading - foo -Heading ------- - foo ----- -. -<h1>Heading</h1> -<pre><code>foo -</code></pre> -<h2>Heading</h2> -<pre><code>foo -</code></pre> -<hr /> -```````````````````````````````` - - -The first line can be indented more than four spaces: - -```````````````````````````````` example - foo - bar -. -<pre><code> foo -bar -</code></pre> -```````````````````````````````` - - -Blank lines preceding or following an indented code block -are not included in it: - -```````````````````````````````` example - - - foo - - -. -<pre><code>foo -</code></pre> -```````````````````````````````` - - -Trailing spaces are included in the code block's content: - -```````````````````````````````` example - foo -. -<pre><code>foo -</code></pre> -```````````````````````````````` - - - -## Fenced code blocks - -A [code fence](@) is a sequence -of at least three consecutive backtick characters (`` ` ``) or -tildes (`~`). (Tildes and backticks cannot be mixed.) -A [fenced code block](@) -begins with a code fence, indented no more than three spaces. - -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 [info string](@). 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.) - -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 -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.) - -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 -opening code fence until the end of the containing block (or -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.) - -A fenced code block may interrupt a paragraph, and does not require -a blank line either before or after. - -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 `class` -attribute of the `code` tag. However, this spec does not mandate any -particular treatment of the [info string]. - -Here is a simple example with backticks: - -```````````````````````````````` example -``` -< - > -``` -. -<pre><code>< - > -</code></pre> -```````````````````````````````` - - -With tildes: - -```````````````````````````````` example -~~~ -< - > -~~~ -. -<pre><code>< - > -</code></pre> -```````````````````````````````` - -Fewer than three backticks is not enough: - -```````````````````````````````` example -`` -foo -`` -. -<p><code>foo</code></p> -```````````````````````````````` - -The closing code fence must use the same character as the opening -fence: - -```````````````````````````````` example -``` -aaa -~~~ -``` -. -<pre><code>aaa -~~~ -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example -~~~ -aaa -``` -~~~ -. -<pre><code>aaa -``` -</code></pre> -```````````````````````````````` - - -The closing code fence must be at least as long as the opening fence: - -```````````````````````````````` example -```` -aaa -``` -`````` -. -<pre><code>aaa -``` -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example -~~~~ -aaa -~~~ -~~~~ -. -<pre><code>aaa -~~~ -</code></pre> -```````````````````````````````` - - -Unclosed code blocks are closed by the end of the document -(or the enclosing [block quote][block quotes] or [list item][list items]): - -```````````````````````````````` example -``` -. -<pre><code></code></pre> -```````````````````````````````` - - -```````````````````````````````` example -````` - -``` -aaa -. -<pre><code> -``` -aaa -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example -> ``` -> aaa - -bbb -. -<blockquote> -<pre><code>aaa -</code></pre> -</blockquote> -<p>bbb</p> -```````````````````````````````` - - -A code block can have all empty lines as its content: - -```````````````````````````````` example -``` - - -``` -. -<pre><code> - -</code></pre> -```````````````````````````````` - - -A code block can be empty: - -```````````````````````````````` example -``` -``` -. -<pre><code></code></pre> -```````````````````````````````` - - -Fences can be indented. If the opening fence is indented, -content lines will have equivalent opening indentation removed, -if present: - -```````````````````````````````` example - ``` - aaa -aaa -``` -. -<pre><code>aaa -aaa -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example - ``` -aaa - aaa -aaa - ``` -. -<pre><code>aaa -aaa -aaa -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example - ``` - aaa - aaa - aaa - ``` -. -<pre><code>aaa - aaa -aaa -</code></pre> -```````````````````````````````` - - -Four spaces indentation produces an indented code block: - -```````````````````````````````` example - ``` - aaa - ``` -. -<pre><code>``` -aaa -``` -</code></pre> -```````````````````````````````` - - -Closing fences may be indented by 0-3 spaces, and their indentation -need not match that of the opening fence: - -```````````````````````````````` example -``` -aaa - ``` -. -<pre><code>aaa -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example - ``` -aaa - ``` -. -<pre><code>aaa -</code></pre> -```````````````````````````````` - - -This is not a closing fence, because it is indented 4 spaces: - -```````````````````````````````` example -``` -aaa - ``` -. -<pre><code>aaa - ``` -</code></pre> -```````````````````````````````` - - - -Code fences (opening and closing) cannot contain internal spaces: - -```````````````````````````````` example -``` ``` -aaa -. -<p><code> </code> -aaa</p> -```````````````````````````````` - - -```````````````````````````````` example -~~~~~~ -aaa -~~~ ~~ -. -<pre><code>aaa -~~~ ~~ -</code></pre> -```````````````````````````````` - - -Fenced code blocks can interrupt paragraphs, and can be followed -directly by paragraphs, without a blank line between: - -```````````````````````````````` example -foo -``` -bar -``` -baz -. -<p>foo</p> -<pre><code>bar -</code></pre> -<p>baz</p> -```````````````````````````````` - - -Other blocks can also occur before and after fenced code blocks -without an intervening blank line: - -```````````````````````````````` example -foo ---- -~~~ -bar -~~~ -# baz -. -<h2>foo</h2> -<pre><code>bar -</code></pre> -<h1>baz</h1> -```````````````````````````````` - - -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` element consisting -of `language-` followed by the language name. - -```````````````````````````````` example -```ruby -def foo(x) - return 3 -end -``` -. -<pre><code class="language-ruby">def foo(x) - return 3 -end -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example -~~~~ ruby startline=3 $%@#$ -def foo(x) - return 3 -end -~~~~~~~ -. -<pre><code class="language-ruby">def foo(x) - return 3 -end -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example -````; -```` -. -<pre><code class="language-;"></code></pre> -```````````````````````````````` - - -[Info strings] for backtick code blocks cannot contain backticks: - -```````````````````````````````` example -``` aa ``` -foo -. -<p><code>aa</code> -foo</p> -```````````````````````````````` - - -[Info strings] for tilde code blocks can contain backticks and tildes: - -```````````````````````````````` example -~~~ aa ``` ~~~ -foo -~~~ -. -<pre><code class="language-aa">foo -</code></pre> -```````````````````````````````` - - -Closing code fences cannot have [info strings]: - -```````````````````````````````` example -``` -``` aaa -``` -. -<pre><code>``` aaa -</code></pre> -```````````````````````````````` - - - -## HTML blocks - -An [HTML block](@) is a group of lines that is treated -as raw HTML (and will not be escaped in HTML output). - -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 -[start condition](@) (after up to three spaces optional indentation). -It ends with the first subsequent line that meets a matching [end -condition](@), or the last line of the document, or the last line of -the [container block](#container-blocks) 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. - -1. **Start condition:** line begins with the string `<script`, -`<pre`, or `<style` (case-insensitive), followed by whitespace, -the string `>`, or the end of the line.\ -**End condition:** line contains an end tag -`</script>`, `</pre>`, or `</style>` (case-insensitive; it -need not match the start tag). - -2. **Start condition:** line begins with the string `<!--`.\ -**End condition:** line contains the string `-->`. - -3. **Start condition:** line begins with the string `<?`.\ -**End condition:** line contains the string `?>`. - -4. **Start condition:** line begins with the string `<!` -followed by an uppercase ASCII letter.\ -**End condition:** line contains the character `>`. - -5. **Start condition:** line begins with the string -`<![CDATA[`.\ -**End condition:** line contains the string `]]>`. - -6. **Start condition:** line begins the string `<` or `</` -followed by one of the strings (case-insensitive) `address`, -`article`, `aside`, `base`, `basefont`, `blockquote`, `body`, -`caption`, `center`, `col`, `colgroup`, `dd`, `details`, `dialog`, -`dir`, `div`, `dl`, `dt`, `fieldset`, `figcaption`, `figure`, -`footer`, `form`, `frame`, `frameset`, -`h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `head`, `header`, `hr`, -`html`, `iframe`, `legend`, `li`, `link`, `main`, `menu`, `menuitem`, -`nav`, `noframes`, `ol`, `optgroup`, `option`, `p`, `param`, -`section`, `summary`, `table`, `tbody`, `td`, -`tfoot`, `th`, `thead`, `title`, `tr`, `track`, `ul`, followed -by [whitespace], the end of the line, the string `>`, or -the string `/>`.\ -**End condition:** line is followed by a [blank line]. - -7. **Start condition:** line begins with a complete [open tag] -(with any [tag name] other than `script`, -`style`, or `pre`) or a complete [closing tag], -followed only by [whitespace] or the end of the line.\ -**End condition:** line is followed by a [blank line]. - -HTML blocks continue until they are closed by their appropriate -[end condition], or the last line of the document or other [container -block](#container-blocks). This means any HTML **within an HTML -block** 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. - -For instance, `<pre>` within a HTML block started by `<table>` 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: - -```````````````````````````````` example -<table><tr><td> -<pre> -**Hello**, - -_world_. -</pre> -</td></tr></table> -. -<table><tr><td> -<pre> -**Hello**, -<p><em>world</em>. -</pre></p> -</td></tr></table> -```````````````````````````````` - -In this case, the HTML block is terminated by the newline — the `**Hello**` -text remains verbatim — and regular parsing resumes, with a paragraph, -emphasised `world` and inline and block HTML following. - -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.) - -Some simple examples follow. Here are some basic HTML blocks -of type 6: - -```````````````````````````````` example -<table> - <tr> - <td> - hi - </td> - </tr> -</table> - -okay. -. -<table> - <tr> - <td> - hi - </td> - </tr> -</table> -<p>okay.</p> -```````````````````````````````` - - -```````````````````````````````` example - <div> - *hello* - <foo><a> -. - <div> - *hello* - <foo><a> -```````````````````````````````` - - -A block can also start with a closing tag: - -```````````````````````````````` example -</div> -*foo* -. -</div> -*foo* -```````````````````````````````` - - -Here we have two HTML blocks with a Markdown paragraph between them: - -```````````````````````````````` example -<DIV CLASS="foo"> - -*Markdown* - -</DIV> -. -<DIV CLASS="foo"> -<p><em>Markdown</em></p> -</DIV> -```````````````````````````````` - - -The tag on the first line can be partial, as long -as it is split where there would be whitespace: - -```````````````````````````````` example -<div id="foo" - class="bar"> -</div> -. -<div id="foo" - class="bar"> -</div> -```````````````````````````````` - - -```````````````````````````````` example -<div id="foo" class="bar - baz"> -</div> -. -<div id="foo" class="bar - baz"> -</div> -```````````````````````````````` - - -An open tag need not be closed: -```````````````````````````````` example -<div> -*foo* - -*bar* -. -<div> -*foo* -<p><em>bar</em></p> -```````````````````````````````` - - - -A partial tag need not even be completed (garbage -in, garbage out): - -```````````````````````````````` example -<div id="foo" -*hi* -. -<div id="foo" -*hi* -```````````````````````````````` - - -```````````````````````````````` example -<div class -foo -. -<div class -foo -```````````````````````````````` - - -The initial tag doesn't even need to be a valid -tag, as long as it starts like one: - -```````````````````````````````` example -<div *???-&&&-<--- -*foo* -. -<div *???-&&&-<--- -*foo* -```````````````````````````````` - - -In type 6 blocks, the initial tag need not be on a line by -itself: - -```````````````````````````````` example -<div><a href="bar">*foo*</a></div> -. -<div><a href="bar">*foo*</a></div> -```````````````````````````````` - - -```````````````````````````````` example -<table><tr><td> -foo -</td></tr></table> -. -<table><tr><td> -foo -</td></tr></table> -```````````````````````````````` - - -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: - -```````````````````````````````` example -<div></div> -``` c -int x = 33; -``` -. -<div></div> -``` c -int x = 33; -``` -```````````````````````````````` - - -To start an [HTML block] with a tag that is *not* 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): - -```````````````````````````````` example -<a href="foo"> -*bar* -</a> -. -<a href="foo"> -*bar* -</a> -```````````````````````````````` - - -In type 7 blocks, the [tag name] can be anything: - -```````````````````````````````` example -<Warning> -*bar* -</Warning> -. -<Warning> -*bar* -</Warning> -```````````````````````````````` - - -```````````````````````````````` example -<i class="foo"> -*bar* -</i> -. -<i class="foo"> -*bar* -</i> -```````````````````````````````` - - -```````````````````````````````` example -</ins> -*bar* -. -</ins> -*bar* -```````````````````````````````` - - -These rules are designed to allow us to work with tags that -can function as either block-level or inline-level tags. -The `<del>` tag is a nice example. We can surround content with -`<del>` tags in three different ways. In this case, we get a raw -HTML block, because the `<del>` tag is on a line by itself: - -```````````````````````````````` example -<del> -*foo* -</del> -. -<del> -*foo* -</del> -```````````````````````````````` - - -In this case, we get a raw HTML block that just includes -the `<del>` tag (because it ends with the following blank -line). So the contents get interpreted as CommonMark: - -```````````````````````````````` example -<del> - -*foo* - -</del> -. -<del> -<p><em>foo</em></p> -</del> -```````````````````````````````` - - -Finally, in this case, the `<del>` tags are interpreted -as [raw HTML] *inside* the CommonMark paragraph. (Because -the tag is not on a line by itself, we get inline HTML -rather than an [HTML block].) - -```````````````````````````````` example -<del>*foo*</del> -. -<p><del><em>foo</em></del></p> -```````````````````````````````` - - -HTML tags designed to contain literal content -(`script`, `style`, `pre`), 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: - -A pre tag (type 1): - -```````````````````````````````` example -<pre language="haskell"><code> -import Text.HTML.TagSoup - -main :: IO () -main = print $ parseTags tags -</code></pre> -okay -. -<pre language="haskell"><code> -import Text.HTML.TagSoup - -main :: IO () -main = print $ parseTags tags -</code></pre> -<p>okay</p> -```````````````````````````````` - - -A script tag (type 1): - -```````````````````````````````` example -<script type="text/javascript"> -// JavaScript example - -document.getElementById("demo").innerHTML = "Hello JavaScript!"; -</script> -okay -. -<script type="text/javascript"> -// JavaScript example - -document.getElementById("demo").innerHTML = "Hello JavaScript!"; -</script> -<p>okay</p> -```````````````````````````````` - - -A style tag (type 1): - -```````````````````````````````` example -<style - type="text/css"> -h1 {color:red;} - -p {color:blue;} -</style> -okay -. -<style - type="text/css"> -h1 {color:red;} - -p {color:blue;} -</style> -<p>okay</p> -```````````````````````````````` - - -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]): - -```````````````````````````````` example -<style - type="text/css"> - -foo -. -<style - type="text/css"> - -foo -```````````````````````````````` - - -```````````````````````````````` example -> <div> -> foo - -bar -. -<blockquote> -<div> -foo -</blockquote> -<p>bar</p> -```````````````````````````````` - - -```````````````````````````````` example -- <div> -- foo -. -<ul> -<li> -<div> -</li> -<li>foo</li> -</ul> -```````````````````````````````` - - -The end tag can occur on the same line as the start tag: - -```````````````````````````````` example -<style>p{color:red;}</style> -*foo* -. -<style>p{color:red;}</style> -<p><em>foo</em></p> -```````````````````````````````` - - -```````````````````````````````` example -<!-- foo -->*bar* -*baz* -. -<!-- foo -->*bar* -<p><em>baz</em></p> -```````````````````````````````` - - -Note that anything on the last line after the -end tag will be included in the [HTML block]: - -```````````````````````````````` example -<script> -foo -</script>1. *bar* -. -<script> -foo -</script>1. *bar* -```````````````````````````````` - - -A comment (type 2): - -```````````````````````````````` example -<!-- Foo - -bar - baz --> -okay -. -<!-- Foo - -bar - baz --> -<p>okay</p> -```````````````````````````````` - - - -A processing instruction (type 3): - -```````````````````````````````` example -<?php - - echo '>'; - -?> -okay -. -<?php - - echo '>'; - -?> -<p>okay</p> -```````````````````````````````` - - -A declaration (type 4): - -```````````````````````````````` example -<!DOCTYPE html> -. -<!DOCTYPE html> -```````````````````````````````` - - -CDATA (type 5): - -```````````````````````````````` example -<![CDATA[ -function matchwo(a,b) -{ - if (a < b && a < 0) then { - return 1; - - } else { - - return 0; - } -} -]]> -okay -. -<![CDATA[ -function matchwo(a,b) -{ - if (a < b && a < 0) then { - return 1; - - } else { - - return 0; - } -} -]]> -<p>okay</p> -```````````````````````````````` - - -The opening tag can be indented 1-3 spaces, but not 4: - -```````````````````````````````` example - <!-- foo --> - - <!-- foo --> -. - <!-- foo --> -<pre><code><!-- foo --> -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example - <div> - - <div> -. - <div> -<pre><code><div> -</code></pre> -```````````````````````````````` - - -An HTML block of types 1--6 can interrupt a paragraph, and need not be -preceded by a blank line. - -```````````````````````````````` example -Foo -<div> -bar -</div> -. -<p>Foo</p> -<div> -bar -</div> -```````````````````````````````` - - -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]: - -```````````````````````````````` example -<div> -bar -</div> -*foo* -. -<div> -bar -</div> -*foo* -```````````````````````````````` - - -HTML blocks of type 7 cannot interrupt a paragraph: - -```````````````````````````````` example -Foo -<a href="bar"> -baz -. -<p>Foo -<a href="bar"> -baz</p> -```````````````````````````````` - - -This rule differs from John Gruber's original Markdown syntax -specification, which says: - -> The only restrictions are that block-level HTML elements — -> e.g. `<div>`, `<table>`, `<pre>`, `<p>`, 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. - -In some ways Gruber's rule is more restrictive than the one given -here: - -- It requires that an HTML block be preceded by a blank line. -- It does not allow the start tag to be indented. -- It requires a matching end tag, which it also does not allow to - be indented. - -Most Markdown implementations (including some of Gruber's own) do not -respect all of these restrictions. - -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 -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: - -Compare: - -```````````````````````````````` example -<div> - -*Emphasized* text. - -</div> -. -<div> -<p><em>Emphasized</em> text.</p> -</div> -```````````````````````````````` - - -```````````````````````````````` example -<div> -*Emphasized* text. -</div> -. -<div> -*Emphasized* text. -</div> -```````````````````````````````` - - -Some Markdown implementations have adopted a convention of -interpreting content inside tags as text if the open tag has -the attribute `markdown=1`. The rule given above seems a simpler and -more elegant way of achieving the same expressive power, which is also -much simpler to parse. - -The main potential drawback is that one can no longer paste HTML -blocks into Markdown documents with 100% reliability. However, -*in most cases* this will work fine, because the blank lines in -HTML are usually followed by HTML block tags. For example: - -```````````````````````````````` example -<table> - -<tr> - -<td> -Hi -</td> - -</tr> - -</table> -. -<table> -<tr> -<td> -Hi -</td> -</tr> -</table> -```````````````````````````````` - - -There are problems, however, if the inner tags are indented -*and* separated by spaces, as then they will be interpreted as -an indented code block: - -```````````````````````````````` example -<table> - - <tr> - - <td> - Hi - </td> - - </tr> - -</table> -. -<table> - <tr> -<pre><code><td> - Hi -</td> -</code></pre> - </tr> -</table> -```````````````````````````````` - - -Fortunately, blank lines are usually not necessary and can be -deleted. The exception is inside `<pre>` tags, but as described -[above][HTML blocks], raw HTML blocks starting with `<pre>` -*can* contain blank lines. - -## Link reference definitions - -A [link reference definition](@) -consists of a [link label], indented up to three spaces, followed -by a colon (`:`), optional [whitespace] (including up to one -[line ending]), a [link destination], -optional [whitespace] (including up to one -[line ending]), and an optional [link -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. - -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. - -```````````````````````````````` example -[foo]: /url "title" - -[foo] -. -<p><a href="/url" title="title">foo</a></p> -```````````````````````````````` - - -```````````````````````````````` example - [foo]: - /url - 'the title' - -[foo] -. -<p><a href="/url" title="the title">foo</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[Foo*bar\]]:my_(url) 'title (with parens)' - -[Foo*bar\]] -. -<p><a href="my_(url)" title="title (with parens)">Foo*bar]</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[Foo bar]: -<my url> -'title' - -[Foo bar] -. -<p><a href="my%20url" title="title">Foo bar</a></p> -```````````````````````````````` - - -The title may extend over multiple lines: - -```````````````````````````````` example -[foo]: /url ' -title -line1 -line2 -' - -[foo] -. -<p><a href="/url" title=" -title -line1 -line2 -">foo</a></p> -```````````````````````````````` - - -However, it may not contain a [blank line]: - -```````````````````````````````` example -[foo]: /url 'title - -with blank line' - -[foo] -. -<p>[foo]: /url 'title</p> -<p>with blank line'</p> -<p>[foo]</p> -```````````````````````````````` - - -The title may be omitted: - -```````````````````````````````` example -[foo]: -/url - -[foo] -. -<p><a href="/url">foo</a></p> -```````````````````````````````` - - -The link destination may not be omitted: - -```````````````````````````````` example -[foo]: - -[foo] -. -<p>[foo]:</p> -<p>[foo]</p> -```````````````````````````````` - - However, an empty link destination may be specified using - angle brackets: - -```````````````````````````````` example -[foo]: <> - -[foo] -. -<p><a href="">foo</a></p> -```````````````````````````````` - -The title must be separated from the link destination by -whitespace: - -```````````````````````````````` example -[foo]: <bar>(baz) - -[foo] -. -<p>[foo]: <bar>(baz)</p> -<p>[foo]</p> -```````````````````````````````` - - -Both title and destination can contain backslash escapes -and literal backslashes: - -```````````````````````````````` example -[foo]: /url\bar\*baz "foo\"bar\baz" - -[foo] -. -<p><a href="/url%5Cbar*baz" title="foo"bar\baz">foo</a></p> -```````````````````````````````` - - -A link can come before its corresponding definition: - -```````````````````````````````` example -[foo] - -[foo]: url -. -<p><a href="url">foo</a></p> -```````````````````````````````` - - -If there are several matching definitions, the first one takes -precedence: - -```````````````````````````````` example -[foo] - -[foo]: first -[foo]: second -. -<p><a href="first">foo</a></p> -```````````````````````````````` - - -As noted in the section on [Links], matching of labels is -case-insensitive (see [matches]). - -```````````````````````````````` example -[FOO]: /url - -[Foo] -. -<p><a href="/url">Foo</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[ΑΓΩ]: /φου - -[αγω] -. -<p><a href="/%CF%86%CE%BF%CF%85">αγω</a></p> -```````````````````````````````` - - -Here is a link reference definition with no corresponding link. -It contributes nothing to the document. - -```````````````````````````````` example -[foo]: /url -. -```````````````````````````````` - - -Here is another one: - -```````````````````````````````` example -[ -foo -]: /url -bar -. -<p>bar</p> -```````````````````````````````` - - -This is not a link reference definition, because there are -[non-whitespace characters] after the title: - -```````````````````````````````` example -[foo]: /url "title" ok -. -<p>[foo]: /url "title" ok</p> -```````````````````````````````` - - -This is a link reference definition, but it has no title: - -```````````````````````````````` example -[foo]: /url -"title" ok -. -<p>"title" ok</p> -```````````````````````````````` - - -This is not a link reference definition, because it is indented -four spaces: - -```````````````````````````````` example - [foo]: /url "title" - -[foo] -. -<pre><code>[foo]: /url "title" -</code></pre> -<p>[foo]</p> -```````````````````````````````` - - -This is not a link reference definition, because it occurs inside -a code block: - -```````````````````````````````` example -``` -[foo]: /url -``` - -[foo] -. -<pre><code>[foo]: /url -</code></pre> -<p>[foo]</p> -```````````````````````````````` - - -A [link reference definition] cannot interrupt a paragraph. - -```````````````````````````````` example -Foo -[bar]: /baz - -[bar] -. -<p>Foo -[bar]: /baz</p> -<p>[bar]</p> -```````````````````````````````` - - -However, it can directly follow other block elements, such as headings -and thematic breaks, and it need not be followed by a blank line. - -```````````````````````````````` example -# [Foo] -[foo]: /url -> bar -. -<h1><a href="/url">Foo</a></h1> -<blockquote> -<p>bar</p> -</blockquote> -```````````````````````````````` - -```````````````````````````````` example -[foo]: /url -bar -=== -[foo] -. -<h1>bar</h1> -<p><a href="/url">foo</a></p> -```````````````````````````````` - -```````````````````````````````` example -[foo]: /url -=== -[foo] -. -<p>=== -<a href="/url">foo</a></p> -```````````````````````````````` - - -Several [link reference definitions] -can occur one after another, without intervening blank lines. - -```````````````````````````````` example -[foo]: /foo-url "foo" -[bar]: /bar-url - "bar" -[baz]: /baz-url - -[foo], -[bar], -[baz] -. -<p><a href="/foo-url" title="foo">foo</a>, -<a href="/bar-url" title="bar">bar</a>, -<a href="/baz-url">baz</a></p> -```````````````````````````````` - - -[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: - -```````````````````````````````` example -[foo] - -> [foo]: /url -. -<p><a href="/url">foo</a></p> -<blockquote> -</blockquote> -```````````````````````````````` - - -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: - -```````````````````````````````` example -[foo]: /url -. -```````````````````````````````` - - -## Paragraphs - -A sequence of non-blank lines that cannot be interpreted as other -kinds of blocks forms a [paragraph](@). -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]. - -A simple example with two paragraphs: - -```````````````````````````````` example -aaa - -bbb -. -<p>aaa</p> -<p>bbb</p> -```````````````````````````````` - - -Paragraphs can contain multiple lines, but no blank lines: - -```````````````````````````````` example -aaa -bbb - -ccc -ddd -. -<p>aaa -bbb</p> -<p>ccc -ddd</p> -```````````````````````````````` - - -Multiple blank lines between paragraph have no effect: - -```````````````````````````````` example -aaa - - -bbb -. -<p>aaa</p> -<p>bbb</p> -```````````````````````````````` - - -Leading spaces are skipped: - -```````````````````````````````` example - aaa - bbb -. -<p>aaa -bbb</p> -```````````````````````````````` - - -Lines after the first may be indented any amount, since indented -code blocks cannot interrupt paragraphs. - -```````````````````````````````` example -aaa - bbb - ccc -. -<p>aaa -bbb -ccc</p> -```````````````````````````````` - - -However, the first line may be indented at most three spaces, -or an indented code block will be triggered: - -```````````````````````````````` example - aaa -bbb -. -<p>aaa -bbb</p> -```````````````````````````````` - - -```````````````````````````````` example - aaa -bbb -. -<pre><code>aaa -</code></pre> -<p>bbb</p> -```````````````````````````````` - - -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]: - -```````````````````````````````` example -aaa -bbb -. -<p>aaa<br /> -bbb</p> -```````````````````````````````` - - -## Blank lines - -[Blank lines] between block-level elements are ignored, -except for the role they play in determining whether a [list] -is [tight] or [loose]. - -Blank lines at the beginning and end of the document are also ignored. - -```````````````````````````````` example - - -aaa - - -# aaa - - -. -<p>aaa</p> -<h1>aaa</h1> -```````````````````````````````` - -<div class="extension"> - -## Tables (extension) - -GFM enables the `table` extension, where an additional leaf block type is -available. - -A [table](@) 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. - -Each row consists of cells containing arbitrary text, in which [inlines] are -parsed, separated by pipes (`|`). 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. - -The [delimiter row](@) consists of cells whose only content are hyphens (`-`), -and optionally, a leading or trailing colon (`:`), or both, to indicate left, -right, or center alignment respectively. - -```````````````````````````````` example table -| foo | bar | -| --- | --- | -| baz | bim | -. -<table> -<thead> -<tr> -<th>foo</th> -<th>bar</th> -</tr> -</thead> -<tbody> -<tr> -<td>baz</td> -<td>bim</td> -</tr> -</tbody> -</table> -```````````````````````````````` - -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: - -```````````````````````````````` example table -| abc | defghi | -:-: | -----------: -bar | baz -. -<table> -<thead> -<tr> -<th align="center">abc</th> -<th align="right">defghi</th> -</tr> -</thead> -<tbody> -<tr> -<td align="center">bar</td> -<td align="right">baz</td> -</tr> -</tbody> -</table> -```````````````````````````````` - -Include a pipe in a cell's content by escaping it, including inside other -inline spans: - -```````````````````````````````` example table -| f\|oo | -| ------ | -| b `\|` az | -| b **\|** im | -. -<table> -<thead> -<tr> -<th>f|oo</th> -</tr> -</thead> -<tbody> -<tr> -<td>b <code>|</code> az</td> -</tr> -<tr> -<td>b <strong>|</strong> im</td> -</tr> -</tbody> -</table> -```````````````````````````````` - -The table is broken at the first empty line, or beginning of another -block-level structure: - -```````````````````````````````` example table -| abc | def | -| --- | --- | -| bar | baz | -> bar -. -<table> -<thead> -<tr> -<th>abc</th> -<th>def</th> -</tr> -</thead> -<tbody> -<tr> -<td>bar</td> -<td>baz</td> -</tr> -</tbody> -</table> -<blockquote> -<p>bar</p> -</blockquote> -```````````````````````````````` - -```````````````````````````````` example table -| abc | def | -| --- | --- | -| bar | baz | -bar - -bar -. -<table> -<thead> -<tr> -<th>abc</th> -<th>def</th> -</tr> -</thead> -<tbody> -<tr> -<td>bar</td> -<td>baz</td> -</tr> -<tr> -<td>bar</td> -<td></td> -</tr> -</tbody> -</table> -<p>bar</p> -```````````````````````````````` - -The header row must match the [delimiter row] in the number of cells. If not, -a table will not be recognized: - -```````````````````````````````` example table -| abc | def | -| --- | -| bar | -. -<p>| abc | def | -| --- | -| bar |</p> -```````````````````````````````` - -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: - -```````````````````````````````` example table -| abc | def | -| --- | --- | -| bar | -| bar | baz | boo | -. -<table> -<thead> -<tr> -<th>abc</th> -<th>def</th> -</tr> -</thead> -<tbody> -<tr> -<td>bar</td> -<td></td> -</tr> -<tr> -<td>bar</td> -<td>baz</td> -</tr> -</tbody> -</table> -```````````````````````````````` - -If there are no rows in the body, no `<tbody>` is generated in HTML output: - -```````````````````````````````` example table -| abc | def | -| --- | --- | -. -<table> -<thead> -<tr> -<th>abc</th> -<th>def</th> -</tr> -</thead> -</table> -```````````````````````````````` - -</div> - -# Container blocks - -A [container block](#container-blocks) 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]. - -We define the syntax for container blocks recursively. The general -form of the definition is: - -> 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. - -So, we explain what counts as a block quote or list item by explaining -how these can be *generated* from their contents. This should suffice -to define the syntax, although it does not give a recipe for *parsing* -these constructions. (A recipe is provided below in the section entitled -[A parsing strategy](#appendix-a-parsing-strategy).) - -## Block quotes - -A [block quote marker](@) -consists of 0-3 spaces of initial indent, plus (a) the character `>` together -with a following space, or (b) a single character `>` not followed by a space. - -The following rules define [block quotes]: - -1. **Basic case.** If a string of lines *Ls* constitute a sequence - of blocks *Bs*, then the result of prepending a [block quote - marker] to the beginning of each line in *Ls* - is a [block quote](#block-quotes) containing *Bs*. - -2. **Laziness.** If a string of lines *Ls* constitute a [block - quote](#block-quotes) with contents *Bs*, 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 - quote marker] is [paragraph continuation - text] is a block quote with *Bs* as its content. - [Paragraph continuation text](@) is text - that will be parsed as part of the content of a paragraph, but does - not occur at the beginning of the paragraph. - -3. **Consecutiveness.** A document cannot contain two [block - quotes] in a row unless there is a [blank line] between them. - -Nothing else counts as a [block quote](#block-quotes). - -Here is a simple example: - -```````````````````````````````` example -> # Foo -> bar -> baz -. -<blockquote> -<h1>Foo</h1> -<p>bar -baz</p> -</blockquote> -```````````````````````````````` - - -The spaces after the `>` characters can be omitted: - -```````````````````````````````` example -># Foo ->bar -> baz -. -<blockquote> -<h1>Foo</h1> -<p>bar -baz</p> -</blockquote> -```````````````````````````````` - - -The `>` characters can be indented 1-3 spaces: - -```````````````````````````````` example - > # Foo - > bar - > baz -. -<blockquote> -<h1>Foo</h1> -<p>bar -baz</p> -</blockquote> -```````````````````````````````` - - -Four spaces gives us a code block: - -```````````````````````````````` example - > # Foo - > bar - > baz -. -<pre><code>> # Foo -> bar -> baz -</code></pre> -```````````````````````````````` - - -The Laziness clause allows us to omit the `>` before -[paragraph continuation text]: - -```````````````````````````````` example -> # Foo -> bar -baz -. -<blockquote> -<h1>Foo</h1> -<p>bar -baz</p> -</blockquote> -```````````````````````````````` - - -A block quote can contain some lazy and some non-lazy -continuation lines: - -```````````````````````````````` example -> bar -baz -> foo -. -<blockquote> -<p>bar -baz -foo</p> -</blockquote> -```````````````````````````````` - - -Laziness only applies to lines that would have been continuations of -paragraphs had they been prepended with [block quote markers]. -For example, the `> ` cannot be omitted in the second line of - -``` markdown -> foo -> --- -``` - -without changing the meaning: - -```````````````````````````````` example -> foo ---- -. -<blockquote> -<p>foo</p> -</blockquote> -<hr /> -```````````````````````````````` - - -Similarly, if we omit the `> ` in the second line of - -``` markdown -> - foo -> - bar -``` - -then the block quote ends after the first line: - -```````````````````````````````` example -> - foo -- bar -. -<blockquote> -<ul> -<li>foo</li> -</ul> -</blockquote> -<ul> -<li>bar</li> -</ul> -```````````````````````````````` - - -For the same reason, we can't omit the `> ` in front of -subsequent lines of an indented or fenced code block: - -```````````````````````````````` example -> foo - bar -. -<blockquote> -<pre><code>foo -</code></pre> -</blockquote> -<pre><code>bar -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example -> ``` -foo -``` -. -<blockquote> -<pre><code></code></pre> -</blockquote> -<p>foo</p> -<pre><code></code></pre> -```````````````````````````````` - - -Note that in the following case, we have a [lazy -continuation line]: - -```````````````````````````````` example -> foo - - bar -. -<blockquote> -<p>foo -- bar</p> -</blockquote> -```````````````````````````````` - - -To see why, note that in - -```markdown -> foo -> - bar -``` - -the `- bar` 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]. - -A block quote can be empty: - -```````````````````````````````` example -> -. -<blockquote> -</blockquote> -```````````````````````````````` - - -```````````````````````````````` example -> -> -> -. -<blockquote> -</blockquote> -```````````````````````````````` - - -A block quote can have initial or final blank lines: - -```````````````````````````````` example -> -> foo -> -. -<blockquote> -<p>foo</p> -</blockquote> -```````````````````````````````` - - -A blank line always separates block quotes: - -```````````````````````````````` example -> foo - -> bar -. -<blockquote> -<p>foo</p> -</blockquote> -<blockquote> -<p>bar</p> -</blockquote> -```````````````````````````````` - - -(Most current Markdown implementations, including John Gruber's -original `Markdown.pl`, 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.) - -Consecutiveness means that if we put these block quotes together, -we get a single block quote: - -```````````````````````````````` example -> foo -> bar -. -<blockquote> -<p>foo -bar</p> -</blockquote> -```````````````````````````````` - - -To get a block quote with two paragraphs, use: - -```````````````````````````````` example -> foo -> -> bar -. -<blockquote> -<p>foo</p> -<p>bar</p> -</blockquote> -```````````````````````````````` - - -Block quotes can interrupt paragraphs: - -```````````````````````````````` example -foo -> bar -. -<p>foo</p> -<blockquote> -<p>bar</p> -</blockquote> -```````````````````````````````` - - -In general, blank lines are not needed before or after block -quotes: - -```````````````````````````````` example -> aaa -*** -> bbb -. -<blockquote> -<p>aaa</p> -</blockquote> -<hr /> -<blockquote> -<p>bbb</p> -</blockquote> -```````````````````````````````` - - -However, because of laziness, a blank line is needed between -a block quote and a following paragraph: - -```````````````````````````````` example -> bar -baz -. -<blockquote> -<p>bar -baz</p> -</blockquote> -```````````````````````````````` - - -```````````````````````````````` example -> bar - -baz -. -<blockquote> -<p>bar</p> -</blockquote> -<p>baz</p> -```````````````````````````````` - - -```````````````````````````````` example -> bar -> -baz -. -<blockquote> -<p>bar</p> -</blockquote> -<p>baz</p> -```````````````````````````````` - - -It is a consequence of the Laziness rule that any number -of initial `>`s may be omitted on a continuation line of a -nested block quote: - -```````````````````````````````` example -> > > foo -bar -. -<blockquote> -<blockquote> -<blockquote> -<p>foo -bar</p> -</blockquote> -</blockquote> -</blockquote> -```````````````````````````````` - - -```````````````````````````````` example ->>> foo -> bar ->>baz -. -<blockquote> -<blockquote> -<blockquote> -<p>foo -bar -baz</p> -</blockquote> -</blockquote> -</blockquote> -```````````````````````````````` - - -When including an indented code block in a block quote, -remember that the [block quote marker] includes -both the `>` and a following space. So *five spaces* are needed after -the `>`: - -```````````````````````````````` example -> code - -> not code -. -<blockquote> -<pre><code>code -</code></pre> -</blockquote> -<blockquote> -<p>not code</p> -</blockquote> -```````````````````````````````` - - - -## List items - -A [list marker](@) is a -[bullet list marker] or an [ordered list marker]. - -A [bullet list marker](@) -is a `-`, `+`, or `*` character. - -An [ordered list marker](@) -is a sequence of 1--9 arabic digits (`0-9`), followed by either a -`.` character or a `)` character. (The reason for the length -limit is that with 10 digits we start seeing integer overflows -in some browsers.) - -The following rules define [list items]: - -1. **Basic case.** If a sequence of lines *Ls* constitute a sequence of - blocks *Bs* starting with a [non-whitespace character], and *M* is a - list marker of width *W* followed by 1 ≤ *N* ≤ 4 spaces, then the result - of prepending *M* and the following spaces to the first line of - *Ls*, and indenting subsequent lines of *Ls* by *W + N* spaces, is a - list item with *Bs* 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. - - Exceptions: - - 1. 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 *Ls* must not begin with a blank line, and (b) if - the list item is ordered, the start number must be 1. - 2. If any line is a [thematic break][thematic breaks] then - that line is not a list item. - -For example, let *Ls* be the lines - -```````````````````````````````` example -A paragraph -with two lines. - - indented code - -> A block quote. -. -<p>A paragraph -with two lines.</p> -<pre><code>indented code -</code></pre> -<blockquote> -<p>A block quote.</p> -</blockquote> -```````````````````````````````` - - -And let *M* be the marker `1.`, and *N* = 2. Then rule #1 says -that the following is an ordered list item with start number 1, -and the same contents as *Ls*: - -```````````````````````````````` example -1. A paragraph - with two lines. - - indented code - - > A block quote. -. -<ol> -<li> -<p>A paragraph -with two lines.</p> -<pre><code>indented code -</code></pre> -<blockquote> -<p>A block quote.</p> -</blockquote> -</li> -</ol> -```````````````````````````````` - - -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. - -Here are some examples showing how far content must be indented to be -put under the list item: - -```````````````````````````````` example -- one - - two -. -<ul> -<li>one</li> -</ul> -<p>two</p> -```````````````````````````````` - - -```````````````````````````````` example -- one - - two -. -<ul> -<li> -<p>one</p> -<p>two</p> -</li> -</ul> -```````````````````````````````` - - -```````````````````````````````` example - - one - - two -. -<ul> -<li>one</li> -</ul> -<pre><code> two -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example - - one - - two -. -<ul> -<li> -<p>one</p> -<p>two</p> -</li> -</ul> -```````````````````````````````` - - -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 -is needed. Which column this indentation reaches will depend on -how the list item is embedded in other constructions, as shown by -this example: - -```````````````````````````````` example - > > 1. one ->> ->> two -. -<blockquote> -<blockquote> -<ol> -<li> -<p>one</p> -<p>two</p> -</li> -</ol> -</blockquote> -</blockquote> -```````````````````````````````` - - -Here `two` occurs in the same column as the list marker `1.`, -but is actually contained in the list item, because there is -sufficient indentation after the last containing blockquote marker. - -The converse is also possible. In the following example, the word `two` -occurs far to the right of the initial text of the list item, `one`, but -it is not considered part of the list item, because it is not indented -far enough past the blockquote marker: - -```````````````````````````````` example ->>- one ->> - > > two -. -<blockquote> -<blockquote> -<ul> -<li>one</li> -</ul> -<p>two</p> -</blockquote> -</blockquote> -```````````````````````````````` - - -Note that at least one space is needed between the list marker and -any following content, so these are not list items: - -```````````````````````````````` example --one - -2.two -. -<p>-one</p> -<p>2.two</p> -```````````````````````````````` - - -A list item may contain blocks that are separated by more than -one blank line. - -```````````````````````````````` example -- foo - - - bar -. -<ul> -<li> -<p>foo</p> -<p>bar</p> -</li> -</ul> -```````````````````````````````` - - -A list item may contain any kind of block: - -```````````````````````````````` example -1. foo - - ``` - bar - ``` - - baz - - > bam -. -<ol> -<li> -<p>foo</p> -<pre><code>bar -</code></pre> -<p>baz</p> -<blockquote> -<p>bam</p> -</blockquote> -</li> -</ol> -```````````````````````````````` - - -A list item that contains an indented code block will preserve -empty lines within the code block verbatim. - -```````````````````````````````` example -- Foo - - bar - - - baz -. -<ul> -<li> -<p>Foo</p> -<pre><code>bar - - -baz -</code></pre> -</li> -</ul> -```````````````````````````````` - -Note that ordered list start numbers must be nine digits or less: - -```````````````````````````````` example -123456789. ok -. -<ol start="123456789"> -<li>ok</li> -</ol> -```````````````````````````````` - - -```````````````````````````````` example -1234567890. not ok -. -<p>1234567890. not ok</p> -```````````````````````````````` - - -A start number may begin with 0s: - -```````````````````````````````` example -0. ok -. -<ol start="0"> -<li>ok</li> -</ol> -```````````````````````````````` - - -```````````````````````````````` example -003. ok -. -<ol start="3"> -<li>ok</li> -</ol> -```````````````````````````````` - - -A start number may not be negative: - -```````````````````````````````` example --1. not ok -. -<p>-1. not ok</p> -```````````````````````````````` - - - -2. **Item starting with indented code.** If a sequence of lines *Ls* - constitute a sequence of blocks *Bs* starting with an indented code - block, and *M* is a list marker of width *W* followed by - one space, then the result of prepending *M* and the following - space to the first line of *Ls*, and indenting subsequent lines of - *Ls* by *W + 1* spaces, is a list item with *Bs* as its contents. - If a line is empty, then it need not be indented. 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. - -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: - -```````````````````````````````` example -- foo - - bar -. -<ul> -<li> -<p>foo</p> -<pre><code>bar -</code></pre> -</li> -</ul> -```````````````````````````````` - - -And in this case it is 11 spaces: - -```````````````````````````````` example - 10. foo - - bar -. -<ol start="10"> -<li> -<p>foo</p> -<pre><code>bar -</code></pre> -</li> -</ol> -```````````````````````````````` - - -If the *first* block in the list item is an indented code block, -then by rule #2, the contents must be indented *one* space after the -list marker: - -```````````````````````````````` example - indented code - -paragraph - - more code -. -<pre><code>indented code -</code></pre> -<p>paragraph</p> -<pre><code>more code -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example -1. indented code - - paragraph - - more code -. -<ol> -<li> -<pre><code>indented code -</code></pre> -<p>paragraph</p> -<pre><code>more code -</code></pre> -</li> -</ol> -```````````````````````````````` - - -Note that an additional space indent is interpreted as space -inside the code block: - -```````````````````````````````` example -1. indented code - - paragraph - - more code -. -<ol> -<li> -<pre><code> indented code -</code></pre> -<p>paragraph</p> -<pre><code>more code -</code></pre> -</li> -</ol> -```````````````````````````````` - - -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 -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: - -```````````````````````````````` example - foo - -bar -. -<p>foo</p> -<p>bar</p> -```````````````````````````````` - - -```````````````````````````````` example -- foo - - bar -. -<ul> -<li>foo</li> -</ul> -<p>bar</p> -```````````````````````````````` - - -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: - -```````````````````````````````` example -- foo - - bar -. -<ul> -<li> -<p>foo</p> -<p>bar</p> -</li> -</ul> -```````````````````````````````` - - -3. **Item starting with a blank line.** If a sequence of lines *Ls* - starting with a single [blank line] constitute a (possibly empty) - sequence of blocks *Bs*, not separated from each other by more than - one blank line, and *M* is a list marker of width *W*, - then the result of prepending *M* to the first line of *Ls*, and - indenting subsequent lines of *Ls* by *W + 1* spaces, is a list - item with *Bs* as its contents. - If a line is empty, then it need not be indented. 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. - -Here are some list items that start with a blank line but are not empty: - -```````````````````````````````` example -- - foo -- - ``` - bar - ``` -- - baz -. -<ul> -<li>foo</li> -<li> -<pre><code>bar -</code></pre> -</li> -<li> -<pre><code>baz -</code></pre> -</li> -</ul> -```````````````````````````````` - -When the list item starts with a blank line, the number of spaces -following the list marker doesn't change the required indentation: - -```````````````````````````````` example -- - foo -. -<ul> -<li>foo</li> -</ul> -```````````````````````````````` - - -A list item can begin with at most one blank line. -In the following example, `foo` is not part of the list -item: - -```````````````````````````````` example -- - - foo -. -<ul> -<li></li> -</ul> -<p>foo</p> -```````````````````````````````` - - -Here is an empty bullet list item: - -```````````````````````````````` example -- foo -- -- bar -. -<ul> -<li>foo</li> -<li></li> -<li>bar</li> -</ul> -```````````````````````````````` - - -It does not matter whether there are spaces following the [list marker]: - -```````````````````````````````` example -- foo -- -- bar -. -<ul> -<li>foo</li> -<li></li> -<li>bar</li> -</ul> -```````````````````````````````` - - -Here is an empty ordered list item: - -```````````````````````````````` example -1. foo -2. -3. bar -. -<ol> -<li>foo</li> -<li></li> -<li>bar</li> -</ol> -```````````````````````````````` - - -A list may start or end with an empty list item: - -```````````````````````````````` example -* -. -<ul> -<li></li> -</ul> -```````````````````````````````` - -However, an empty list item cannot interrupt a paragraph: - -```````````````````````````````` example -foo -* - -foo -1. -. -<p>foo -*</p> -<p>foo -1.</p> -```````````````````````````````` - - -4. **Indentation.** If a sequence of lines *Ls* constitutes a list item - according to rule #1, #2, or #3, then the result of indenting each line - of *Ls* 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. - -Indented one space: - -```````````````````````````````` example - 1. A paragraph - with two lines. - - indented code - - > A block quote. -. -<ol> -<li> -<p>A paragraph -with two lines.</p> -<pre><code>indented code -</code></pre> -<blockquote> -<p>A block quote.</p> -</blockquote> -</li> -</ol> -```````````````````````````````` - - -Indented two spaces: - -```````````````````````````````` example - 1. A paragraph - with two lines. - - indented code - - > A block quote. -. -<ol> -<li> -<p>A paragraph -with two lines.</p> -<pre><code>indented code -</code></pre> -<blockquote> -<p>A block quote.</p> -</blockquote> -</li> -</ol> -```````````````````````````````` - - -Indented three spaces: - -```````````````````````````````` example - 1. A paragraph - with two lines. - - indented code - - > A block quote. -. -<ol> -<li> -<p>A paragraph -with two lines.</p> -<pre><code>indented code -</code></pre> -<blockquote> -<p>A block quote.</p> -</blockquote> -</li> -</ol> -```````````````````````````````` - - -Four spaces indent gives a code block: - -```````````````````````````````` example - 1. A paragraph - with two lines. - - indented code - - > A block quote. -. -<pre><code>1. A paragraph - with two lines. - - indented code - - > A block quote. -</code></pre> -```````````````````````````````` - - - -5. **Laziness.** If a string of lines *Ls* constitute a [list - item](#list-items) with contents *Bs*, then the result of deleting - some or all of the indentation from one or more lines in which the - next [non-whitespace character] after the indentation is - [paragraph continuation text] is a - list item with the same contents and attributes. The unindented - lines are called - [lazy continuation line](@)s. - -Here is an example with [lazy continuation lines]: - -```````````````````````````````` example - 1. A paragraph -with two lines. - - indented code - - > A block quote. -. -<ol> -<li> -<p>A paragraph -with two lines.</p> -<pre><code>indented code -</code></pre> -<blockquote> -<p>A block quote.</p> -</blockquote> -</li> -</ol> -```````````````````````````````` - - -Indentation can be partially deleted: - -```````````````````````````````` example - 1. A paragraph - with two lines. -. -<ol> -<li>A paragraph -with two lines.</li> -</ol> -```````````````````````````````` - - -These examples show how laziness can work in nested structures: - -```````````````````````````````` example -> 1. > Blockquote -continued here. -. -<blockquote> -<ol> -<li> -<blockquote> -<p>Blockquote -continued here.</p> -</blockquote> -</li> -</ol> -</blockquote> -```````````````````````````````` - - -```````````````````````````````` example -> 1. > Blockquote -> continued here. -. -<blockquote> -<ol> -<li> -<blockquote> -<p>Blockquote -continued here.</p> -</blockquote> -</li> -</ol> -</blockquote> -```````````````````````````````` - - - -6. **That's all.** Nothing that is not counted as a list item by rules - #1--5 counts as a [list item](#list-items). - -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. - -So, in this case we need two spaces indent: - -```````````````````````````````` example -- foo - - bar - - baz - - boo -. -<ul> -<li>foo -<ul> -<li>bar -<ul> -<li>baz -<ul> -<li>boo</li> -</ul> -</li> -</ul> -</li> -</ul> -</li> -</ul> -```````````````````````````````` - - -One is not enough: - -```````````````````````````````` example -- foo - - bar - - baz - - boo -. -<ul> -<li>foo</li> -<li>bar</li> -<li>baz</li> -<li>boo</li> -</ul> -```````````````````````````````` - - -Here we need four, because the list marker is wider: - -```````````````````````````````` example -10) foo - - bar -. -<ol start="10"> -<li>foo -<ul> -<li>bar</li> -</ul> -</li> -</ol> -```````````````````````````````` - - -Three is not enough: - -```````````````````````````````` example -10) foo - - bar -. -<ol start="10"> -<li>foo</li> -</ol> -<ul> -<li>bar</li> -</ul> -```````````````````````````````` - - -A list may be the first block in a list item: - -```````````````````````````````` example -- - foo -. -<ul> -<li> -<ul> -<li>foo</li> -</ul> -</li> -</ul> -```````````````````````````````` - - -```````````````````````````````` example -1. - 2. foo -. -<ol> -<li> -<ul> -<li> -<ol start="2"> -<li>foo</li> -</ol> -</li> -</ul> -</li> -</ol> -```````````````````````````````` - - -A list item can contain a heading: - -```````````````````````````````` example -- # Foo -- Bar - --- - baz -. -<ul> -<li> -<h1>Foo</h1> -</li> -<li> -<h2>Bar</h2> -baz</li> -</ul> -```````````````````````````````` - - -### Motivation - -John Gruber's Markdown spec says the following about list items: - -1. "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." - -2. "To make lists look nice, you can wrap items with hanging indents.... - But if you don't want to, you don't have to." - -3. "List items may consist of multiple paragraphs. Each subsequent - paragraph in a list item must be indented by either 4 spaces or one - tab." - -4. "It looks nice if you indent every line of the subsequent paragraphs, - but here again, Markdown will allow you to be lazy." - -5. "To put a blockquote within a list item, the blockquote's `>` - delimiters need to be indented." - -6. "To put a code block within a list item, the code block needs to be - indented twice — 8 spaces or two tabs." - -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 -that a block quote must be indented, but not by how much; however, the -example given has four spaces indentation. Although nothing is said -about other kinds of block-level content, it is certainly reasonable to -infer that *all* block elements under a list item, including other -lists, must be indented four spaces. This principle has been called the -*four-space rule*. - -The four-space rule is clear and principled, and if the reference -implementation `Markdown.pl` had followed it, it probably would have -become the standard. However, `Markdown.pl` allowed paragraphs and -sublists to start with only two spaces indentation, at least on the -outer level. Worse, its behavior was inconsistent: a sublist of an -outer-level list needed two spaces indentation, but a sublist of this -sublist needed three spaces. It is not surprising, then, that different -implementations of Markdown have developed very different rules for -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 `Markdown.pl`'s behavior more closely.) - -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 `Markdown.pl` behavior, provided they are laid out -in a way that is natural for a human to read. - -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.) - -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 - -``` markdown -- foo - - bar - - - baz -``` - -should be parsed as two lists with an intervening paragraph, - -``` html -<ul> -<li>foo</li> -</ul> -<p>bar</p> -<ul> -<li>baz</li> -</ul> -``` - -as the four-space rule demands, rather than a single list, - -``` html -<ul> -<li> -<p>foo</p> -<p>bar</p> -<ul> -<li>baz</li> -</ul> -</li> -</ul> -``` - -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. - -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 *less than* the -original list marker to be included in the list item. For example, -`Markdown.pl` parses - -``` markdown - - one - - two -``` - -as a single list item, with `two` a continuation paragraph: - -``` html -<ul> -<li> -<p>one</p> -<p>two</p> -</li> -</ul> -``` - -and similarly - -``` markdown -> - one -> -> two -``` - -as - -``` html -<blockquote> -<ul> -<li> -<p>one</p> -<p>two</p> -</li> -</ul> -</blockquote> -``` - -This is extremely unintuitive. - -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 `bar` -is not indented as far as the first paragraph `foo`: - -``` markdown - 10. foo - - bar -``` - -Arguably this text does read like a list item with `bar` 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: - -``` markdown -1. foo - - indented code -``` - -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 `foo`. - -The one case that needs special treatment is a list item that *starts* -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 -(and then the normal four spaces for the indented code). This will match the -four-space rule in cases where the list marker plus its initial indentation -takes four spaces (a common case), but diverge in other cases. - -<div class="extension"> - -## Task list items (extension) - -GFM enables the `tasklist` extension, where an additional processing step is -performed on [list items]. - -A [task list item](@) 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. - -A [task list item marker](@) consists of an optional number of spaces, a left -bracket (`[`), either a whitespace character or the letter `x` in either -lowercase or uppercase, and then a right bracket (`]`). - -When rendered, the [task list item marker] is replaced with a semantic checkbox element; -in an HTML output, this would be an `<input type="checkbox">` element. - -If the character between the brackets is a whitespace character, the checkbox -is unchecked. Otherwise, the checkbox is checked. - -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. - -```````````````````````````````` example disabled -- [ ] foo -- [x] bar -. -<ul> -<li><input disabled="" type="checkbox"> foo</li> -<li><input checked="" disabled="" type="checkbox"> bar</li> -</ul> -```````````````````````````````` - -Task lists can be arbitrarily nested: - -```````````````````````````````` example disabled -- [x] foo - - [ ] bar - - [x] baz -- [ ] bim -. -<ul> -<li><input checked="" disabled="" type="checkbox"> foo -<ul> -<li><input disabled="" type="checkbox"> bar</li> -<li><input checked="" disabled="" type="checkbox"> baz</li> -</ul> -</li> -<li><input disabled="" type="checkbox"> bim</li> -</ul> -```````````````````````````````` - -</div> - -## Lists - -A [list](@) 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. - -Two list items are [of the same type](@) -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 -(`-`, `+`, or `*`) or (b) they are ordered list numbers with the same -delimiter (either `.` or `)`). - -A list is an [ordered list](@) -if its constituent list items begin with -[ordered list markers], and a -[bullet list](@) if its constituent list -items begin with [bullet list markers]. - -The [start number](@) -of an [ordered list] is determined by the list number of -its initial list item. The numbers of subsequent list items are -disregarded. - -A list is [loose](@) 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 [tight](@). -(The difference in HTML output is that paragraphs in a loose list are -wrapped in `<p>` tags, while paragraphs in a tight list are not.) - -Changing the bullet or ordered list delimiter starts a new list: - -```````````````````````````````` example -- foo -- bar -+ baz -. -<ul> -<li>foo</li> -<li>bar</li> -</ul> -<ul> -<li>baz</li> -</ul> -```````````````````````````````` - - -```````````````````````````````` example -1. foo -2. bar -3) baz -. -<ol> -<li>foo</li> -<li>bar</li> -</ol> -<ol start="3"> -<li>baz</li> -</ol> -```````````````````````````````` - - -In CommonMark, a list can interrupt a paragraph. That is, -no blank line is needed to separate a paragraph from a following -list: - -```````````````````````````````` example -Foo -- bar -- baz -. -<p>Foo</p> -<ul> -<li>bar</li> -<li>baz</li> -</ul> -```````````````````````````````` - -`Markdown.pl` does not allow this, through fear of triggering a list -via a numeral in a hard-wrapped line: - -``` markdown -The number of windows in my house is -14. The number of doors is 6. -``` - -Oddly, though, `Markdown.pl` *does* allow a blockquote to -interrupt a paragraph, even though the same considerations might -apply. - -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: - -``` markdown -I need to buy -- new shoes -- a coat -- a plane ticket -``` - -Second, we are attracted to a - -> [principle of uniformity](@): -> 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). - -(Indeed, the spec for [list items] and [block quotes] presupposes -this principle.) This principle implies that if - -``` markdown - * I need to buy - - new shoes - - a coat - - a plane ticket -``` - -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 `<p>` tags, since the list is "tight"), -then - -``` markdown -I need to buy -- new shoes -- a coat -- a plane ticket -``` - -by itself should be a paragraph followed by a nested sublist. - -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. ([reStructuredText](http://docutils.sourceforge.net/rst.html) -takes a different approach, requiring blank lines before lists -even inside other list items.) - -In order to solve of unwanted lists in paragraphs with -hard-wrapped numerals, we allow only lists starting with `1` to -interrupt paragraphs. Thus, - -```````````````````````````````` example -The number of windows in my house is -14. The number of doors is 6. -. -<p>The number of windows in my house is -14. The number of doors is 6.</p> -```````````````````````````````` - -We may still get an unintended result in cases like - -```````````````````````````````` example -The number of windows in my house is -1. The number of doors is 6. -. -<p>The number of windows in my house is</p> -<ol> -<li>The number of doors is 6.</li> -</ol> -```````````````````````````````` - -but this rule should prevent most spurious list captures. - -There can be any number of blank lines between items: - -```````````````````````````````` example -- foo - -- bar - - -- baz -. -<ul> -<li> -<p>foo</p> -</li> -<li> -<p>bar</p> -</li> -<li> -<p>baz</p> -</li> -</ul> -```````````````````````````````` - -```````````````````````````````` example -- foo - - bar - - baz - - - bim -. -<ul> -<li>foo -<ul> -<li>bar -<ul> -<li> -<p>baz</p> -<p>bim</p> -</li> -</ul> -</li> -</ul> -</li> -</ul> -```````````````````````````````` - - -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: - -```````````````````````````````` example -- foo -- bar - -<!-- --> - -- baz -- bim -. -<ul> -<li>foo</li> -<li>bar</li> -</ul> -<!-- --> -<ul> -<li>baz</li> -<li>bim</li> -</ul> -```````````````````````````````` - - -```````````````````````````````` example -- foo - - notcode - -- foo - -<!-- --> - - code -. -<ul> -<li> -<p>foo</p> -<p>notcode</p> -</li> -<li> -<p>foo</p> -</li> -</ul> -<!-- --> -<pre><code>code -</code></pre> -```````````````````````````````` - - -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: - -```````````````````````````````` example -- a - - b - - c - - d - - e - - f -- g -. -<ul> -<li>a</li> -<li>b</li> -<li>c</li> -<li>d</li> -<li>e</li> -<li>f</li> -<li>g</li> -</ul> -```````````````````````````````` - - -```````````````````````````````` example -1. a - - 2. b - - 3. c -. -<ol> -<li> -<p>a</p> -</li> -<li> -<p>b</p> -</li> -<li> -<p>c</p> -</li> -</ol> -```````````````````````````````` - -Note, however, that list items may not be indented more than -three spaces. Here `- e` is treated as a paragraph continuation -line, because it is indented more than three spaces: - -```````````````````````````````` example -- a - - b - - c - - d - - e -. -<ul> -<li>a</li> -<li>b</li> -<li>c</li> -<li>d -- e</li> -</ul> -```````````````````````````````` - -And here, `3. c` is treated as in indented code block, -because it is indented four spaces and preceded by a -blank line. - -```````````````````````````````` example -1. a - - 2. b - - 3. c -. -<ol> -<li> -<p>a</p> -</li> -<li> -<p>b</p> -</li> -</ol> -<pre><code>3. c -</code></pre> -```````````````````````````````` - - -This is a loose list, because there is a blank line between -two of the list items: - -```````````````````````````````` example -- a -- b - -- c -. -<ul> -<li> -<p>a</p> -</li> -<li> -<p>b</p> -</li> -<li> -<p>c</p> -</li> -</ul> -```````````````````````````````` - - -So is this, with a empty second item: - -```````````````````````````````` example -* a -* - -* c -. -<ul> -<li> -<p>a</p> -</li> -<li></li> -<li> -<p>c</p> -</li> -</ul> -```````````````````````````````` - - -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: - -```````````````````````````````` example -- a -- b - - c -- d -. -<ul> -<li> -<p>a</p> -</li> -<li> -<p>b</p> -<p>c</p> -</li> -<li> -<p>d</p> -</li> -</ul> -```````````````````````````````` - - -```````````````````````````````` example -- a -- b - - [ref]: /url -- d -. -<ul> -<li> -<p>a</p> -</li> -<li> -<p>b</p> -</li> -<li> -<p>d</p> -</li> -</ul> -```````````````````````````````` - - -This is a tight list, because the blank lines are in a code block: - -```````````````````````````````` example -- a -- ``` - b - - - ``` -- c -. -<ul> -<li>a</li> -<li> -<pre><code>b - - -</code></pre> -</li> -<li>c</li> -</ul> -```````````````````````````````` - - -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: - -```````````````````````````````` example -- a - - b - - c -- d -. -<ul> -<li>a -<ul> -<li> -<p>b</p> -<p>c</p> -</li> -</ul> -</li> -<li>d</li> -</ul> -```````````````````````````````` - - -This is a tight list, because the blank line is inside the -block quote: - -```````````````````````````````` example -* a - > b - > -* c -. -<ul> -<li>a -<blockquote> -<p>b</p> -</blockquote> -</li> -<li>c</li> -</ul> -```````````````````````````````` - - -This list is tight, because the consecutive block elements -are not separated by blank lines: - -```````````````````````````````` example -- a - > b - ``` - c - ``` -- d -. -<ul> -<li>a -<blockquote> -<p>b</p> -</blockquote> -<pre><code>c -</code></pre> -</li> -<li>d</li> -</ul> -```````````````````````````````` - - -A single-paragraph list is tight: - -```````````````````````````````` example -- a -. -<ul> -<li>a</li> -</ul> -```````````````````````````````` - - -```````````````````````````````` example -- a - - b -. -<ul> -<li>a -<ul> -<li>b</li> -</ul> -</li> -</ul> -```````````````````````````````` - - -This list is loose, because of the blank line between the -two block elements in the list item: - -```````````````````````````````` example -1. ``` - foo - ``` - - bar -. -<ol> -<li> -<pre><code>foo -</code></pre> -<p>bar</p> -</li> -</ol> -```````````````````````````````` - - -Here the outer list is loose, the inner list tight: - -```````````````````````````````` example -* foo - * bar - - baz -. -<ul> -<li> -<p>foo</p> -<ul> -<li>bar</li> -</ul> -<p>baz</p> -</li> -</ul> -```````````````````````````````` - - -```````````````````````````````` example -- a - - b - - c - -- d - - e - - f -. -<ul> -<li> -<p>a</p> -<ul> -<li>b</li> -<li>c</li> -</ul> -</li> -<li> -<p>d</p> -<ul> -<li>e</li> -<li>f</li> -</ul> -</li> -</ul> -```````````````````````````````` - - -# Inlines - -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 - -```````````````````````````````` example -`hi`lo` -. -<p><code>hi</code>lo`</p> -```````````````````````````````` - -`hi` is parsed as code, leaving the backtick at the end as a literal -backtick. - - -## Backslash escapes - -Any ASCII punctuation character may be backslash-escaped: - -```````````````````````````````` example -\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~ -. -<p>!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~</p> -```````````````````````````````` - - -Backslashes before other characters are treated as literal -backslashes: - -```````````````````````````````` example -\→\A\a\ \3\φ\« -. -<p>\→\A\a\ \3\φ\«</p> -```````````````````````````````` - - -Escaped characters are treated as regular characters and do -not have their usual Markdown meanings: - -```````````````````````````````` example -\*not emphasized* -\<br/> not a tag -\[not a link](/foo) -\`not code` -1\. not a list -\* not a list -\# not a heading -\[foo]: /url "not a reference" -\ö not a character entity -. -<p>*not emphasized* -<br/> not a tag -[not a link](/foo) -`not code` -1. not a list -* not a list -# not a heading -[foo]: /url "not a reference" -&ouml; not a character entity</p> -```````````````````````````````` - - -If a backslash is itself escaped, the following character is not: - -```````````````````````````````` example -\\*emphasis* -. -<p>\<em>emphasis</em></p> -```````````````````````````````` - - -A backslash at the end of the line is a [hard line break]: - -```````````````````````````````` example -foo\ -bar -. -<p>foo<br /> -bar</p> -```````````````````````````````` - - -Backslash escapes do not work in code blocks, code spans, autolinks, or -raw HTML: - -```````````````````````````````` example -`` \[\` `` -. -<p><code>\[\`</code></p> -```````````````````````````````` - - -```````````````````````````````` example - \[\] -. -<pre><code>\[\] -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example -~~~ -\[\] -~~~ -. -<pre><code>\[\] -</code></pre> -```````````````````````````````` - - -```````````````````````````````` example -<http://example.com?find=\*> -. -<p><a href="http://example.com?find=%5C*">http://example.com?find=\*</a></p> -```````````````````````````````` - - -```````````````````````````````` example -<a href="/bar\/)"> -. -<a href="/bar\/)"> -```````````````````````````````` - - -But they work in all other contexts, including URLs and link titles, -link references, and [info strings] in [fenced code blocks]: - -```````````````````````````````` example -[foo](/bar\* "ti\*tle") -. -<p><a href="/bar*" title="ti*tle">foo</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[foo] - -[foo]: /bar\* "ti\*tle" -. -<p><a href="/bar*" title="ti*tle">foo</a></p> -```````````````````````````````` - - -```````````````````````````````` example -``` foo\+bar -foo -``` -. -<pre><code class="language-foo+bar">foo -</code></pre> -```````````````````````````````` - - - -## Entity and numeric character references - -Valid HTML entity references and numeric character references -can be used in place of the corresponding Unicode character, -with the following exceptions: - -- Entity and character references are not recognized in code - blocks and code spans. - -- Entity and character references cannot stand in place of - special characters that define structural elements in - CommonMark. For example, although `*` can be used - in place of a literal `*` character, `*` cannot replace - `*` in emphasis delimiters, bullet list markers, or thematic - breaks. - -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. - -[Entity references](@) consist of `&` + any of the valid -HTML5 entity names + `;`. The -document <https://html.spec.whatwg.org/multipage/entities.json> -is used as an authoritative source for the valid entity -references and their corresponding code points. - -```````````````````````````````` example - & © Æ Ď -¾ ℋ ⅆ -∲ ≧̸ -. -<p> & © Æ ÄŽ -¾ â„‹ â…† -∲ ≧̸</p> -```````````````````````````````` - - -[Decimal numeric character -references](@) -consist of `&#` + a string of 1--7 arabic digits + `;`. A -numeric character reference is parsed as the corresponding -Unicode character. Invalid Unicode code points will be replaced by -the REPLACEMENT CHARACTER (`U+FFFD`). For security reasons, -the code point `U+0000` will also be replaced by `U+FFFD`. - -```````````````````````````````` example -# Ӓ Ϡ � -. -<p># Ó’ Ï ï¿½</p> -```````````````````````````````` - - -[Hexadecimal numeric character -references](@) consist of `&#` + -either `X` or `x` + a string of 1-6 hexadecimal digits + `;`. -They too are parsed as the corresponding Unicode character (this -time specified with a hexadecimal numeral instead of decimal). - -```````````````````````````````` example -" ആ ಫ -. -<p>" à´† ಫ</p> -```````````````````````````````` - - -Here are some nonentities: - -```````````````````````````````` example -  &x; &#; &#x; -� -&#abcdef0; -&ThisIsNotDefined; &hi?; -. -<p>&nbsp &x; &#; &#x; -&#987654321; -&#abcdef0; -&ThisIsNotDefined; &hi?;</p> -```````````````````````````````` - - -Although HTML5 does accept some entity references -without a trailing semicolon (such as `©`), these are not -recognized here, because it makes the grammar too ambiguous: - -```````````````````````````````` example -© -. -<p>&copy</p> -```````````````````````````````` - - -Strings that are not on the list of HTML5 named entities are not -recognized as entity references either: - -```````````````````````````````` example -&MadeUpEntity; -. -<p>&MadeUpEntity;</p> -```````````````````````````````` - - -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]: - -```````````````````````````````` example -<a href="öö.html"> -. -<a href="öö.html"> -```````````````````````````````` - - -```````````````````````````````` example -[foo](/föö "föö") -. -<p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[foo] - -[foo]: /föö "föö" -. -<p><a href="/f%C3%B6%C3%B6" title="föö">foo</a></p> -```````````````````````````````` - - -```````````````````````````````` example -``` föö -foo -``` -. -<pre><code class="language-föö">foo -</code></pre> -```````````````````````````````` - - -Entity and numeric character references are treated as literal -text in code spans and code blocks: - -```````````````````````````````` example -`föö` -. -<p><code>f&ouml;&ouml;</code></p> -```````````````````````````````` - - -```````````````````````````````` example - föfö -. -<pre><code>f&ouml;f&ouml; -</code></pre> -```````````````````````````````` - - -Entity and numeric character references cannot be used -in place of symbols indicating structure in CommonMark -documents. - -```````````````````````````````` example -*foo* -*foo* -. -<p>*foo* -<em>foo</em></p> -```````````````````````````````` - -```````````````````````````````` example -* foo - -* foo -. -<p>* foo</p> -<ul> -<li>foo</li> -</ul> -```````````````````````````````` - -```````````````````````````````` example -foo bar -. -<p>foo - -bar</p> -```````````````````````````````` - -```````````````````````````````` example -	foo -. -<p>→foo</p> -```````````````````````````````` - - -```````````````````````````````` example -[a](url "tit") -. -<p>[a](url "tit")</p> -```````````````````````````````` - - -## Code spans - -A [backtick string](@) -is a string of one or more backtick characters (`` ` ``) that is neither -preceded nor followed by a backtick. - -A [code span](@) 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: - -- First, [line endings] are converted to [spaces]. -- If the resulting string both begins *and* 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. - -This is a simple code span: - -```````````````````````````````` example -`foo` -. -<p><code>foo</code></p> -```````````````````````````````` - - -Here two backticks are used, because the code contains a backtick. -This example also illustrates stripping of a single leading and -trailing space: - -```````````````````````````````` example -`` foo ` bar `` -. -<p><code>foo ` bar</code></p> -```````````````````````````````` - - -This example shows the motivation for stripping leading and trailing -spaces: - -```````````````````````````````` example -` `` ` -. -<p><code>``</code></p> -```````````````````````````````` - -Note that only *one* space is stripped: - -```````````````````````````````` example -` `` ` -. -<p><code> `` </code></p> -```````````````````````````````` - -The stripping only happens if the space is on both -sides of the string: - -```````````````````````````````` example -` a` -. -<p><code> a</code></p> -```````````````````````````````` - -Only [spaces], and not [unicode whitespace] in general, are -stripped in this way: - -```````````````````````````````` example -` b ` -. -<p><code> b </code></p> -```````````````````````````````` - -No stripping occurs if the code span contains only spaces: - -```````````````````````````````` example -` ` -` ` -. -<p><code> </code> -<code> </code></p> -```````````````````````````````` - - -[Line endings] are treated like spaces: - -```````````````````````````````` example -`` -foo -bar -baz -`` -. -<p><code>foo bar baz</code></p> -```````````````````````````````` - -```````````````````````````````` example -`` -foo -`` -. -<p><code>foo </code></p> -```````````````````````````````` - - -Interior spaces are not collapsed: - -```````````````````````````````` example -`foo bar -baz` -. -<p><code>foo bar baz</code></p> -```````````````````````````````` - -Note that browsers will typically collapse consecutive spaces -when rendering `<code>` elements, so it is recommended that -the following CSS be used: - - code{white-space: pre-wrap;} - - -Note that backslash escapes do not work in code spans. All backslashes -are treated literally: - -```````````````````````````````` example -`foo\`bar` -. -<p><code>foo\</code>bar`</p> -```````````````````````````````` - - -Backslash escapes are never needed, because one can always choose a -string of *n* backtick characters as delimiters, where the code does -not contain any strings of exactly *n* backtick characters. - -```````````````````````````````` example -``foo`bar`` -. -<p><code>foo`bar</code></p> -```````````````````````````````` - -```````````````````````````````` example -` foo `` bar ` -. -<p><code>foo `` bar</code></p> -```````````````````````````````` - - -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 `*` is part of a code -span: - -```````````````````````````````` example -*foo`*` -. -<p>*foo<code>*</code></p> -```````````````````````````````` - - -And this is not parsed as a link: - -```````````````````````````````` example -[not a `link](/foo`) -. -<p>[not a <code>link](/foo</code>)</p> -```````````````````````````````` - - -Code spans, HTML tags, and autolinks have the same precedence. -Thus, this is code: - -```````````````````````````````` example -`<a href="`">` -. -<p><code><a href="</code>">`</p> -```````````````````````````````` - - -But this is an HTML tag: - -```````````````````````````````` example -<a href="`">` -. -<p><a href="`">`</p> -```````````````````````````````` - - -And this is code: - -```````````````````````````````` example -`<http://foo.bar.`baz>` -. -<p><code><http://foo.bar.</code>baz>`</p> -```````````````````````````````` - - -But this is an autolink: - -```````````````````````````````` example -<http://foo.bar.`baz>` -. -<p><a href="http://foo.bar.%60baz">http://foo.bar.`baz</a>`</p> -```````````````````````````````` - - -When a backtick string is not closed by a matching backtick string, -we just have literal backticks: - -```````````````````````````````` example -```foo`` -. -<p>```foo``</p> -```````````````````````````````` - - -```````````````````````````````` example -`foo -. -<p>`foo</p> -```````````````````````````````` - -The following case also illustrates the need for opening and -closing backtick strings to be equal in length: - -```````````````````````````````` example -`foo``bar`` -. -<p>`foo<code>bar</code></p> -```````````````````````````````` - - -## Emphasis and strong emphasis - -John Gruber's original [Markdown syntax -description](http://daringfireball.net/projects/markdown/syntax#em) says: - -> Markdown treats asterisks (`*`) and underscores (`_`) as indicators of -> emphasis. Text wrapped with one `*` or `_` will be wrapped with an HTML -> `<em>` tag; double `*`'s or `_`'s will be wrapped with an HTML `<strong>` -> tag. - -This is enough for most users, but these rules leave much undecided, -especially when it comes to nested emphasis. The original -`Markdown.pl` test suite makes it clear that triple `***` and -`___` delimiters can be used for strong emphasis, and most -implementations have also allowed the following patterns: - -``` markdown -***strong emph*** -***strong** in emph* -***emph* in strong** -**in strong *emph*** -*in emph **strong*** -``` - -The following patterns are less widely supported, but the intent -is clear and they are useful (especially in contexts like bibliography -entries): - -``` markdown -*emph *with emph* in it* -**strong **with strong** in it** -``` - -Many implementations have also restricted intraword emphasis to -the `*` 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.) - -``` markdown -internal emphasis: foo*bar*baz -no emphasis: foo_bar_baz -``` - -The rules given below capture all of these patterns, while allowing -for efficient parsing strategies that do not backtrack. - -First, some definitions. A [delimiter run](@) is either -a sequence of one or more `*` characters that is not preceded or -followed by a non-backslash-escaped `*` character, or a sequence -of one or more `_` characters that is not preceded or followed by -a non-backslash-escaped `_` character. - -A [left-flanking delimiter run](@) 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. - -A [right-flanking delimiter run](@) 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. - -Here are some examples of delimiter runs. - - - left-flanking but not right-flanking: - - ``` - ***abc - _abc - **"abc" - _"abc" - ``` - - - right-flanking but not left-flanking: - - ``` - abc*** - abc_ - "abc"** - "abc"_ - ``` - - - Both left and right-flanking: - - ``` - abc***def - "abc"_"def" - ``` - - - Neither left nor right-flanking: - - ``` - abc *** def - a _ b - ``` - -(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 -[vfmd](http://www.vfmd.org/vfmd-spec/specification/#procedure-for-identifying-emphasis-tags). -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.) - -The following rules define emphasis and strong emphasis: - -1. A single `*` character [can open emphasis](@) - iff (if and only if) it is part of a [left-flanking delimiter run]. - -2. A single `_` 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. - -3. A single `*` character [can close emphasis](@) - iff it is part of a [right-flanking delimiter run]. - -4. A single `_` 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. - -5. A double `**` [can open strong emphasis](@) - iff it is part of a [left-flanking delimiter run]. - -6. A double `__` [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. - -7. A double `**` [can close strong emphasis](@) - iff it is part of a [right-flanking delimiter run]. - -8. A double `__` [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. - -9. Emphasis begins with a delimiter that [can open emphasis] and ends - with a delimiter that [can close emphasis], and that uses the same - character (`_` or `*`) as the opening delimiter. The - opening and closing delimiters must belong to separate - [delimiter runs]. If one of the delimiters can both - open and close emphasis, then the sum of the lengths of the - delimiter runs containing the opening and closing delimiters - must not be a multiple of 3 unless both lengths are - multiples of 3. - -10. 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 - (`_` or `*`) as the opening delimiter. The - opening and closing delimiters must belong to separate - [delimiter runs]. If one of the delimiters can both open - and close strong emphasis, then the sum of the lengths of - the delimiter runs containing the opening and closing - delimiters must not be a multiple of 3 unless both lengths - are multiples of 3. - -11. A literal `*` character cannot occur at the beginning or end of - `*`-delimited emphasis or `**`-delimited strong emphasis, unless it - is backslash-escaped. - -12. A literal `_` character cannot occur at the beginning or end of - `_`-delimited emphasis or `__`-delimited strong emphasis, unless it - is backslash-escaped. - -Where rules 1--12 above are compatible with multiple parsings, -the following principles resolve ambiguity: - -13. The number of nestings should be minimized. Thus, for example, - an interpretation `<strong>...</strong>` is always preferred to - `<em><em>...</em></em>`. - -14. An interpretation `<em><strong>...</strong></em>` is always - preferred to `<strong><em>...</em></strong>`. - -15. 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, - `*foo _bar* baz_` is parsed as `<em>foo _bar</em> baz_` rather - than `*foo <em>bar* baz</em>`. - -16. 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, - `**foo **bar baz**` is parsed as `**foo <strong>bar baz</strong>` - rather than `<strong>foo **bar baz</strong>`. - -17. 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, `*[foo*](bar)` is - parsed as `*<a href="bar">foo*</a>` rather than as - `<em>[foo</em>](bar)`. - -These rules can be illustrated through a series of examples. - -Rule 1: - -```````````````````````````````` example -*foo bar* -. -<p><em>foo bar</em></p> -```````````````````````````````` - - -This is not emphasis, because the opening `*` is followed by -whitespace, and hence not part of a [left-flanking delimiter run]: - -```````````````````````````````` example -a * foo bar* -. -<p>a * foo bar*</p> -```````````````````````````````` - - -This is not emphasis, because the opening `*` is preceded -by an alphanumeric and followed by punctuation, and hence -not part of a [left-flanking delimiter run]: - -```````````````````````````````` example -a*"foo"* -. -<p>a*"foo"*</p> -```````````````````````````````` - - -Unicode nonbreaking spaces count as whitespace, too: - -```````````````````````````````` example -* a * -. -<p>* a *</p> -```````````````````````````````` - - -Intraword emphasis with `*` is permitted: - -```````````````````````````````` example -foo*bar* -. -<p>foo<em>bar</em></p> -```````````````````````````````` - - -```````````````````````````````` example -5*6*78 -. -<p>5<em>6</em>78</p> -```````````````````````````````` - - -Rule 2: - -```````````````````````````````` example -_foo bar_ -. -<p><em>foo bar</em></p> -```````````````````````````````` - - -This is not emphasis, because the opening `_` is followed by -whitespace: - -```````````````````````````````` example -_ foo bar_ -. -<p>_ foo bar_</p> -```````````````````````````````` - - -This is not emphasis, because the opening `_` is preceded -by an alphanumeric and followed by punctuation: - -```````````````````````````````` example -a_"foo"_ -. -<p>a_"foo"_</p> -```````````````````````````````` - - -Emphasis with `_` is not allowed inside words: - -```````````````````````````````` example -foo_bar_ -. -<p>foo_bar_</p> -```````````````````````````````` - - -```````````````````````````````` example -5_6_78 -. -<p>5_6_78</p> -```````````````````````````````` - - -```````````````````````````````` example -приÑтанÑм_ÑтремÑÑ‚ÑÑ_ -. -<p>приÑтанÑм_ÑтремÑÑ‚ÑÑ_</p> -```````````````````````````````` - - -Here `_` does not generate emphasis, because the first delimiter run -is right-flanking and the second left-flanking: - -```````````````````````````````` example -aa_"bb"_cc -. -<p>aa_"bb"_cc</p> -```````````````````````````````` - - -This is emphasis, even though the opening delimiter is -both left- and right-flanking, because it is preceded by -punctuation: - -```````````````````````````````` example -foo-_(bar)_ -. -<p>foo-<em>(bar)</em></p> -```````````````````````````````` - - -Rule 3: - -This is not emphasis, because the closing delimiter does -not match the opening delimiter: - -```````````````````````````````` example -_foo* -. -<p>_foo*</p> -```````````````````````````````` - - -This is not emphasis, because the closing `*` is preceded by -whitespace: - -```````````````````````````````` example -*foo bar * -. -<p>*foo bar *</p> -```````````````````````````````` - - -A newline also counts as whitespace: - -```````````````````````````````` example -*foo bar -* -. -<p>*foo bar -*</p> -```````````````````````````````` - - -This is not emphasis, because the second `*` is -preceded by punctuation and followed by an alphanumeric -(hence it is not part of a [right-flanking delimiter run]: - -```````````````````````````````` example -*(*foo) -. -<p>*(*foo)</p> -```````````````````````````````` - - -The point of this restriction is more easily appreciated -with this example: - -```````````````````````````````` example -*(*foo*)* -. -<p><em>(<em>foo</em>)</em></p> -```````````````````````````````` - - -Intraword emphasis with `*` is allowed: - -```````````````````````````````` example -*foo*bar -. -<p><em>foo</em>bar</p> -```````````````````````````````` - - - -Rule 4: - -This is not emphasis, because the closing `_` is preceded by -whitespace: - -```````````````````````````````` example -_foo bar _ -. -<p>_foo bar _</p> -```````````````````````````````` - - -This is not emphasis, because the second `_` is -preceded by punctuation and followed by an alphanumeric: - -```````````````````````````````` example -_(_foo) -. -<p>_(_foo)</p> -```````````````````````````````` - - -This is emphasis within emphasis: - -```````````````````````````````` example -_(_foo_)_ -. -<p><em>(<em>foo</em>)</em></p> -```````````````````````````````` - - -Intraword emphasis is disallowed for `_`: - -```````````````````````````````` example -_foo_bar -. -<p>_foo_bar</p> -```````````````````````````````` - - -```````````````````````````````` example -_приÑтанÑм_ÑтремÑÑ‚ÑÑ -. -<p>_приÑтанÑм_ÑтремÑÑ‚ÑÑ</p> -```````````````````````````````` - - -```````````````````````````````` example -_foo_bar_baz_ -. -<p><em>foo_bar_baz</em></p> -```````````````````````````````` - - -This is emphasis, even though the closing delimiter is -both left- and right-flanking, because it is followed by -punctuation: - -```````````````````````````````` example -_(bar)_. -. -<p><em>(bar)</em>.</p> -```````````````````````````````` - - -Rule 5: - -```````````````````````````````` example -**foo bar** -. -<p><strong>foo bar</strong></p> -```````````````````````````````` - - -This is not strong emphasis, because the opening delimiter is -followed by whitespace: - -```````````````````````````````` example -** foo bar** -. -<p>** foo bar**</p> -```````````````````````````````` - - -This is not strong emphasis, because the opening `**` is preceded -by an alphanumeric and followed by punctuation, and hence -not part of a [left-flanking delimiter run]: - -```````````````````````````````` example -a**"foo"** -. -<p>a**"foo"**</p> -```````````````````````````````` - - -Intraword strong emphasis with `**` is permitted: - -```````````````````````````````` example -foo**bar** -. -<p>foo<strong>bar</strong></p> -```````````````````````````````` - - -Rule 6: - -```````````````````````````````` example -__foo bar__ -. -<p><strong>foo bar</strong></p> -```````````````````````````````` - - -This is not strong emphasis, because the opening delimiter is -followed by whitespace: - -```````````````````````````````` example -__ foo bar__ -. -<p>__ foo bar__</p> -```````````````````````````````` - - -A newline counts as whitespace: -```````````````````````````````` example -__ -foo bar__ -. -<p>__ -foo bar__</p> -```````````````````````````````` - - -This is not strong emphasis, because the opening `__` is preceded -by an alphanumeric and followed by punctuation: - -```````````````````````````````` example -a__"foo"__ -. -<p>a__"foo"__</p> -```````````````````````````````` - - -Intraword strong emphasis is forbidden with `__`: - -```````````````````````````````` example -foo__bar__ -. -<p>foo__bar__</p> -```````````````````````````````` - - -```````````````````````````````` example -5__6__78 -. -<p>5__6__78</p> -```````````````````````````````` - - -```````````````````````````````` example -приÑтанÑм__ÑтремÑÑ‚ÑÑ__ -. -<p>приÑтанÑм__ÑтремÑÑ‚ÑÑ__</p> -```````````````````````````````` - - -```````````````````````````````` example -__foo, __bar__, baz__ -. -<p><strong>foo, <strong>bar</strong>, baz</strong></p> -```````````````````````````````` - - -This is strong emphasis, even though the opening delimiter is -both left- and right-flanking, because it is preceded by -punctuation: - -```````````````````````````````` example -foo-__(bar)__ -. -<p>foo-<strong>(bar)</strong></p> -```````````````````````````````` - - - -Rule 7: - -This is not strong emphasis, because the closing delimiter is preceded -by whitespace: - -```````````````````````````````` example -**foo bar ** -. -<p>**foo bar **</p> -```````````````````````````````` - - -(Nor can it be interpreted as an emphasized `*foo bar *`, because of -Rule 11.) - -This is not strong emphasis, because the second `**` is -preceded by punctuation and followed by an alphanumeric: - -```````````````````````````````` example -**(**foo) -. -<p>**(**foo)</p> -```````````````````````````````` - - -The point of this restriction is more easily appreciated -with these examples: - -```````````````````````````````` example -*(**foo**)* -. -<p><em>(<strong>foo</strong>)</em></p> -```````````````````````````````` - - -```````````````````````````````` example -**Gomphocarpus (*Gomphocarpus physocarpus*, syn. -*Asclepias physocarpa*)** -. -<p><strong>Gomphocarpus (<em>Gomphocarpus physocarpus</em>, syn. -<em>Asclepias physocarpa</em>)</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -**foo "*bar*" foo** -. -<p><strong>foo "<em>bar</em>" foo</strong></p> -```````````````````````````````` - - -Intraword emphasis: - -```````````````````````````````` example -**foo**bar -. -<p><strong>foo</strong>bar</p> -```````````````````````````````` - - -Rule 8: - -This is not strong emphasis, because the closing delimiter is -preceded by whitespace: - -```````````````````````````````` example -__foo bar __ -. -<p>__foo bar __</p> -```````````````````````````````` - - -This is not strong emphasis, because the second `__` is -preceded by punctuation and followed by an alphanumeric: - -```````````````````````````````` example -__(__foo) -. -<p>__(__foo)</p> -```````````````````````````````` - - -The point of this restriction is more easily appreciated -with this example: - -```````````````````````````````` example -_(__foo__)_ -. -<p><em>(<strong>foo</strong>)</em></p> -```````````````````````````````` - - -Intraword strong emphasis is forbidden with `__`: - -```````````````````````````````` example -__foo__bar -. -<p>__foo__bar</p> -```````````````````````````````` - - -```````````````````````````````` example -__приÑтанÑм__ÑтремÑÑ‚ÑÑ -. -<p>__приÑтанÑм__ÑтремÑÑ‚ÑÑ</p> -```````````````````````````````` - - -```````````````````````````````` example -__foo__bar__baz__ -. -<p><strong>foo__bar__baz</strong></p> -```````````````````````````````` - - -This is strong emphasis, even though the closing delimiter is -both left- and right-flanking, because it is followed by -punctuation: - -```````````````````````````````` example -__(bar)__. -. -<p><strong>(bar)</strong>.</p> -```````````````````````````````` - - -Rule 9: - -Any nonempty sequence of inline elements can be the contents of an -emphasized span. - -```````````````````````````````` example -*foo [bar](/url)* -. -<p><em>foo <a href="/url">bar</a></em></p> -```````````````````````````````` - - -```````````````````````````````` example -*foo -bar* -. -<p><em>foo -bar</em></p> -```````````````````````````````` - - -In particular, emphasis and strong emphasis can be nested -inside emphasis: - -```````````````````````````````` example -_foo __bar__ baz_ -. -<p><em>foo <strong>bar</strong> baz</em></p> -```````````````````````````````` - - -```````````````````````````````` example -_foo _bar_ baz_ -. -<p><em>foo <em>bar</em> baz</em></p> -```````````````````````````````` - - -```````````````````````````````` example -__foo_ bar_ -. -<p><em><em>foo</em> bar</em></p> -```````````````````````````````` - - -```````````````````````````````` example -*foo *bar** -. -<p><em>foo <em>bar</em></em></p> -```````````````````````````````` - - -```````````````````````````````` example -*foo **bar** baz* -. -<p><em>foo <strong>bar</strong> baz</em></p> -```````````````````````````````` - -```````````````````````````````` example -*foo**bar**baz* -. -<p><em>foo<strong>bar</strong>baz</em></p> -```````````````````````````````` - -Note that in the preceding case, the interpretation - -``` markdown -<p><em>foo</em><em>bar<em></em>baz</em></p> -``` - - -is precluded by the condition that a delimiter that -can both open and close (like the `*` after `foo`) -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. - - -For the same reason, we don't get two consecutive -emphasis sections in this example: - -```````````````````````````````` example -*foo**bar* -. -<p><em>foo**bar</em></p> -```````````````````````````````` - - -The same condition ensures that the following -cases are all strong emphasis nested inside -emphasis, even when the interior spaces are -omitted: - - -```````````````````````````````` example -***foo** bar* -. -<p><em><strong>foo</strong> bar</em></p> -```````````````````````````````` - - -```````````````````````````````` example -*foo **bar*** -. -<p><em>foo <strong>bar</strong></em></p> -```````````````````````````````` - - -```````````````````````````````` example -*foo**bar*** -. -<p><em>foo<strong>bar</strong></em></p> -```````````````````````````````` - - -When the lengths of the interior closing and opening -delimiter runs are *both* multiples of 3, though, -they can match to create emphasis: - -```````````````````````````````` example -foo***bar***baz -. -<p>foo<em><strong>bar</strong></em>baz</p> -```````````````````````````````` - -```````````````````````````````` example -foo******bar*********baz -. -<p>foo<strong><strong><strong>bar</strong></strong></strong>***baz</p> -```````````````````````````````` - - -Indefinite levels of nesting are possible: - -```````````````````````````````` example -*foo **bar *baz* bim** bop* -. -<p><em>foo <strong>bar <em>baz</em> bim</strong> bop</em></p> -```````````````````````````````` - - -```````````````````````````````` example -*foo [*bar*](/url)* -. -<p><em>foo <a href="/url"><em>bar</em></a></em></p> -```````````````````````````````` - - -There can be no empty emphasis or strong emphasis: - -```````````````````````````````` example -** is not an empty emphasis -. -<p>** is not an empty emphasis</p> -```````````````````````````````` - - -```````````````````````````````` example -**** is not an empty strong emphasis -. -<p>**** is not an empty strong emphasis</p> -```````````````````````````````` - - - -Rule 10: - -Any nonempty sequence of inline elements can be the contents of an -strongly emphasized span. - -```````````````````````````````` example -**foo [bar](/url)** -. -<p><strong>foo <a href="/url">bar</a></strong></p> -```````````````````````````````` - - -```````````````````````````````` example -**foo -bar** -. -<p><strong>foo -bar</strong></p> -```````````````````````````````` - - -In particular, emphasis and strong emphasis can be nested -inside strong emphasis: - -```````````````````````````````` example -__foo _bar_ baz__ -. -<p><strong>foo <em>bar</em> baz</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -__foo __bar__ baz__ -. -<p><strong>foo <strong>bar</strong> baz</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -____foo__ bar__ -. -<p><strong><strong>foo</strong> bar</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -**foo **bar**** -. -<p><strong>foo <strong>bar</strong></strong></p> -```````````````````````````````` - - -```````````````````````````````` example -**foo *bar* baz** -. -<p><strong>foo <em>bar</em> baz</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -**foo*bar*baz** -. -<p><strong>foo<em>bar</em>baz</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -***foo* bar** -. -<p><strong><em>foo</em> bar</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -**foo *bar*** -. -<p><strong>foo <em>bar</em></strong></p> -```````````````````````````````` - - -Indefinite levels of nesting are possible: - -```````````````````````````````` example -**foo *bar **baz** -bim* bop** -. -<p><strong>foo <em>bar <strong>baz</strong> -bim</em> bop</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -**foo [*bar*](/url)** -. -<p><strong>foo <a href="/url"><em>bar</em></a></strong></p> -```````````````````````````````` - - -There can be no empty emphasis or strong emphasis: - -```````````````````````````````` example -__ is not an empty emphasis -. -<p>__ is not an empty emphasis</p> -```````````````````````````````` - - -```````````````````````````````` example -____ is not an empty strong emphasis -. -<p>____ is not an empty strong emphasis</p> -```````````````````````````````` - - - -Rule 11: - -```````````````````````````````` example -foo *** -. -<p>foo ***</p> -```````````````````````````````` - - -```````````````````````````````` example -foo *\** -. -<p>foo <em>*</em></p> -```````````````````````````````` - - -```````````````````````````````` example -foo *_* -. -<p>foo <em>_</em></p> -```````````````````````````````` - - -```````````````````````````````` example -foo ***** -. -<p>foo *****</p> -```````````````````````````````` - - -```````````````````````````````` example -foo **\*** -. -<p>foo <strong>*</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -foo **_** -. -<p>foo <strong>_</strong></p> -```````````````````````````````` - - -Note that when delimiters do not match evenly, Rule 11 determines -that the excess literal `*` characters will appear outside of the -emphasis, rather than inside it: - -```````````````````````````````` example -**foo* -. -<p>*<em>foo</em></p> -```````````````````````````````` - - -```````````````````````````````` example -*foo** -. -<p><em>foo</em>*</p> -```````````````````````````````` - - -```````````````````````````````` example -***foo** -. -<p>*<strong>foo</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -****foo* -. -<p>***<em>foo</em></p> -```````````````````````````````` - - -```````````````````````````````` example -**foo*** -. -<p><strong>foo</strong>*</p> -```````````````````````````````` - - -```````````````````````````````` example -*foo**** -. -<p><em>foo</em>***</p> -```````````````````````````````` - - - -Rule 12: - -```````````````````````````````` example -foo ___ -. -<p>foo ___</p> -```````````````````````````````` - - -```````````````````````````````` example -foo _\__ -. -<p>foo <em>_</em></p> -```````````````````````````````` - - -```````````````````````````````` example -foo _*_ -. -<p>foo <em>*</em></p> -```````````````````````````````` - - -```````````````````````````````` example -foo _____ -. -<p>foo _____</p> -```````````````````````````````` - - -```````````````````````````````` example -foo __\___ -. -<p>foo <strong>_</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -foo __*__ -. -<p>foo <strong>*</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -__foo_ -. -<p>_<em>foo</em></p> -```````````````````````````````` - - -Note that when delimiters do not match evenly, Rule 12 determines -that the excess literal `_` characters will appear outside of the -emphasis, rather than inside it: - -```````````````````````````````` example -_foo__ -. -<p><em>foo</em>_</p> -```````````````````````````````` - - -```````````````````````````````` example -___foo__ -. -<p>_<strong>foo</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -____foo_ -. -<p>___<em>foo</em></p> -```````````````````````````````` - - -```````````````````````````````` example -__foo___ -. -<p><strong>foo</strong>_</p> -```````````````````````````````` - - -```````````````````````````````` example -_foo____ -. -<p><em>foo</em>___</p> -```````````````````````````````` - - -Rule 13 implies that if you want emphasis nested directly inside -emphasis, you must use different delimiters: - -```````````````````````````````` example -**foo** -. -<p><strong>foo</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -*_foo_* -. -<p><em><em>foo</em></em></p> -```````````````````````````````` - - -```````````````````````````````` example -__foo__ -. -<p><strong>foo</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -_*foo*_ -. -<p><em><em>foo</em></em></p> -```````````````````````````````` - - -However, strong emphasis within strong emphasis is possible without -switching delimiters: - -```````````````````````````````` example -****foo**** -. -<p><strong><strong>foo</strong></strong></p> -```````````````````````````````` - - -```````````````````````````````` example -____foo____ -. -<p><strong><strong>foo</strong></strong></p> -```````````````````````````````` - - - -Rule 13 can be applied to arbitrarily long sequences of -delimiters: - -```````````````````````````````` example -******foo****** -. -<p><strong><strong><strong>foo</strong></strong></strong></p> -```````````````````````````````` - - -Rule 14: - -```````````````````````````````` example -***foo*** -. -<p><em><strong>foo</strong></em></p> -```````````````````````````````` - - -```````````````````````````````` example -_____foo_____ -. -<p><em><strong><strong>foo</strong></strong></em></p> -```````````````````````````````` - - -Rule 15: - -```````````````````````````````` example -*foo _bar* baz_ -. -<p><em>foo _bar</em> baz_</p> -```````````````````````````````` - - -```````````````````````````````` example -*foo __bar *baz bim__ bam* -. -<p><em>foo <strong>bar *baz bim</strong> bam</em></p> -```````````````````````````````` - - -Rule 16: - -```````````````````````````````` example -**foo **bar baz** -. -<p>**foo <strong>bar baz</strong></p> -```````````````````````````````` - - -```````````````````````````````` example -*foo *bar baz* -. -<p>*foo <em>bar baz</em></p> -```````````````````````````````` - - -Rule 17: - -```````````````````````````````` example -*[bar*](/url) -. -<p>*<a href="/url">bar*</a></p> -```````````````````````````````` - - -```````````````````````````````` example -_foo [bar_](/url) -. -<p>_foo <a href="/url">bar_</a></p> -```````````````````````````````` - - -```````````````````````````````` example -*<img src="foo" title="*"/> -. -<p>*<img src="foo" title="*"/></p> -```````````````````````````````` - - -```````````````````````````````` example -**<a href="**"> -. -<p>**<a href="**"></p> -```````````````````````````````` - - -```````````````````````````````` example -__<a href="__"> -. -<p>__<a href="__"></p> -```````````````````````````````` - - -```````````````````````````````` example -*a `*`* -. -<p><em>a <code>*</code></em></p> -```````````````````````````````` - - -```````````````````````````````` example -_a `_`_ -. -<p><em>a <code>_</code></em></p> -```````````````````````````````` - - -```````````````````````````````` example -**a<http://foo.bar/?q=**> -. -<p>**a<a href="http://foo.bar/?q=**">http://foo.bar/?q=**</a></p> -```````````````````````````````` - - -```````````````````````````````` example -__a<http://foo.bar/?q=__> -. -<p>__a<a href="http://foo.bar/?q=__">http://foo.bar/?q=__</a></p> -```````````````````````````````` - - -<div class="extension"> - -## Strikethrough (extension) - -GFM enables the `strikethrough` extension, where an additional emphasis type is -available. - -Strikethrough text is any text wrapped in two tildes (`~`). - -```````````````````````````````` example strikethrough -~~Hi~~ Hello, world! -. -<p><del>Hi</del> Hello, world!</p> -```````````````````````````````` - -As with regular emphasis delimiters, a new paragraph will cause strikethrough -parsing to cease: - -```````````````````````````````` example strikethrough -This ~~has a - -new paragraph~~. -. -<p>This ~~has a</p> -<p>new paragraph~~.</p> -```````````````````````````````` - -</div> - -## Links - -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. - -A [link text](@) consists of a sequence of zero or more -inline elements enclosed by square brackets (`[` and `]`). The -following rules apply: - -- 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. - -- 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 `[`, a sequence of zero or more inlines, and - a close bracket `]`. - -- Backtick [code spans], [autolinks], and raw [HTML tags] bind more tightly - than the brackets in link text. Thus, for example, - `` [foo`]` `` could not be a link text, since the second `]` - is part of a code span. - -- The brackets in link text bind more tightly than markers for - [emphasis and strong emphasis]. Thus, for example, `*[foo*](url)` is a link. - -A [link destination](@) consists of either - -- a sequence of zero or more characters between an opening `<` and a - closing `>` that contains no line breaks or unescaped - `<` or `>` characters, or - -- a nonempty sequence of characters that does not start with - `<`, 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. - (Implementations may impose limits on parentheses nesting to - avoid performance issues, but at least three levels of nesting - should be supported.) - -A [link title](@) consists of either - -- a sequence of zero or more characters between straight double-quote - characters (`"`), including a `"` character only if it is - backslash-escaped, or - -- a sequence of zero or more characters between straight single-quote - characters (`'`), including a `'` character only if it is - backslash-escaped, or - -- a sequence of zero or more characters between matching parentheses - (`(...)`), including a `(` or `)` character only if it is - backslash-escaped. - -Although [link titles] may span multiple lines, they may not contain -a [blank line]. - -An [inline link](@) consists of a [link text] followed immediately -by a left parenthesis `(`, optional [whitespace], an optional -[link destination], an optional [link title] separated from the link -destination by [whitespace], optional [whitespace], and a right -parenthesis `)`. The link's text consists of the inlines contained -in the [link text] (excluding the enclosing square brackets). -The link's URI consists of the link destination, excluding enclosing -`<...>` if present, with backslash-escapes in effect as described -above. The link's title consists of the link title, excluding its -enclosing delimiters, with backslash-escapes in effect as described -above. - -Here is a simple inline link: - -```````````````````````````````` example -[link](/uri "title") -. -<p><a href="/uri" title="title">link</a></p> -```````````````````````````````` - - -The title may be omitted: - -```````````````````````````````` example -[link](/uri) -. -<p><a href="/uri">link</a></p> -```````````````````````````````` - - -Both the title and the destination may be omitted: - -```````````````````````````````` example -[link]() -. -<p><a href="">link</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[link](<>) -. -<p><a href="">link</a></p> -```````````````````````````````` - -The destination can only contain spaces if it is -enclosed in pointy brackets: - -```````````````````````````````` example -[link](/my uri) -. -<p>[link](/my uri)</p> -```````````````````````````````` - -```````````````````````````````` example -[link](</my uri>) -. -<p><a href="/my%20uri">link</a></p> -```````````````````````````````` - -The destination cannot contain line breaks, -even if enclosed in pointy brackets: - -```````````````````````````````` example -[link](foo -bar) -. -<p>[link](foo -bar)</p> -```````````````````````````````` - -```````````````````````````````` example -[link](<foo -bar>) -. -<p>[link](<foo -bar>)</p> -```````````````````````````````` - -The destination can contain `)` if it is enclosed -in pointy brackets: - -```````````````````````````````` example -[a](<b)c>) -. -<p><a href="b)c">a</a></p> -```````````````````````````````` - -Pointy brackets that enclose links must be unescaped: - -```````````````````````````````` example -[link](<foo\>) -. -<p>[link](<foo>)</p> -```````````````````````````````` - -These are not links, because the opening pointy bracket -is not matched properly: - -```````````````````````````````` example -[a](<b)c -[a](<b)c> -[a](<b>c) -. -<p>[a](<b)c -[a](<b)c> -[a](<b>c)</p> -```````````````````````````````` - -Parentheses inside the link destination may be escaped: - -```````````````````````````````` example -[link](\(foo\)) -. -<p><a href="(foo)">link</a></p> -```````````````````````````````` - -Any number of parentheses are allowed without escaping, as long as they are -balanced: - -```````````````````````````````` example -[link](foo(and(bar))) -. -<p><a href="foo(and(bar))">link</a></p> -```````````````````````````````` - -However, if you have unbalanced parentheses, you need to escape or use the -`<...>` form: - -```````````````````````````````` example -[link](foo\(and\(bar\)) -. -<p><a href="foo(and(bar)">link</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[link](<foo(and(bar)>) -. -<p><a href="foo(and(bar)">link</a></p> -```````````````````````````````` - - -Parentheses and other symbols can also be escaped, as usual -in Markdown: - -```````````````````````````````` example -[link](foo\)\:) -. -<p><a href="foo):">link</a></p> -```````````````````````````````` - - -A link can contain fragment identifiers and queries: - -```````````````````````````````` example -[link](#fragment) - -[link](http://example.com#fragment) - -[link](http://example.com?foo=3#frag) -. -<p><a href="#fragment">link</a></p> -<p><a href="http://example.com#fragment">link</a></p> -<p><a href="http://example.com?foo=3#frag">link</a></p> -```````````````````````````````` - - -Note that a backslash before a non-escapable character is -just a backslash: - -```````````````````````````````` example -[link](foo\bar) -. -<p><a href="foo%5Cbar">link</a></p> -```````````````````````````````` - - -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 -be optionally URL-escaped when written as HTML, but this spec -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. - -```````````````````````````````` example -[link](foo%20bä) -. -<p><a href="foo%20b%C3%A4">link</a></p> -```````````````````````````````` - - -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: - -```````````````````````````````` example -[link]("title") -. -<p><a href="%22title%22">link</a></p> -```````````````````````````````` - - -Titles may be in single quotes, double quotes, or parentheses: - -```````````````````````````````` example -[link](/url "title") -[link](/url 'title') -[link](/url (title)) -. -<p><a href="/url" title="title">link</a> -<a href="/url" title="title">link</a> -<a href="/url" title="title">link</a></p> -```````````````````````````````` - - -Backslash escapes and entity and numeric character references -may be used in titles: - -```````````````````````````````` example -[link](/url "title \""") -. -<p><a href="/url" title="title """>link</a></p> -```````````````````````````````` - - -Titles must be separated from the link using a [whitespace]. -Other [Unicode whitespace] like non-breaking space doesn't work. - -```````````````````````````````` example -[link](/url "title") -. -<p><a href="/url%C2%A0%22title%22">link</a></p> -```````````````````````````````` - - -Nested balanced quotes are not allowed without escaping: - -```````````````````````````````` example -[link](/url "title "and" title") -. -<p>[link](/url "title "and" title")</p> -```````````````````````````````` - - -But it is easy to work around this by using a different quote type: - -```````````````````````````````` example -[link](/url 'title "and" title') -. -<p><a href="/url" title="title "and" title">link</a></p> -```````````````````````````````` - - -(Note: `Markdown.pl` 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, -entity and numeric character references, or using a different -quote type for the enclosing title---to write titles containing -double quotes. `Markdown.pl`'s handling of titles has a number -of other strange features. For example, it allows single-quoted -titles in inline links, but not reference links. And, in -reference links but not inline links, it allows a title to begin -with `"` and end with `)`. `Markdown.pl` 1.0.1 even allows -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.) - -[Whitespace] is allowed around the destination and title: - -```````````````````````````````` example -[link]( /uri - "title" ) -. -<p><a href="/uri" title="title">link</a></p> -```````````````````````````````` - - -But it is not allowed between the link text and the -following parenthesis: - -```````````````````````````````` example -[link] (/uri) -. -<p>[link] (/uri)</p> -```````````````````````````````` - - -The link text may contain balanced brackets, but not unbalanced ones, -unless they are escaped: - -```````````````````````````````` example -[link [foo [bar]]](/uri) -. -<p><a href="/uri">link [foo [bar]]</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[link] bar](/uri) -. -<p>[link] bar](/uri)</p> -```````````````````````````````` - - -```````````````````````````````` example -[link [bar](/uri) -. -<p>[link <a href="/uri">bar</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[link \[bar](/uri) -. -<p><a href="/uri">link [bar</a></p> -```````````````````````````````` - - -The link text may contain inline content: - -```````````````````````````````` example -[link *foo **bar** `#`*](/uri) -. -<p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p> -```````````````````````````````` - - -```````````````````````````````` example -[](/uri) -. -<p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p> -```````````````````````````````` - - -However, links may not contain other links, at any level of nesting. - -```````````````````````````````` example -[foo [bar](/uri)](/uri) -. -<p>[foo <a href="/uri">bar</a>](/uri)</p> -```````````````````````````````` - - -```````````````````````````````` example -[foo *[bar [baz](/uri)](/uri)*](/uri) -. -<p>[foo <em>[bar <a href="/uri">baz</a>](/uri)</em>](/uri)</p> -```````````````````````````````` - - -```````````````````````````````` example -](uri2)](uri3) -. -<p><img src="uri3" alt="[foo](uri2)" /></p> -```````````````````````````````` - - -These cases illustrate the precedence of link text grouping over -emphasis grouping: - -```````````````````````````````` example -*[foo*](/uri) -. -<p>*<a href="/uri">foo*</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[foo *bar](baz*) -. -<p><a href="baz*">foo *bar</a></p> -```````````````````````````````` - - -Note that brackets that *aren't* part of links do not take -precedence: - -```````````````````````````````` example -*foo [bar* baz] -. -<p><em>foo [bar</em> baz]</p> -```````````````````````````````` - - -These cases illustrate the precedence of HTML tags, code spans, -and autolinks over link grouping: - -```````````````````````````````` example -[foo <bar attr="](baz)"> -. -<p>[foo <bar attr="](baz)"></p> -```````````````````````````````` - - -```````````````````````````````` example -[foo`](/uri)` -. -<p>[foo<code>](/uri)</code></p> -```````````````````````````````` - - -```````````````````````````````` example -[foo<http://example.com/?search=](uri)> -. -<p>[foo<a href="http://example.com/?search=%5D(uri)">http://example.com/?search=](uri)</a></p> -```````````````````````````````` - - -There are three kinds of [reference link](@)s: -[full](#full-reference-link), [collapsed](#collapsed-reference-link), -and [shortcut](#shortcut-reference-link). - -A [full reference link](@) -consists of a [link text] immediately followed by a [link label] -that [matches] a [link reference definition] elsewhere in the document. - -A [link label](@) begins with a left bracket (`[`) and ends -with the first right bracket (`]`) 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. - -One label [matches](@) -another just in case their normalized forms are equal. To normalize a -label, strip off the opening and closing brackets, -perform the *Unicode case fold*, strip leading and trailing -[whitespace] and collapse consecutive internal -[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.) - -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]. - -Here is a simple example: - -```````````````````````````````` example -[foo][bar] - -[bar]: /url "title" -. -<p><a href="/url" title="title">foo</a></p> -```````````````````````````````` - - -The rules for the [link text] are the same as with -[inline links]. Thus: - -The link text may contain balanced brackets, but not unbalanced ones, -unless they are escaped: - -```````````````````````````````` example -[link [foo [bar]]][ref] - -[ref]: /uri -. -<p><a href="/uri">link [foo [bar]]</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[link \[bar][ref] - -[ref]: /uri -. -<p><a href="/uri">link [bar</a></p> -```````````````````````````````` - - -The link text may contain inline content: - -```````````````````````````````` example -[link *foo **bar** `#`*][ref] - -[ref]: /uri -. -<p><a href="/uri">link <em>foo <strong>bar</strong> <code>#</code></em></a></p> -```````````````````````````````` - - -```````````````````````````````` example -[][ref] - -[ref]: /uri -. -<p><a href="/uri"><img src="moon.jpg" alt="moon" /></a></p> -```````````````````````````````` - - -However, links may not contain other links, at any level of nesting. - -```````````````````````````````` example -[foo [bar](/uri)][ref] - -[ref]: /uri -. -<p>[foo <a href="/uri">bar</a>]<a href="/uri">ref</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[foo *bar [baz][ref]*][ref] - -[ref]: /uri -. -<p>[foo <em>bar <a href="/uri">baz</a></em>]<a href="/uri">ref</a></p> -```````````````````````````````` - - -(In the examples above, we have two [shortcut reference links] -instead of one [full reference link].) - -The following cases illustrate the precedence of link text grouping over -emphasis grouping: - -```````````````````````````````` example -*[foo*][ref] - -[ref]: /uri -. -<p>*<a href="/uri">foo*</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[foo *bar][ref] - -[ref]: /uri -. -<p><a href="/uri">foo *bar</a></p> -```````````````````````````````` - - -These cases illustrate the precedence of HTML tags, code spans, -and autolinks over link grouping: - -```````````````````````````````` example -[foo <bar attr="][ref]"> - -[ref]: /uri -. -<p>[foo <bar attr="][ref]"></p> -```````````````````````````````` - - -```````````````````````````````` example -[foo`][ref]` - -[ref]: /uri -. -<p>[foo<code>][ref]</code></p> -```````````````````````````````` - - -```````````````````````````````` example -[foo<http://example.com/?search=][ref]> - -[ref]: /uri -. -<p>[foo<a href="http://example.com/?search=%5D%5Bref%5D">http://example.com/?search=][ref]</a></p> -```````````````````````````````` - - -Matching is case-insensitive: - -```````````````````````````````` example -[foo][BaR] - -[bar]: /url "title" -. -<p><a href="/url" title="title">foo</a></p> -```````````````````````````````` - - -Unicode case fold is used: - -```````````````````````````````` example -[Толпой][Толпой] is a Russian word. - -[ТОЛПОЙ]: /url -. -<p><a href="/url">Толпой</a> is a Russian word.</p> -```````````````````````````````` - - -Consecutive internal [whitespace] is treated as one space for -purposes of determining matching: - -```````````````````````````````` example -[Foo - bar]: /url - -[Baz][Foo bar] -. -<p><a href="/url">Baz</a></p> -```````````````````````````````` - - -No [whitespace] is allowed between the [link text] and the -[link label]: - -```````````````````````````````` example -[foo] [bar] - -[bar]: /url "title" -. -<p>[foo] <a href="/url" title="title">bar</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[foo] -[bar] - -[bar]: /url "title" -. -<p>[foo] -<a href="/url" title="title">bar</a></p> -```````````````````````````````` - - -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 -this spec) cannot have whitespace after the link text. More -importantly, it prevents inadvertent capture of consecutive -[shortcut reference links]. If whitespace is allowed between the -link text and the link label, then in the following we will have -a single reference link, not two shortcut reference links, as -intended: - -``` markdown -[foo] -[bar] - -[foo]: /url1 -[bar]: /url2 -``` - -(Note that [shortcut reference links] were introduced by Gruber -himself in a beta version of `Markdown.pl`, 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.) - -When there are multiple matching [link reference definitions], -the first is used: - -```````````````````````````````` example -[foo]: /url1 - -[foo]: /url2 - -[bar][foo] -. -<p><a href="/url1">bar</a></p> -```````````````````````````````` - - -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: - -```````````````````````````````` example -[bar][foo\!] - -[foo!]: /url -. -<p>[bar][foo!]</p> -```````````````````````````````` - - -[Link labels] cannot contain brackets, unless they are -backslash-escaped: - -```````````````````````````````` example -[foo][ref[] - -[ref[]: /uri -. -<p>[foo][ref[]</p> -<p>[ref[]: /uri</p> -```````````````````````````````` - - -```````````````````````````````` example -[foo][ref[bar]] - -[ref[bar]]: /uri -. -<p>[foo][ref[bar]]</p> -<p>[ref[bar]]: /uri</p> -```````````````````````````````` - - -```````````````````````````````` example -[[[foo]]] - -[[[foo]]]: /url -. -<p>[[[foo]]]</p> -<p>[[[foo]]]: /url</p> -```````````````````````````````` - - -```````````````````````````````` example -[foo][ref\[] - -[ref\[]: /uri -. -<p><a href="/uri">foo</a></p> -```````````````````````````````` - - -Note that in this example `]` is not backslash-escaped: - -```````````````````````````````` example -[bar\\]: /uri - -[bar\\] -. -<p><a href="/uri">bar\</a></p> -```````````````````````````````` - - -A [link label] must contain at least one [non-whitespace character]: - -```````````````````````````````` example -[] - -[]: /uri -. -<p>[]</p> -<p>[]: /uri</p> -```````````````````````````````` - - -```````````````````````````````` example -[ - ] - -[ - ]: /uri -. -<p>[ -]</p> -<p>[ -]: /uri</p> -```````````````````````````````` - - -A [collapsed reference link](@) -consists of a [link label] that [matches] a -[link reference definition] elsewhere in the -document, followed by the string `[]`. -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 reference link definition. Thus, -`[foo][]` is equivalent to `[foo][foo]`. - -```````````````````````````````` example -[foo][] - -[foo]: /url "title" -. -<p><a href="/url" title="title">foo</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[*foo* bar][] - -[*foo* bar]: /url "title" -. -<p><a href="/url" title="title"><em>foo</em> bar</a></p> -```````````````````````````````` - - -The link labels are case-insensitive: - -```````````````````````````````` example -[Foo][] - -[foo]: /url "title" -. -<p><a href="/url" title="title">Foo</a></p> -```````````````````````````````` - - - -As with full reference links, [whitespace] is not -allowed between the two sets of brackets: - -```````````````````````````````` example -[foo] -[] - -[foo]: /url "title" -. -<p><a href="/url" title="title">foo</a> -[]</p> -```````````````````````````````` - - -A [shortcut reference link](@) -consists of a [link label] that [matches] a -[link reference definition] elsewhere in the -document and is not followed by `[]` or a link label. -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. -Thus, `[foo]` is equivalent to `[foo][]`. - -```````````````````````````````` example -[foo] - -[foo]: /url "title" -. -<p><a href="/url" title="title">foo</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[*foo* bar] - -[*foo* bar]: /url "title" -. -<p><a href="/url" title="title"><em>foo</em> bar</a></p> -```````````````````````````````` - - -```````````````````````````````` example -[[*foo* bar]] - -[*foo* bar]: /url "title" -. -<p>[<a href="/url" title="title"><em>foo</em> bar</a>]</p> -```````````````````````````````` - - -```````````````````````````````` example -[[bar [foo] - -[foo]: /url -. -<p>[[bar <a href="/url">foo</a></p> -```````````````````````````````` - - -The link labels are case-insensitive: - -```````````````````````````````` example -[Foo] - -[foo]: /url "title" -. -<p><a href="/url" title="title">Foo</a></p> -```````````````````````````````` - - -A space after the link text should be preserved: - -```````````````````````````````` example -[foo] bar - -[foo]: /url -. -<p><a href="/url">foo</a> bar</p> -```````````````````````````````` - - -If you just want bracketed text, you can backslash-escape the -opening bracket to avoid links: - -```````````````````````````````` example -\[foo] - -[foo]: /url "title" -. -<p>[foo]</p> -```````````````````````````````` - - -Note that this is a link, because a link label ends with the first -following closing bracket: - -```````````````````````````````` example -[foo*]: /url - -*[foo*] -. -<p>*<a href="/url">foo*</a></p> -```````````````````````````````` - - -Full and compact references take precedence over shortcut -references: - -```````````````````````````````` example -[foo][bar] - -[foo]: /url1 -[bar]: /url2 -. -<p><a href="/url2">foo</a></p> -```````````````````````````````` - -```````````````````````````````` example -[foo][] - -[foo]: /url1 -. -<p><a href="/url1">foo</a></p> -```````````````````````````````` - -Inline links also take precedence: - -```````````````````````````````` example -[foo]() - -[foo]: /url1 -. -<p><a href="">foo</a></p> -```````````````````````````````` - -```````````````````````````````` example -[foo](not a link) - -[foo]: /url1 -. -<p><a href="/url1">foo</a>(not a link)</p> -```````````````````````````````` - -In the following case `[bar][baz]` is parsed as a reference, -`[foo]` as normal text: - -```````````````````````````````` example -[foo][bar][baz] - -[baz]: /url -. -<p>[foo]<a href="/url">bar</a></p> -```````````````````````````````` - - -Here, though, `[foo][bar]` is parsed as a reference, since -`[bar]` is defined: - -```````````````````````````````` example -[foo][bar][baz] - -[baz]: /url1 -[bar]: /url2 -. -<p><a href="/url2">foo</a><a href="/url1">baz</a></p> -```````````````````````````````` - - -Here `[foo]` is not parsed as a shortcut reference, because it -is followed by a link label (even though `[bar]` is not defined): - -```````````````````````````````` example -[foo][bar][baz] - -[baz]: /url1 -[foo]: /url2 -. -<p>[foo]<a href="/url1">bar</a></p> -```````````````````````````````` - - - -## Images - -Syntax for images is like the syntax for links, with one -difference. Instead of [link text], we have an -[image description](@). The rules for this are the -same as for [link text], except that (a) an -image description starts with ` -. -<p><img src="/url" alt="foo" title="title" /></p> -```````````````````````````````` - - -```````````````````````````````` example -![foo *bar*] - -[foo *bar*]: train.jpg "train & tracks" -. -<p><img src="train.jpg" alt="foo bar" title="train & tracks" /></p> -```````````````````````````````` - - -```````````````````````````````` example -](/url2) -. -<p><img src="/url2" alt="foo bar" /></p> -```````````````````````````````` - - -```````````````````````````````` example -](/url2) -. -<p><img src="/url2" alt="foo bar" /></p> -```````````````````````````````` - - -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 `foo bar`, not `foo -[bar](/url)` or `foo <a href="/url">bar</a>`. Only the plain string -content is rendered, without formatting. - -```````````````````````````````` example -![foo *bar*][] - -[foo *bar*]: train.jpg "train & tracks" -. -<p><img src="train.jpg" alt="foo bar" title="train & tracks" /></p> -```````````````````````````````` - - -```````````````````````````````` example -![foo *bar*][foobar] - -[FOOBAR]: train.jpg "train & tracks" -. -<p><img src="train.jpg" alt="foo bar" title="train & tracks" /></p> -```````````````````````````````` - - -```````````````````````````````` example - -. -<p><img src="train.jpg" alt="foo" /></p> -```````````````````````````````` - - -```````````````````````````````` example -My  -. -<p>My <img src="/path/to/train.jpg" alt="foo bar" title="title" /></p> -```````````````````````````````` - - -```````````````````````````````` example - -. -<p><img src="url" alt="foo" /></p> -```````````````````````````````` - - -```````````````````````````````` example - -. -<p><img src="/url" alt="" /></p> -```````````````````````````````` - - -Reference-style: - -```````````````````````````````` example -![foo][bar] - -[bar]: /url -. -<p><img src="/url" alt="foo" /></p> -```````````````````````````````` - - -```````````````````````````````` example -![foo][bar] - -[BAR]: /url -. -<p><img src="/url" alt="foo" /></p> -```````````````````````````````` - - -Collapsed: - -```````````````````````````````` example -![foo][] - -[foo]: /url "title" -. -<p><img src="/url" alt="foo" title="title" /></p> -```````````````````````````````` - - -```````````````````````````````` example -![*foo* bar][] - -[*foo* bar]: /url "title" -. -<p><img src="/url" alt="foo bar" title="title" /></p> -```````````````````````````````` - - -The labels are case-insensitive: - -```````````````````````````````` example -![Foo][] - -[foo]: /url "title" -. -<p><img src="/url" alt="Foo" title="title" /></p> -```````````````````````````````` - - -As with reference links, [whitespace] is not allowed -between the two sets of brackets: - -```````````````````````````````` example -![foo] -[] - -[foo]: /url "title" -. -<p><img src="/url" alt="foo" title="title" /> -[]</p> -```````````````````````````````` - - -Shortcut: - -```````````````````````````````` example -![foo] - -[foo]: /url "title" -. -<p><img src="/url" alt="foo" title="title" /></p> -```````````````````````````````` - - -```````````````````````````````` example -![*foo* bar] - -[*foo* bar]: /url "title" -. -<p><img src="/url" alt="foo bar" title="title" /></p> -```````````````````````````````` - - -Note that link labels cannot contain unescaped brackets: - -```````````````````````````````` example -![[foo]] - -[[foo]]: /url "title" -. -<p>![[foo]]</p> -<p>[[foo]]: /url "title"</p> -```````````````````````````````` - - -The link labels are case-insensitive: - -```````````````````````````````` example -![Foo] - -[foo]: /url "title" -. -<p><img src="/url" alt="Foo" title="title" /></p> -```````````````````````````````` - - -If you just want a literal `!` followed by bracketed text, you can -backslash-escape the opening `[`: - -```````````````````````````````` example -!\[foo] - -[foo]: /url "title" -. -<p>![foo]</p> -```````````````````````````````` - - -If you want a link after a literal `!`, backslash-escape the -`!`: - -```````````````````````````````` example -\![foo] - -[foo]: /url "title" -. -<p>!<a href="/url" title="title">foo</a></p> -```````````````````````````````` - - -## Autolinks - -[Autolink](@)s are absolute URIs and email addresses inside -`<` and `>`. They are parsed as links, with the URL or email address -as the link label. - -A [URI autolink](@) consists of `<`, followed by an -[absolute URI] followed by `>`. It is parsed as -a link to the URI, with the URI as the link's label. - -An [absolute URI](@), -for these purposes, consists of a [scheme] followed by a colon (`:`) -followed by zero or more characters other than ASCII -[whitespace] and control characters, `<`, and `>`. If -the URI includes these characters, they must be percent-encoded -(e.g. `%20` for a space). - -For purposes of this spec, a [scheme](@) 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 ("-"). - -Here are some valid autolinks: - -```````````````````````````````` example -<http://foo.bar.baz> -. -<p><a href="http://foo.bar.baz">http://foo.bar.baz</a></p> -```````````````````````````````` - - -```````````````````````````````` example -<http://foo.bar.baz/test?q=hello&id=22&boolean> -. -<p><a href="http://foo.bar.baz/test?q=hello&id=22&boolean">http://foo.bar.baz/test?q=hello&id=22&boolean</a></p> -```````````````````````````````` - - -```````````````````````````````` example -<irc://foo.bar:2233/baz> -. -<p><a href="irc://foo.bar:2233/baz">irc://foo.bar:2233/baz</a></p> -```````````````````````````````` - - -Uppercase is also fine: - -```````````````````````````````` example -<MAILTO:FOO@BAR.BAZ> -. -<p><a href="MAILTO:FOO@BAR.BAZ">MAILTO:FOO@BAR.BAZ</a></p> -```````````````````````````````` - - -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: - -```````````````````````````````` example -<a+b+c:d> -. -<p><a href="a+b+c:d">a+b+c:d</a></p> -```````````````````````````````` - - -```````````````````````````````` example -<made-up-scheme://foo,bar> -. -<p><a href="made-up-scheme://foo,bar">made-up-scheme://foo,bar</a></p> -```````````````````````````````` - - -```````````````````````````````` example -<http://../> -. -<p><a href="http://../">http://../</a></p> -```````````````````````````````` - - -```````````````````````````````` example -<localhost:5001/foo> -. -<p><a href="localhost:5001/foo">localhost:5001/foo</a></p> -```````````````````````````````` - - -Spaces are not allowed in autolinks: - -```````````````````````````````` example -<http://foo.bar/baz bim> -. -<p><http://foo.bar/baz bim></p> -```````````````````````````````` - - -Backslash-escapes do not work inside autolinks: - -```````````````````````````````` example -<http://example.com/\[\> -. -<p><a href="http://example.com/%5C%5B%5C">http://example.com/\[\</a></p> -```````````````````````````````` - - -An [email autolink](@) -consists of `<`, followed by an [email address], -followed by `>`. The link's label is the email address, -and the URL is `mailto:` followed by the email address. - -An [email address](@), -for these purposes, is anything that matches -the [non-normative regex from the HTML5 -spec](https://html.spec.whatwg.org/multipage/forms.html#e-mail-state-(type=email)): - - /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])? - (?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/ - -Examples of email autolinks: - -```````````````````````````````` example -<foo@bar.example.com> -. -<p><a href="mailto:foo@bar.example.com">foo@bar.example.com</a></p> -```````````````````````````````` - - -```````````````````````````````` example -<foo+special@Bar.baz-bar0.com> -. -<p><a href="mailto:foo+special@Bar.baz-bar0.com">foo+special@Bar.baz-bar0.com</a></p> -```````````````````````````````` - - -Backslash-escapes do not work inside email autolinks: - -```````````````````````````````` example -<foo\+@bar.example.com> -. -<p><foo+@bar.example.com></p> -```````````````````````````````` - - -These are not autolinks: - -```````````````````````````````` example -<> -. -<p><></p> -```````````````````````````````` - - -```````````````````````````````` example -< http://foo.bar > -. -<p>< http://foo.bar ></p> -```````````````````````````````` - - -```````````````````````````````` example -<m:abc> -. -<p><m:abc></p> -```````````````````````````````` - - -```````````````````````````````` example -<foo.bar.baz> -. -<p><foo.bar.baz></p> -```````````````````````````````` - - -```````````````````````````````` example -http://example.com -. -<p>http://example.com</p> -```````````````````````````````` - - -```````````````````````````````` example -foo@bar.example.com -. -<p>foo@bar.example.com</p> -```````````````````````````````` - -<div class="extension"> - -## Autolinks (extension) - -GFM enables the `autolink` extension, where autolinks will be recognised in a -greater number of conditions. - -[Autolink]s can also be constructed without requiring the use of `<` and to `>` -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 `*`, `_`, `~`, -and `(`. - -An [extended www autolink](@) will be recognized -when the text `www.` is found followed by a [valid domain]. -A [valid domain](@) consists of segments -of alphanumeric characters, underscores (`_`) and hyphens (`-`) -separated by periods (`.`). -There must be at least one period, -and no underscores may be present in the last two segments of the domain. - -The scheme `http` will be inserted automatically: - -```````````````````````````````` example autolink -www.commonmark.org -. -<p><a href="http://www.commonmark.org">www.commonmark.org</a></p> -```````````````````````````````` - -After a [valid domain], zero or more non-space non-`<` characters may follow: - -```````````````````````````````` example autolink -Visit www.commonmark.org/help for more information. -. -<p>Visit <a href="http://www.commonmark.org/help">www.commonmark.org/help</a> for more information.</p> -```````````````````````````````` - -We then apply [extended autolink path validation](@) as follows: - -Trailing punctuation (specifically, `?`, `!`, `.`, `,`, `:`, `*`, `_`, and `~`) -will not be considered part of the autolink, though they may be included in the -interior of the link: - -```````````````````````````````` example autolink -Visit www.commonmark.org. - -Visit www.commonmark.org/a.b. -. -<p>Visit <a href="http://www.commonmark.org">www.commonmark.org</a>.</p> -<p>Visit <a href="http://www.commonmark.org/a.b">www.commonmark.org/a.b</a>.</p> -```````````````````````````````` - -When an autolink ends in `)`, 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: - -```````````````````````````````` example autolink -www.google.com/search?q=Markup+(business) - -www.google.com/search?q=Markup+(business))) - -(www.google.com/search?q=Markup+(business)) - -(www.google.com/search?q=Markup+(business) -. -<p><a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a></p> -<p><a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a>))</p> -<p>(<a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a>)</p> -<p>(<a href="http://www.google.com/search?q=Markup+(business)">www.google.com/search?q=Markup+(business)</a></p> -```````````````````````````````` - -This check is only done when the link ends in a closing parentheses `)`, so if -the only parentheses are in the interior of the autolink, no special rules are -applied: - -```````````````````````````````` example autolink -www.google.com/search?q=(business))+ok -. -<p><a href="http://www.google.com/search?q=(business))+ok">www.google.com/search?q=(business))+ok</a></p> -```````````````````````````````` - -If an autolink ends in a semicolon (`;`), we check to see if it appears to -resemble an [entity reference][entity references]; if the preceding text is `&` -followed by one or more alphanumeric characters. If so, it is excluded from -the autolink: - -```````````````````````````````` example autolink -www.google.com/search?q=commonmark&hl=en - -www.google.com/search?q=commonmark&hl; -. -<p><a href="http://www.google.com/search?q=commonmark&hl=en">www.google.com/search?q=commonmark&hl=en</a></p> -<p><a href="http://www.google.com/search?q=commonmark">www.google.com/search?q=commonmark</a>&hl;</p> -```````````````````````````````` - -`<` immediately ends an autolink. - -```````````````````````````````` example autolink -www.commonmark.org/he<lp -. -<p><a href="http://www.commonmark.org/he">www.commonmark.org/he</a><lp</p> -```````````````````````````````` - -An [extended url autolink](@) will be recognised when one of the schemes -`http://`, `https://`, or `ftp://`, followed by a [valid domain], then zero or -more non-space non-`<` characters according to -[extended autolink path validation]: - -```````````````````````````````` example autolink -http://commonmark.org - -(Visit https://encrypted.google.com/search?q=Markup+(business)) - -Anonymous FTP is available at ftp://foo.bar.baz. -. -<p><a href="http://commonmark.org">http://commonmark.org</a></p> -<p>(Visit <a href="https://encrypted.google.com/search?q=Markup+(business)">https://encrypted.google.com/search?q=Markup+(business)</a>)</p> -<p>Anonymous FTP is available at <a href="ftp://foo.bar.baz">ftp://foo.bar.baz</a>.</p> -```````````````````````````````` - - -An [extended email autolink](@) will be recognised when an email address is -recognised within any text node. Email addresses are recognised according to -the following rules: - -* One ore more characters which are alphanumeric, or `.`, `-`, `_`, or `+`. -* An `@` symbol. -* One or more characters which are alphanumeric, or `-` or `_`, - separated by periods (`.`). - There must be at least one period. - The last character must not be one of `-` or `_`. - -The scheme `mailto:` will automatically be added to the generated link: - -```````````````````````````````` example autolink -foo@bar.baz -. -<p><a href="mailto:foo@bar.baz">foo@bar.baz</a></p> -```````````````````````````````` - -`+` can occur before the `@`, but not after. - -```````````````````````````````` example autolink -hello@mail+xyz.example isn't valid, but hello+xyz@mail.example is. -. -<p>hello@mail+xyz.example isn't valid, but <a href="mailto:hello+xyz@mail.example">hello+xyz@mail.example</a> is.</p> -```````````````````````````````` - -`.`, `-`, and `_` can occur on both sides of the `@`, but only `.` may occur at -the end of the email address, in which case it will not be considered part of -the address: - -```````````````````````````````` example autolink -a.b-c_d@a.b - -a.b-c_d@a.b. - -a.b-c_d@a.b- - -a.b-c_d@a.b_ -. -<p><a href="mailto:a.b-c_d@a.b">a.b-c_d@a.b</a></p> -<p><a href="mailto:a.b-c_d@a.b">a.b-c_d@a.b</a>.</p> -<p>a.b-c_d@a.b-</p> -<p>a.b-c_d@a.b_</p> -```````````````````````````````` - -</div> - -## Raw HTML - -Text between `<` and `>` 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. - -Here is the grammar for tags: - -A [tag name](@) consists of an ASCII letter -followed by zero or more ASCII letters, digits, or -hyphens (`-`). - -An [attribute](@) consists of [whitespace], -an [attribute name], and an optional -[attribute value specification]. - -An [attribute name](@) -consists of an ASCII letter, `_`, or `:`, followed by zero or more ASCII -letters, digits, `_`, `.`, `:`, or `-`. (Note: This is the XML -specification restricted to ASCII. HTML5 is laxer.) - -An [attribute value specification](@) -consists of optional [whitespace], -a `=` character, optional [whitespace], and an [attribute -value]. - -An [attribute value](@) -consists of an [unquoted attribute value], -a [single-quoted attribute value], or a [double-quoted attribute value]. - -An [unquoted attribute value](@) -is a nonempty string of characters not -including [whitespace], `"`, `'`, `=`, `<`, `>`, or `` ` ``. - -A [single-quoted attribute value](@) -consists of `'`, zero or more -characters not including `'`, and a final `'`. - -A [double-quoted attribute value](@) -consists of `"`, zero or more -characters not including `"`, and a final `"`. - -An [open tag](@) consists of a `<` character, a [tag name], -zero or more [attributes], optional [whitespace], an optional `/` -character, and a `>` character. - -A [closing tag](@) consists of the string `</`, a -[tag name], optional [whitespace], and the character `>`. - -An [HTML comment](@) consists of `<!--` + *text* + `-->`, -where *text* does not start with `>` or `->`, does not end with `-`, -and does not contain `--`. (See the -[HTML5 spec](http://www.w3.org/TR/html5/syntax.html#comments).) - -A [processing instruction](@) -consists of the string `<?`, a string -of characters not including the string `?>`, and the string -`?>`. - -A [declaration](@) consists of the -string `<!`, a name consisting of one or more uppercase ASCII letters, -[whitespace], a string of characters not including the -character `>`, and the character `>`. - -A [CDATA section](@) consists of -the string `<![CDATA[`, a string of characters not including the string -`]]>`, and the string `]]>`. - -An [HTML tag](@) consists of an [open tag], a [closing tag], -an [HTML comment], a [processing instruction], a [declaration], -or a [CDATA section]. - -Here are some simple open tags: - -```````````````````````````````` example -<a><bab><c2c> -. -<p><a><bab><c2c></p> -```````````````````````````````` - - -Empty elements: - -```````````````````````````````` example -<a/><b2/> -. -<p><a/><b2/></p> -```````````````````````````````` - - -[Whitespace] is allowed: - -```````````````````````````````` example -<a /><b2 -data="foo" > -. -<p><a /><b2 -data="foo" ></p> -```````````````````````````````` - - -With attributes: - -```````````````````````````````` example -<a foo="bar" bam = 'baz <em>"</em>' -_boolean zoop:33=zoop:33 /> -. -<p><a foo="bar" bam = 'baz <em>"</em>' -_boolean zoop:33=zoop:33 /></p> -```````````````````````````````` - - -Custom tag names can be used: - -```````````````````````````````` example -Foo <responsive-image src="foo.jpg" /> -. -<p>Foo <responsive-image src="foo.jpg" /></p> -```````````````````````````````` - - -Illegal tag names, not parsed as HTML: - -```````````````````````````````` example -<33> <__> -. -<p><33> <__></p> -```````````````````````````````` - - -Illegal attribute names: - -```````````````````````````````` example -<a h*#ref="hi"> -. -<p><a h*#ref="hi"></p> -```````````````````````````````` - - -Illegal attribute values: - -```````````````````````````````` example -<a href="hi'> <a href=hi'> -. -<p><a href="hi'> <a href=hi'></p> -```````````````````````````````` - - -Illegal [whitespace]: - -```````````````````````````````` example -< a>< -foo><bar/ > -<foo bar=baz -bim!bop /> -. -<p>< a>< -foo><bar/ > -<foo bar=baz -bim!bop /></p> -```````````````````````````````` - - -Missing [whitespace]: - -```````````````````````````````` example -<a href='bar'title=title> -. -<p><a href='bar'title=title></p> -```````````````````````````````` - - -Closing tags: - -```````````````````````````````` example -</a></foo > -. -<p></a></foo ></p> -```````````````````````````````` - - -Illegal attributes in closing tag: - -```````````````````````````````` example -</a href="foo"> -. -<p></a href="foo"></p> -```````````````````````````````` - - -Comments: - -```````````````````````````````` example -foo <!-- this is a -comment - with hyphen --> -. -<p>foo <!-- this is a -comment - with hyphen --></p> -```````````````````````````````` - - -```````````````````````````````` example -foo <!-- not a comment -- two hyphens --> -. -<p>foo <!-- not a comment -- two hyphens --></p> -```````````````````````````````` - - -Not comments: - -```````````````````````````````` example -foo <!--> foo --> - -foo <!-- foo---> -. -<p>foo <!--> foo --></p> -<p>foo <!-- foo---></p> -```````````````````````````````` - - -Processing instructions: - -```````````````````````````````` example -foo <?php echo $a; ?> -. -<p>foo <?php echo $a; ?></p> -```````````````````````````````` - - -Declarations: - -```````````````````````````````` example -foo <!ELEMENT br EMPTY> -. -<p>foo <!ELEMENT br EMPTY></p> -```````````````````````````````` - - -CDATA sections: - -```````````````````````````````` example -foo <![CDATA[>&<]]> -. -<p>foo <![CDATA[>&<]]></p> -```````````````````````````````` - - -Entity and numeric character references are preserved in HTML -attributes: - -```````````````````````````````` example -foo <a href="ö"> -. -<p>foo <a href="ö"></p> -```````````````````````````````` - - -Backslash escapes do not work in HTML attributes: - -```````````````````````````````` example -foo <a href="\*"> -. -<p>foo <a href="\*"></p> -```````````````````````````````` - - -```````````````````````````````` example -<a href="\""> -. -<p><a href="""></p> -```````````````````````````````` - - -<div class="extension"> - -## Disallowed Raw HTML (extension) - -GFM enables the `tagfilter` extension, where the following HTML tags will be -filtered when rendering HTML output: - -* `<title>` -* `<textarea>` -* `<style>` -* `<xmp>` -* `<iframe>` -* `<noembed>` -* `<noframes>` -* `<script>` -* `<plaintext>` - -Filtering is done by replacing the leading `<` with the entity `<`. 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. - -All other HTML tags are left untouched. - -```````````````````````````````` example tagfilter -<strong> <title> <style> <em> - -<blockquote> - <xmp> is disallowed. <XMP> is also disallowed. -</blockquote> -. -<p><strong> <title> <style> <em></p> -<blockquote> - <xmp> is disallowed. <XMP> is also disallowed. -</blockquote> -```````````````````````````````` - -</div> - -## Hard line breaks - -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 [hard line break](@) (rendered -in HTML as a `<br />` tag): - -```````````````````````````````` example -foo -baz -. -<p>foo<br /> -baz</p> -```````````````````````````````` - - -For a more visible alternative, a backslash before the -[line ending] may be used instead of two spaces: - -```````````````````````````````` example -foo\ -baz -. -<p>foo<br /> -baz</p> -```````````````````````````````` - - -More than two spaces can be used: - -```````````````````````````````` example -foo -baz -. -<p>foo<br /> -baz</p> -```````````````````````````````` - - -Leading spaces at the beginning of the next line are ignored: - -```````````````````````````````` example -foo - bar -. -<p>foo<br /> -bar</p> -```````````````````````````````` - - -```````````````````````````````` example -foo\ - bar -. -<p>foo<br /> -bar</p> -```````````````````````````````` - - -Line breaks can occur inside emphasis, links, and other constructs -that allow inline content: - -```````````````````````````````` example -*foo -bar* -. -<p><em>foo<br /> -bar</em></p> -```````````````````````````````` - - -```````````````````````````````` example -*foo\ -bar* -. -<p><em>foo<br /> -bar</em></p> -```````````````````````````````` - - -Line breaks do not occur inside code spans - -```````````````````````````````` example -`code -span` -. -<p><code>code span</code></p> -```````````````````````````````` - - -```````````````````````````````` example -`code\ -span` -. -<p><code>code\ span</code></p> -```````````````````````````````` - - -or HTML tags: - -```````````````````````````````` example -<a href="foo -bar"> -. -<p><a href="foo -bar"></p> -```````````````````````````````` - - -```````````````````````````````` example -<a href="foo\ -bar"> -. -<p><a href="foo\ -bar"></p> -```````````````````````````````` - - -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: - -```````````````````````````````` example -foo\ -. -<p>foo\</p> -```````````````````````````````` - - -```````````````````````````````` example -foo -. -<p>foo</p> -```````````````````````````````` - - -```````````````````````````````` example -### foo\ -. -<h3>foo\</h3> -```````````````````````````````` - - -```````````````````````````````` example -### foo -. -<h3>foo</h3> -```````````````````````````````` - - -## Soft line breaks - -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 -[softbreak](@). (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.) - -```````````````````````````````` example -foo -baz -. -<p>foo -baz</p> -```````````````````````````````` - - -Spaces at the end of the line and beginning of the next line are -removed: - -```````````````````````````````` example -foo - baz -. -<p>foo -baz</p> -```````````````````````````````` - - -A conforming parser may render a soft line break in HTML either as a -line break or as a space. - -A renderer may also provide an option to render soft line breaks -as hard line breaks. - -## Textual content - -Any characters not given an interpretation by the above rules will -be parsed as plain textual content. - -```````````````````````````````` example -hello $.;'there -. -<p>hello $.;'there</p> -```````````````````````````````` - - -```````````````````````````````` example -Foo χÏῆν -. -<p>Foo χÏῆν</p> -```````````````````````````````` - - -Internal spaces are preserved verbatim: - -```````````````````````````````` example -Multiple spaces -. -<p>Multiple spaces</p> -```````````````````````````````` - - -# GitLab Official Specification Markdown - -Note: This specification is a work in progress. Only some of the official GLFM extensions -are defined. We will continue to add any additional ones found in the -[user-facing documentation for GitLab Flavored Markdown](https://docs.gitlab.com/ee/user/markdown.html). - -There is currently only this single top-level heading, but the -examples may be split into multiple top-level headings in the future. - -## Task list items - -See -[Task lists](https://docs.gitlab.com/ee/user/markdown.html#task-lists) in the GitLab Flavored Markdown documentation. - -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. - -Some of the behavior of task list items is implemented as client-side JavaScript/CSS. - -The following are some basic examples; more examples may be added in the future. - -Incomplete task: - -```````````````````````````````` example gitlab -- [ ] incomplete -. -<ul> -<li> -<task-button/> -<input type="checkbox" disabled/> -incomplete -</li> -</ul> -```````````````````````````````` - -Completed task: - -```````````````````````````````` example gitlab -- [x] completed -. -<ul> -<li> -<task-button/> -<input type="checkbox" checked disabled/> -completed -</li> -</ul> -```````````````````````````````` - -Inapplicable task: - -```````````````````````````````` example gitlab -- [~] inapplicable -. -<ul> -<li> -<task-button/> -<input type="checkbox" data-inapplicable disabled> -<s> -inapplicable -</s> -</li> -</ul> -```````````````````````````````` - -Inapplicable task in a "loose" list. Note that the `<del>` tag is not applied to the -loose text; it has strikethrough applied with CSS. - -```````````````````````````````` example gitlab -- [~] inapplicable - - text in loose list -. -<ul> -<li> -<p> -<task-button/> -<input type="checkbox" data-inapplicable disabled> -<s> -inapplicable -</s> -</p> -<p> -text in loose list -</p> -</li> -</ul> -```````````````````````````````` - -## Front matter - -See -[Front matter](https://docs.gitlab.com/ee/user/markdown.html#front-matter) in the GitLab Flavored Markdown documentation. - -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. - -YAML front matter: - -```````````````````````````````` example gitlab ---- -title: YAML front matter ---- -. -<pre> -<code> -title: YAML front matter -</code> -</pre> -```````````````````````````````` - -TOML front matter: - -```````````````````````````````` example gitlab -+++ -title: TOML front matter -+++ -. -<pre> -<code> -title: TOML front matter -</code> -</pre> -```````````````````````````````` - -JSON front matter: - -```````````````````````````````` example gitlab -;;; -{ - "title": "JSON front matter" -} -;;; -. -<pre> -<code> -{ - "title": "JSON front matter" -} -</code> -</pre> -```````````````````````````````` - -Front matter blocks should be inserted at the top of the document: - -```````````````````````````````` example gitlab -text - ---- -title: YAML front matter ---- -. -<p>text</p> -<hr> -<h2>title: YAML front matter</h2> -```````````````````````````````` - -Front matter block delimiters shouldn’t be preceded by space characters: - -```````````````````````````````` example gitlab - --- -title: YAML front matter ---- -. -<hr> -<h2>title: YAML front matter</h2> -```````````````````````````````` - -## Table of contents - -See -[table of contents](https://docs.gitlab.com/ee/user/markdown.html#table-of-contents) -in the GitLab Flavored Markdown documentation. - -NOTE: Because of this bug (https://gitlab.com/gitlab-org/gitlab/-/issues/359077), -we cannot actually include the `TOC` tag with single brackets in backticks -in this Markdown document, otherwise it would render a table of contents inline -right here. So, it's been switched to `[` + `TOC` + `]` instead. This can be reverted -once that bug is fixed. - -A table of contents is an unordered list that links to subheadings in the document. -Add either the `[[_TOC_]]` tag or the `[` + `TOC` + `]` tag on its own line. - -```````````````````````````````` example gitlab -[TOC] - -# Heading 1 - -## Heading 2 -. -<nav> - <ul> - <li><a href="#heading-1">Heading 1</a></li> - <ul> - <li><a href="#heading-2">Heading 2</a></li> - </ul> - </ul> -</nav> -<h1>Heading 1</h1> -<h2>Heading 2</h2> -```````````````````````````````` - -```````````````````````````````` example gitlab -[[_TOC_]] - -# Heading 1 - -## Heading 2 -. -<nav> - <ul> - <li><a href="#heading-1">Heading 1</a></li> - <ul> - <li><a href="#heading-2">Heading 2</a></li> - </ul> - </ul> -</nav> -<h1>Heading 1</h1> -<h2>Heading 2</h2> -```````````````````````````````` - -A table of contents is a block element. It should preceded and followed by a blank -line. - -```````````````````````````````` example gitlab -[[_TOC_]] -text - -text -[TOC] -. -<p>[[<em>TOC</em>]]text</p> -<p>text[TOC]</p> -```````````````````````````````` - -A table of contents can be indented with up to three spaces. - -```````````````````````````````` example gitlab - [[_TOC_]] - -# Heading 1 -. -<nav> - <ul> - <li><a href="#heading-1">Heading 1</a></li> - </ul> -</nav> -<h1>Heading 1</h1> -```````````````````````````````` - -# GitLab Internal Extension Markdown - -## Audio - -See -[audio](https://docs.gitlab.com/ee/user/markdown.html#audio) in the GitLab Flavored Markdown documentation. - -GLFM renders image elements as an audio player as long as the resource’s file extension is -one of the following supported audio extensions `.mp3`, `.oga`, `.ogg`, `.spx`, and `.wav`. -Audio ignore the alternative text part of an image declaration. - -```````````````````````````````` example gitlab - -. -<p><audio src="audio.oga" title="audio title"></audio></p> -```````````````````````````````` - -Reference definitions work audio as well: - -```````````````````````````````` example gitlab -[audio]: audio.oga "audio title" - -![audio][audio] -. -<p><audio src="audio.oga" title="audio title"></audio></p> -```````````````````````````````` - -## Video - -See -[videos](https://docs.gitlab.com/ee/user/markdown.html#videos) in the GitLab Flavored Markdown documentation. - -GLFM renders image elements as a video player as long as the resource’s file extension is -one of the following supported video extensions `.mp4`, `.m4v`, `.mov`, `.webm`, and `.ogv`. -Videos ignore the alternative text part of an image declaration. - - -```````````````````````````````` example gitlab - -. -<p><video src="video.m4v" title="video title"></video></p> -```````````````````````````````` - -Reference definitions work video as well: - -```````````````````````````````` example gitlab -[video]: video.mov "video title" - -![video][video] -. -<p><video src="video.mov" title="video title"></video></p> -```````````````````````````````` - -## Markdown Preview API Request Overrides - -This section contains examples of all controllers which use `PreviewMarkdown` module -and use different `markdown_context_params`. They exercise the various `preview_markdown` -endpoints via `glfm_example_metadata.yml`. - - -`preview_markdown` exercising `groups` API endpoint and `UploadLinkFilter`: - -```````````````````````````````` example gitlab -[groups-test-file](/uploads/groups-test-file) -. -<p><a href="groups-test-file">groups-test-file</a></p> -```````````````````````````````` - -`preview_markdown` exercising `projects` API endpoint and `RepositoryLinkFilter`: - -```````````````````````````````` example gitlab -[projects-test-file](projects-test-file) -. -<p><a href="projects-test-file">projects-test-file</a></p> -```````````````````````````````` - -`preview_markdown` exercising `projects` API endpoint and `SnippetReferenceFilter`: - -```````````````````````````````` example gitlab -This project snippet ID reference IS filtered: $88888 -. -<p>This project snippet ID reference IS filtered: $88888</p> -```````````````````````````````` - -`preview_markdown` exercising personal (non-project) `snippets` 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 -`SnippetReferenceFilter`, even if the ID is valid. - -```````````````````````````````` example gitlab -This personal snippet ID reference is not filtered: $99999 -. -<p>This personal snippet ID reference is not filtered: $99999</p> -```````````````````````````````` - -`preview_markdown` exercising project `wikis` API endpoint and `WikiLinkFilter`: - -```````````````````````````````` example gitlab -[project-wikis-test-file](project-wikis-test-file) -. -<p><a href="project-wikis-test-file">project-wikis-test-file</a></p> -```````````````````````````````` - -`preview_markdown` exercising group `wikis` API endpoint and `WikiLinkFilter`. This example -also requires an EE license enabling the `group_wikis` feature: - -```````````````````````````````` example gitlab -[group-wikis-test-file](group-wikis-test-file) -. -<p><a href="group-wikis-test-file">group-wikis-test-file</a></p> -```````````````````````````````` - -## Migrated golden master examples - -### attachment_image_for_group - -```````````````````````````````` example gitlab - -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### attachment_image_for_project - -```````````````````````````````` example gitlab - -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### attachment_image_for_project_wiki - -```````````````````````````````` example gitlab - -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### attachment_link_for_group - -```````````````````````````````` example gitlab -[test-file](/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.zip) -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### attachment_link_for_project - -```````````````````````````````` example gitlab -[test-file](/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.zip) -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### attachment_link_for_project_wiki - -```````````````````````````````` example gitlab -[test-file](test-file.zip) -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### attachment_link_for_group_wiki - -```````````````````````````````` example gitlab -[test-file](test-file.zip) -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### audio - -```````````````````````````````` example gitlab - -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### audio_and_video_in_lists - -```````````````````````````````` example gitlab -*  -*  - -1.  -2.  - -* [x]  -* [x]  -* [x]  -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### blockquote - -```````````````````````````````` example gitlab -> This is a blockquote -> -> This is another one -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### bold - -```````````````````````````````` example gitlab -**bold** -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### bullet_list_style_1 - -```````````````````````````````` example gitlab -* list item 1 -* list item 2 - * embedded list item 3 -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### bullet_list_style_2 - -```````````````````````````````` example gitlab -- list item 1 -- list item 2 - * embedded list item 3 -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### bullet_list_style_3 - -```````````````````````````````` example gitlab -+ list item 1 -+ list item 2 - - embedded list item 3 -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### code_block_javascript - -```````````````````````````````` example gitlab -```javascript - console.log('hello world') -``` -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### code_block_plaintext - -```````````````````````````````` example gitlab -``` - plaintext -``` -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### code_block_unknown - -```````````````````````````````` example gitlab -```foobar - custom_language = >> this << -``` -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### color_chips - -```````````````````````````````` example gitlab -- `#F00` -- `#F00A` -- `#FF0000` -- `#FF0000AA` -- `RGB(0,255,0)` -- `RGB(0%,100%,0%)` -- `RGBA(0,255,0,0.3)` -- `HSL(540,70%,50%)` -- `HSLA(540,70%,50%,0.3)` -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### description_list - -```````````````````````````````` example gitlab -<dl> -<dt>Frog</dt> -<dd>Wet green thing</dd> -<dt>Rabbit</dt> -<dd>Warm fluffy thing</dd> -<dt>Punt</dt> -<dd>Kick a ball</dd> -<dd>Take a bet</dd> -<dt>Color</dt> -<dt>Colour</dt> -<dd> - -Any hue except _white_ or **black** - -</dd> -</dl> -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### details - -```````````````````````````````` example gitlab -<details> -<summary>This is the visible summary of the collapsible section</summary> - -1. collapsed markdown -2. more collapsed markdown - -</details> -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### diagram_kroki_nomnoml - -```````````````````````````````` example gitlab -```nomnoml - #stroke: #a86128 - [<frame>Decorator pattern| - [<abstract>Component||+ operation()] - [Client] depends --> [Component] - [Decorator|- next: Component] - [Decorator] decorates -- [ConcreteComponent] - [Component] <:- [Decorator] - [Component] <:- [ConcreteComponent] - ] -``` -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### diagram_plantuml - -```````````````````````````````` example gitlab -```plantuml - Alice -> Bob: Authentication Request - Bob --> Alice: Authentication Response - - Alice -> Bob: Another authentication Request - Alice <-- Bob: Another authentication Response -``` -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### diagram_plantuml_unicode - -```````````````````````````````` example gitlab -```plantuml -A -> B : Text with norwegian characters: æøå -``` -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### div - -```````````````````````````````` example gitlab -<div>plain text</div> -<div> - -just a plain ol' div, not much to _expect_! - -</div> -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### emoji - -```````````````````````````````` example gitlab -:sparkles: :heart: :100: -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### emphasis - -```````````````````````````````` example gitlab -_emphasized text_ -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### figure - -```````````````````````````````` example gitlab -<figure> - - - -<figcaption>An elephant at sunset</figcaption> -</figure> -<figure> - - - -<figcaption> - -A crocodile wearing _crocs_! - -</figcaption> -</figure> -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### footnotes - -```````````````````````````````` example gitlab -A footnote reference tag looks like this: [^1] - -This reference tag is a mix of letters and numbers. [^footnote] - -[^1]: This is the text inside a footnote. - -[^footnote]: This is another footnote. -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### frontmatter_json - -```````````````````````````````` example gitlab -;;; -{ - "title": "Page title" -} -;;; -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### frontmatter_toml - -```````````````````````````````` example gitlab -+++ -title = "Page title" -+++ -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### frontmatter_yaml - -```````````````````````````````` example gitlab ---- -title: Page title ---- -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### hard_break - -```````````````````````````````` example gitlab -This is a line after a\ -hard break -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### headings - -```````````````````````````````` example gitlab -# Heading 1 - -## Heading 2 - -### Heading 3 - -#### Heading 4 - -##### Heading 5 - -###### Heading 6 -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### horizontal_rule - -```````````````````````````````` example gitlab ---- -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### html_marks - -```````````````````````````````` example gitlab -* Content editor is ~~great~~<ins>amazing</ins>. -* If the changes <abbr title="Looks good to merge">LGTM</abbr>, please <abbr title="Merge when pipeline succeeds">MWPS</abbr>. -* The English song <q>Oh I do like to be beside the seaside</q> looks like this in Hebrew: <span dir="rtl">××”, ×× ×™ ×והב להיות ליד חוף ×”×™×</span>. In the computer's memory, this is stored as <bdo dir="ltr">××”, ×× ×™ ×והב להיות ליד חוף ×”×™×</bdo>. -* <cite>The Scream</cite> by Edvard Munch. Painted in 1893. -* <dfn>HTML</dfn> is the standard markup language for creating web pages. -* Do not forget to buy <mark>milk</mark> today. -* This is a paragraph and <small>smaller text goes here</small>. -* The concert starts at <time datetime="20:00">20:00</time> and you'll be able to enjoy the band for at least <time datetime="PT2H30M">2h 30m</time>. -* Press <kbd>Ctrl</kbd> + <kbd>C</kbd> to copy text (Windows). -* WWF's goal is to: <q>Build a future where people live in harmony with nature.</q> We hope they succeed. -* The error occurred was: <samp>Keyboard not found. Press F1 to continue.</samp> -* The area of a triangle is: 1/2 x <var>b</var> x <var>h</var>, where <var>b</var> is the base, and <var>h</var> is the vertical height. -* <ruby>æ¼¢<rt>ã„ㄢˋ</rt></ruby> -* C<sub>7</sub>H<sub>16</sub> + O<sub>2</sub> → CO<sub>2</sub> + H<sub>2</sub>O -* The **Pythagorean theorem** is often expressed as <var>a<sup>2</sup></var> + <var>b<sup>2</sup></var> = <var>c<sup>2</sup></var> -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### image - -```````````````````````````````` example gitlab - -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### inline_code - -```````````````````````````````` example gitlab -`code` -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### inline_diff - -```````````````````````````````` example gitlab -* {-deleted-} -* {+added+} -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### label - -```````````````````````````````` example gitlab -~bug -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### link - -```````````````````````````````` example gitlab -[GitLab](https://gitlab.com) -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### math - -```````````````````````````````` example gitlab -This math is inline $`a^2+b^2=c^2`$. - -This is on a separate line: - -```math -a^2+b^2=c^2 -``` -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### ordered_list - -```````````````````````````````` example gitlab -1. list item 1 -2. list item 2 -3. list item 3 -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### ordered_list_with_start_order - -```````````````````````````````` example gitlab -134. list item 1 -135. list item 2 -136. list item 3 -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### ordered_task_list - -```````````````````````````````` example gitlab -1. [x] hello -2. [x] world -3. [ ] example - 1. [ ] of nested - 1. [x] task list - 2. [ ] items -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### ordered_task_list_with_order - -```````````````````````````````` example gitlab -4893. [x] hello -4894. [x] world -4895. [ ] example -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### reference_for_project_wiki - -```````````````````````````````` example gitlab -Hi @gfm_user - thank you for reporting this ~"UX bug" (#1) we hope to fix it in %1.1 as part of !1 -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### strike - -```````````````````````````````` example gitlab -~~del~~ -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### table - -```````````````````````````````` example gitlab -| header | header | -|--------|--------| -| `code` | cell with **bold** | -| ~~strike~~ | cell with _italic_ | - -# content after table -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### table_of_contents - -```````````````````````````````` example gitlab -[[_TOC_]] - -# Lorem - -Well, that's just like... your opinion.. man. - -## Ipsum - -### Dolar - -# Sit amit - -### I don't know -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### task_list - -```````````````````````````````` example gitlab -* [x] hello -* [x] world -* [ ] example - * [ ] of nested - * [x] task list - * [ ] items -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### video - -```````````````````````````````` example gitlab - -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -### word_break - -```````````````````````````````` example gitlab -Fernstraßen<wbr>bau<wbr>privat<wbr>finanzierungs<wbr>gesetz -. -TODO: Write canonical HTML for this example -```````````````````````````````` - -## Image Attributes - -See -[Change the image dimensions](https://docs.gitlab.com/ee/user/markdown.html#change-the-image-dimensions) -in the GitLab Flavored Markdown documentation. - -The `width` and `height` attributes for an image can be specified directly after -the image markdown. - -General syntax conforms to the -[commonmark-hs attribute syntax](https://github.com/jgm/commonmark-hs/blob/master/commonmark-extensions/test/attributes.md) -where it makes sense. - -```````````````````````````````` example gitlab -{width="100" height="100"} -. -<p><img src="https://gitlab.com/logo.png" width="100" height="100"></p> -```````````````````````````````` - -`%` and `px` units may also be specified. - -```````````````````````````````` example gitlab -{width="100%"} -. -<p><img src="https://gitlab.com/logo.png" width="100%"></p> -```````````````````````````````` - -```````````````````````````````` example gitlab -{height="100px"} -. -<p><img src="https://gitlab.com/logo.png" height="100px"></p> -```````````````````````````````` - -Whitespace is tolerated around the delimiters: - -```````````````````````````````` example gitlab -{ width="100" height="100" } -. -<p><img src="https://gitlab.com/logo.png" width="100" height="100"></p> -```````````````````````````````` - -Attributes must immediately follow the image markdown. - -```````````````````````````````` example gitlab - {width="100" height="100"} -. -<p><img src="https://gitlab.com/logo.png"> {width="100" height="100"}</p> -```````````````````````````````` - -## Footnotes - -See -[the footnotes section of the user-facing documentation for GitLab Flavored Markdown](https://docs.gitlab.com/ee/user/markdown.html#footnotes). - -```````````````````````````````` example gitlab -footnote reference tag [^fortytwo] - -[^fortytwo]: footnote text -. -<p> -footnote reference tag -<sup> -<a href="#fn-fortytwo-42" id="fnref-fortytwo-42" data-footnote-ref> -1 -</a> -</sup> -</p> -<section data-footnotes> -<ol> -<li id="fn-fortytwo-42"> -<p> -footnote text -<a href="#fnref-fortytwo-42" data-footnote-backref> -</a> -</p> -</li> -</ol> -</section> -```````````````````````````````` - -# GFM undocumented extensions and more robust test - -This section contains tests borrowed from https://github.com/github/cmark-gfm/blob/master/test/extensions.txt. -It includes items not found in the official GFM specification, such as footnotes and additional tests for tables, -task lists, etc. - -## Footnotes - -```````````````````````````````` example -This is some text![^1]. Other text.[^footnote]. - -Here's a thing[^other-note]. - -And another thing[^codeblock-note]. - -This doesn't have a referent[^nope]. - - -[^other-note]: no code block here (spaces are stripped away) - -[^codeblock-note]: - this is now a code block (8 spaces indentation) - -[^1]: Some *bolded* footnote definition. - -Hi! - -[^footnote]: - > Blockquotes can be in a footnote. - - as well as code blocks - - or, naturally, simple paragraphs. - -[^unused]: This is unused. -. -<p>This is some text!<sup class="footnote-ref"><a href="#fn-1" id="fnref-1" data-footnote-ref>1</a></sup>. Other text.<sup class="footnote-ref"><a href="#fn-footnote" id="fnref-footnote" data-footnote-ref>2</a></sup>.</p> -<p>Here's a thing<sup class="footnote-ref"><a href="#fn-other-note" id="fnref-other-note" data-footnote-ref>3</a></sup>.</p> -<p>And another thing<sup class="footnote-ref"><a href="#fn-codeblock-note" id="fnref-codeblock-note" data-footnote-ref>4</a></sup>.</p> -<p>This doesn't have a referent[^nope].</p> -<p>Hi!</p> -<section class="footnotes" data-footnotes> -<ol> -<li id="fn-1"> -<p>Some <em>bolded</em> footnote definition. <a href="#fnref-1" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1">↩</a></p> -</li> -<li id="fn-footnote"> -<blockquote> -<p>Blockquotes can be in a footnote.</p> -</blockquote> -<pre><code>as well as code blocks -</code></pre> -<p>or, naturally, simple paragraphs. <a href="#fnref-footnote" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="2" aria-label="Back to reference 2">↩</a></p> -</li> -<li id="fn-other-note"> -<p>no code block here (spaces are stripped away) <a href="#fnref-other-note" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="3" aria-label="Back to reference 3">↩</a></p> -</li> -<li id="fn-codeblock-note"> -<pre><code>this is now a code block (8 spaces indentation) -</code></pre> -<a href="#fnref-codeblock-note" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="4" aria-label="Back to reference 4">↩</a> -</li> -</ol> -</section> -```````````````````````````````` - -## When a footnote is used multiple times, we insert multiple backrefs. - -```````````````````````````````` example -This is some text. It has a footnote[^a-footnote]. - -This footnote is referenced[^a-footnote] multiple times, in lots of different places.[^a-footnote] - -[^a-footnote]: This footnote definition should have three backrefs. -. -<p>This is some text. It has a footnote<sup class="footnote-ref"><a href="#fn-a-footnote" id="fnref-a-footnote" data-footnote-ref>1</a></sup>.</p> -<p>This footnote is referenced<sup class="footnote-ref"><a href="#fn-a-footnote" id="fnref-a-footnote-2" data-footnote-ref>1</a></sup> multiple times, in lots of different places.<sup class="footnote-ref"><a href="#fn-a-footnote" id="fnref-a-footnote-3" data-footnote-ref>1</a></sup></p> -<section class="footnotes" data-footnotes> -<ol> -<li id="fn-a-footnote"> -<p>This footnote definition should have three backrefs. <a href="#fnref-a-footnote" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1">↩</a> <a href="#fnref-a-footnote-2" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1-2" aria-label="Back to reference 1-2">↩<sup class="footnote-ref">2</sup></a> <a href="#fnref-a-footnote-3" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1-3" aria-label="Back to reference 1-3">↩<sup class="footnote-ref">3</sup></a></p> -</li> -</ol> -</section> -```````````````````````````````` - -## Footnote reference labels are href escaped - -```````````````````````````````` example -Hello[^"><script>alert(1)</script>] - -[^"><script>alert(1)</script>]: pwned -. -<p>Hello<sup class="footnote-ref"><a href="#fn-%22%3E%3Cscript%3Ealert(1)%3C/script%3E" id="fnref-%22%3E%3Cscript%3Ealert(1)%3C/script%3E" data-footnote-ref>1</a></sup></p> -<section class="footnotes" data-footnotes> -<ol> -<li id="fn-%22%3E%3Cscript%3Ealert(1)%3C/script%3E"> -<p>pwned <a href="#fnref-%22%3E%3Cscript%3Ealert(1)%3C/script%3E" class="footnote-backref" data-footnote-backref data-footnote-backref-idx="1" aria-label="Back to reference 1">↩</a></p> -</li> -</ol> -</section> -```````````````````````````````` - -## Interop - -Autolink and strikethrough. - -```````````````````````````````` example -~~www.google.com~~ - -~~http://google.com~~ -. -<p><del><a href="http://www.google.com">www.google.com</a></del></p> -<p><del><a href="http://google.com">http://google.com</a></del></p> -```````````````````````````````` - -Autolink and tables. - -```````````````````````````````` example -| a | b | -| --- | --- | -| https://github.com www.github.com | http://pokemon.com | -. -<table> -<thead> -<tr> -<th>a</th> -<th>b</th> -</tr> -</thead> -<tbody> -<tr> -<td><a href="https://github.com">https://github.com</a> <a href="http://www.github.com">www.github.com</a></td> -<td><a href="http://pokemon.com">http://pokemon.com</a></td> -</tr> -</tbody> -</table> -```````````````````````````````` - -## Task lists - -```````````````````````````````` example -- [ ] foo -- [x] bar -. -<ul> -<li><input type="checkbox" disabled="" /> foo</li> -<li><input type="checkbox" checked="" disabled="" /> bar</li> -</ul> -```````````````````````````````` - -Show that a task list and a regular list get processed the same in -the way that sublists are created. If something works in a list -item, then it should work the same way with a task. The only -difference should be the tasklist marker. So, if we use something -other than a space or x, it won't be recognized as a task item, and -so will be treated as a regular item. - -```````````````````````````````` example -- [x] foo - - [ ] bar - - [x] baz -- [ ] bim - -Show a regular (non task) list to show that it has the same structure -- [@] foo - - [@] bar - - [@] baz -- [@] bim -. -<ul> -<li><input type="checkbox" checked="" disabled="" /> foo -<ul> -<li><input type="checkbox" disabled="" /> bar</li> -<li><input type="checkbox" checked="" disabled="" /> baz</li> -</ul> -</li> -<li><input type="checkbox" disabled="" /> bim</li> -</ul> -<p>Show a regular (non task) list to show that it has the same structure</p> -<ul> -<li>[@] foo -<ul> -<li>[@] bar</li> -<li>[@] baz</li> -</ul> -</li> -<li>[@] bim</li> -</ul> -```````````````````````````````` -Use a larger indent -- a task list and a regular list should produce -the same structure. - -```````````````````````````````` example -- [x] foo - - [ ] bar - - [x] baz -- [ ] bim - -Show a regular (non task) list to show that it has the same structure -- [@] foo - - [@] bar - - [@] baz -- [@] bim -. -<ul> -<li><input type="checkbox" checked="" disabled="" /> foo -<ul> -<li><input type="checkbox" disabled="" /> bar</li> -<li><input type="checkbox" checked="" disabled="" /> baz</li> -</ul> -</li> -<li><input type="checkbox" disabled="" /> bim</li> -</ul> -<p>Show a regular (non task) list to show that it has the same structure</p> -<ul> -<li>[@] foo -<ul> -<li>[@] bar</li> -<li>[@] baz</li> -</ul> -</li> -<li>[@] bim</li> -</ul> -```````````````````````````````` - -<!-- end of the "GFM undocumented extensions and more robust test" section --> - diff --git a/glfm_specification/output_spec/spec.html b/glfm_specification/output_spec/spec.html deleted file mode 100644 index 6e2d908dd0d655a660bd99b84b05f6ea4b7e93a6..0000000000000000000000000000000000000000 --- a/glfm_specification/output_spec/spec.html +++ /dev/null @@ -1,570 +0,0 @@ -<!DOCTYPE html> -<!-- NOTE: Styling is based on the CommonMark specification template: --> -<!-- - https://github.com/commonmark/commonmark-spec/blob/master/tools/make_spec.lua --> -<!-- - https://github.com/commonmark/commonmark-spec/blob/master/tools/template.html --> -<!-- --> -<!-- NOTE: 'TODO:' comments will be followed up as task(s) on this issue: --> -<!-- - https://gitlab.com/gitlab-org/gitlab/-/issues/361241 --> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <title>GitLab Flavored Markdown Official Specification</title> - <style type="text/css"> - body { - font-family: Helvetica, arial, freesans, clean, sans-serif; - line-height: 1.4; - max-width: 48em; - margin: auto; - padding: 0 0.5em 4em; - color: #333333; - background-color: #ffffff; - font-size: 13pt; - } - - div#TOC ul { list-style: none; } - h1 { - font-size: 140%; - font-weight: bold; - border-top: 1px solid gray; - padding-top: 0.5em; - } - - h2 { - font-size: 120%; - font-weight: bold; - } - - h3 { - font-size: 110%; - font-weight: bold; - } - - h4 { - font-size: 100%; - font-weight: bold; - } - - /* NOTE: "font-weight: bold" was applied to "a.definition" class in original CommonMark */ - /* template, but in practice it was applied to all anchors */ - a { - font-weight: bold; - } - - - /* TODO: Format whitespace in examples. This will require preprocessing to insert spans around them. */ - /*span.space { position: relative; }*/ - /*span.space:after {*/ - /* content: "·";*/ - /* position: absolute;*/ - /* !* create a mark that indicates a space (trick from D. Greenspan) *!*/ - /* top: 0; bottom: 7px; left: 1px; right: 1px;*/ - /* color: #aaaaaa;*/ - /*}*/ - /*@media print {*/ - /* a.dingus { display: none; }*/ - /*}*/ - - div.example { - overflow: hidden; - } - - p { - text-align: justify; - } - - pre { - padding: 0.5em; - margin: 0.2em 0 0.5em; - font-size: 88%; - } - - pre { - white-space: pre-wrap; /* css-3 */ - white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ - white-space: -o-pre-wrap; /* Opera 7 */ - word-wrap: break-word; /* Internet Explorer 5.5+ */ - } - - code { - font-family: monospace; - background-color: #d3e1e4; - } - - pre > code { - background-color: transparent; - } - - .example { - font-size: 0; /* hack to get width: 50% to work on inline-block */ - padding-bottom: 6pt; - } - - .column pre { - font-size: 11pt; - padding: 2pt 6pt; - } - - div.examplenum { - font-size: 11pt; - text-align: left; - margin-bottom: 10px; - } - - div.column { - display: inline-block; - width: 50%; - vertical-align: top; - } - - div.example > div:nth-child(2) { - clear: left; - background-color: #d3e1e4; - } - - div.example > div:nth-child(3) { - clear: right; - background-color: #c9cace; - } - - @media print { - @page { - size: auto; - margin: 1.2in 1.2in 1.2in 1.2in; - } - - body { - margin: 0; - line-height: 1.2; - font-size: 10pt; - } - - .column pre { - font-size: 9pt; - } - - div.examplenum { - font-size: 9pt; - } - } - </style> - <!-- TODO: Extract this javascript out to a separate file and unit test it --> - <script type="text/javascript"> - /* NOTE: The following code performs many of the pre-processing steps originally handled */ - /* in https://github.com/commonmark/commonmark-spec/blob/master/tools/make_spec.lua */ - - /* Adds a div.example wrapper around each pair of example code blocks. */ - function addAttributesToExampleWrapperDivs() { - const exampleAnchorTags = document.querySelectorAll("a[href^=\"#example-\"]"); - for (const exampleAnchorTag of exampleAnchorTags) { - const examplenumDiv = exampleAnchorTag.parentElement; - examplenumDiv.classList.add("examplenum"); - const exampleDiv = examplenumDiv.parentElement; - exampleDiv.classList.add("example"); - exampleDiv.id = exampleAnchorTag.getAttribute("href").substring(1); - } - } - - function addColumnClassToMarkdownDivs() { - const markdownCodeBlockDivs = document.querySelectorAll("div.markdown-code-block"); - for (const markdownCodeBlockDiv of markdownCodeBlockDivs) { - markdownCodeBlockDiv.classList.add("column"); - } - } - - function addNumbersToHeaders() { - const headers = document.querySelectorAll('h1,h2,h3'); - let h1Index = -1; // NOTE: -1 because we don't assign a number to the title - let h2Index = 0; - let h3Index = 0; - const tocEntries = []; - for (const header of headers) { - if (h1Index === -1) { - h1Index++; - continue; - } - - const originalHeaderTextContent = header.textContent.trim(); - const headerAnchor = originalHeaderTextContent.toLowerCase().replaceAll(' ', '-'); - header.id = headerAnchor; - let indent; - let headerTextContent; - if (header.tagName === 'H1') { - h1Index++; - h2Index = 0; - h3Index = 0; - header.textContent = headerTextContent = h1Index + ' ' + originalHeaderTextContent; - indent = 0; - } else if (header.tagName === 'H2') { - h2Index++; - h3Index = 0; - header.textContent = - headerTextContent = h1Index + '.' + h2Index + ' ' + originalHeaderTextContent; - indent = 1; - } else if (header.tagName === 'H3') { - h3Index++; - header.textContent = headerTextContent = - h1Index + '.' + h2Index + '.' + h3Index + ' ' + originalHeaderTextContent; - indent = 2; - } - tocEntries.push({headerAnchor, headerTextContent, indent}); - } - } - - document.addEventListener("DOMContentLoaded", function(_event) { - addAttributesToExampleWrapperDivs(); - addColumnClassToMarkdownDivs(); - const tocEntries = addNumbersToHeaders(); - addToc(tocEntries); - }); - - /* NOTE: The following code is to support the "Try it" interactive "dingus", which */ - /* we do not yet support. But it is being left here for comparison context with the */ - /* original CommonMark template. */ - // $$(document).ready(function() { - // $$("div.example").each(function(e) { - // var t = $$(this).find('code.language-markdown').text(); - // $$(this).find('a.dingus').click(function(f) { - // window.open('/dingus/?text=' + - // encodeURIComponent(t.replace(/→/g,"\t"))); - // }); - // }); - // $$("code.language-markdown").dblclick(function(e) { window.open('/dingus/?text=' + - // encodeURIComponent($$(this).text())); - // }); - // }); - </script> -</head> -<body> -<h1 class="title">GitLab Flavored Markdown Official Specification</h1> -<div class="version">Version alpha</div> - -<ul class="section-nav"> -<li><a href="#introduction">Introduction</a></li> -<li> -<a href="#gitlab-official-specification-markdown">GitLab Official Specification Markdown</a><ul> -<li><a href="#task-list-items">Task list items</a></li> -<li><a href="#front-matter">Front matter</a></li> -<li><a href="#table-of-contents">Table of contents</a></li> -</ul> -</li> -</ul> -<hr data-sourcepos="3:1-3:3"> -<p data-sourcepos="4:1-6:3" dir="auto">title: GitLab Flavored Markdown (GLFM) Spec -version: alpha -...</p> -<h1 data-sourcepos="8:1-8:14" dir="auto"> -<a href="#introduction" aria-hidden="true" class="anchor" id="user-content-introduction"></a>Introduction</h1> -<p data-sourcepos="10:1-10:284" dir="auto">GitLab Flavored Markdown (GLFM) extends the <a data-sourcepos="10:45-10:108" href="https://spec.commonmark.org/current/" rel="nofollow noreferrer noopener" target="_blank">CommonMark specification</a> and is considered a strict superset of CommonMark. It also incorporates the extensions defined by the <a data-sourcepos="10:212-10:283" href="https://github.github.com/gfm/" rel="nofollow noreferrer noopener" target="_blank">GitHub Flavored Markdown specification</a>.</p> -<p data-sourcepos="12:1-12:433" dir="auto">This specification will define the various official extensions that comprise GLFM. These extensions are GitLab independent - they do not require a GitLab server for parsing or interaction. The intent is to provide a specification that can be implemented in standard markdown editors. This includes many of the features listed in <a data-sourcepos="12:330-12:432" 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="14:1-14:69" dir="auto">The CommonMark and GitHub specifications will not be duplicated here.</p> -<p data-sourcepos="16:1-19:75" dir="auto">NOTE: The example numbering in this document does not start at "1", because this official specification -only contains a subset of all the examples which are supported by GitLab Flavored Markdown. See -<a data-sourcepos="18:1-18:137" href="https://gitlab.com/gitlab-org/gitlab/-/blob/master/glfm_specification/output_example_snapshots/snapshot_spec.html" rel="nofollow noreferrer noopener" target="_blank"><code data-sourcepos="18:3-18:20">snapshot_spec.html</code></a> -for a complete list of all examples, which are a superset of examples from:</p> -<ul data-sourcepos="21:1-25:0" dir="auto"> -<li data-sourcepos="21:1-21:12">CommonMark</li> -<li data-sourcepos="22:1-22:26">GitHub Flavored Markdown</li> -<li data-sourcepos="23:1-23:88">GitLab Flavored Markdown Official Specification (the same ones from this specifiation)</li> -<li data-sourcepos="24:1-25:0">GitLab Flavored Markdown Internal Extensions.</li> -</ul> -<!-- BEGIN TESTS --> -<h1 data-sourcepos="27:1-27:40" dir="auto"> -<a href="#gitlab-official-specification-markdown" aria-hidden="true" class="anchor" id="user-content-gitlab-official-specification-markdown"></a>GitLab Official Specification Markdown</h1> -<p data-sourcepos="29:1-31:104" dir="auto">Note: This specification is a work in progress. Only some of the official GLFM extensions -are defined. We will continue to add any additional ones found in the -<a data-sourcepos="31:1-31:103" 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="33:1-34: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="36:1-36:18" dir="auto"> -<a href="#task-list-items" aria-hidden="true" class="anchor" id="user-content-task-list-items"></a>Task list items</h2> -<p data-sourcepos="38:1-39:117" dir="auto">See -<a data-sourcepos="39:1-39:70" 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="41:1-44: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="46:1-46:85" dir="auto">Some of the behavior of task list items is implemented as client-side JavaScript/CSS.</p> -<p data-sourcepos="48:1-48:80" dir="auto">The following are some basic examples; more examples may be added in the future.</p> -<p data-sourcepos="50:1-50:16" dir="auto">Incomplete task:</p> -<div> -<div><a href="#example-674">Example 674</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="55:1-57:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" v-pre="true"><code><span id="LC1" class="line" lang="plaintext">- [ ] incomplete</span></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="59:1-67:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="70:1-70:15" dir="auto">Completed task:</p> -<div> -<div><a href="#example-675">Example 675</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="75:1-77:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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="79:1-87:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="90:1-90:18" dir="auto">Inapplicable task:</p> -<div> -<div><a href="#example-676">Example 676</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="95:1-97:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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="99:1-109:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="112:1-113:50" dir="auto">Inapplicable task in a "loose" list. Note that the <code data-sourcepos="112:53-112:57"><del></code> tag is not applied to the -loose text; it has strikethrough applied with CSS.</p> -<div> -<div><a href="#example-677">Example 677</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="118:1-122:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="124:1-139:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<h2 data-sourcepos="142:1-142:15" dir="auto"> -<a href="#front-matter" aria-hidden="true" class="anchor" id="user-content-front-matter"></a>Front matter</h2> -<p data-sourcepos="144:1-145:121" dir="auto">See -<a data-sourcepos="145:1-145:74" 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="147:1-148: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="150:1-150:18" dir="auto">YAML front matter:</p> -<div> -<div><a href="#example-678">Example 678</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="155:1-159:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="161:1-167:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="170:1-170:18" dir="auto">TOML front matter:</p> -<div> -<div><a href="#example-679">Example 679</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="175:1-179:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="181:1-187:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="190:1-190:18" dir="auto">JSON front matter:</p> -<div> -<div><a href="#example-680">Example 680</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="195:1-201:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="203:1-211:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="214:1-214:66" dir="auto">Front matter blocks should be inserted at the top of the document:</p> -<div> -<div><a href="#example-681">Example 681</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="219:1-225:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="227:1-231:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="234:1-234:74" dir="auto">Front matter block delimiters shouldn’t be preceded by space characters:</p> -<div> -<div><a href="#example-682">Example 682</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="239:1-243:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="245:1-248:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<h2 data-sourcepos="251:1-251:20" dir="auto"> -<a href="#table-of-contents" aria-hidden="true" class="anchor" id="user-content-table-of-contents"></a>Table of contents</h2> -<p data-sourcepos="253:1-255:46" dir="auto">See -<a data-sourcepos="254:1-254:84" 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="257:1-261:23" dir="auto">NOTE: Because of this bug (<a href="https://gitlab.com/gitlab-org/gitlab/-/issues/359077" rel="nofollow noreferrer noopener" target="_blank">https://gitlab.com/gitlab-org/gitlab/-/issues/359077</a>), -we cannot actually include the <code data-sourcepos="258:33-258:35">TOC</code> tag with single brackets in backticks -in this Markdown document, otherwise it would render a table of contents inline -right here. So, it's been switched to <code data-sourcepos="260:40-260:40">[</code> + <code data-sourcepos="260:46-260:48">TOC</code> + <code data-sourcepos="260:54-260:54">]</code> instead. This can be reverted -once that bug is fixed.</p> -<p data-sourcepos="263:1-264:76" dir="auto">A table of contents is an unordered list that links to subheadings in the document. -Add either the <code data-sourcepos="264:17-264:25">[[_TOC_]]</code> tag or the <code data-sourcepos="264:40-264:40">[</code> + <code data-sourcepos="264:46-264:48">TOC</code> + <code data-sourcepos="264:54-264:54">]</code> tag on its own line.</p> -<div> -<div><a href="#example-683">Example 683</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="269:1-275:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="277:1-288:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<div> -<div><a href="#example-684">Example 684</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="294:1-300:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="302:1-313:32" class="code highlight js-syntax-highlight language-plaintext" 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> -<p data-sourcepos="316:1-317:5" dir="auto">A table of contents is a block element. It should preceded and followed by a blank -line.</p> -<div> -<div><a href="#example-685">Example 685</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="322:1-328:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="330:1-333:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<p data-sourcepos="336:1-336:60" dir="auto">A table of contents can be indented with up to three spaces.</p> -<div> -<div><a href="#example-686">Example 686</a></div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="341:1-345:32" data-canonical-lang="example" data-lang-params="gitlab" class="code highlight js-syntax-highlight language-plaintext" 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></code></pre> -<copy-code></copy-code> -</div> -<div class="gl-relative markdown-code-block js-markdown-code"> -<pre data-sourcepos="347:1-354:32" class="code highlight js-syntax-highlight language-plaintext" 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> -</div> -<!-- END TESTS --> - -</body> -</html> - diff --git a/glfm_specification/output_spec/spec.txt b/glfm_specification/output_spec/spec.txt deleted file mode 100644 index 10484da553111edb5ecc705a03ee0bb5ae73313b..0000000000000000000000000000000000000000 --- a/glfm_specification/output_spec/spec.txt +++ /dev/null @@ -1,280 +0,0 @@ ---- -title: GitLab Flavored Markdown Official Specification -version: alpha -... ---- -title: GitLab Flavored Markdown (GLFM) Spec -version: alpha -... - -# Introduction - -GitLab Flavored Markdown (GLFM) extends the [CommonMark specification](https://spec.commonmark.org/current/) and is considered a strict superset of CommonMark. It also incorporates the extensions defined by the [GitHub Flavored Markdown specification](https://github.github.com/gfm/). - -This specification will define the various official extensions that comprise GLFM. These extensions are GitLab independent - they do not require a GitLab server for parsing or interaction. The intent is to provide a specification that can be implemented in standard markdown editors. This includes many of the features listed in [user-facing documentation for GitLab Flavored Markdown](https://docs.gitlab.com/ee/user/markdown.html). - -The CommonMark and GitHub specifications will not be duplicated here. - -NOTE: The example numbering in this document does not start at "1", because this official specification -only contains a subset of all the examples which are supported by GitLab Flavored Markdown. See -[`snapshot_spec.html`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/glfm_specification/output_example_snapshots/snapshot_spec.html) -for a complete list of all examples, which are a superset of examples from: - -- CommonMark -- GitHub Flavored Markdown -- GitLab Flavored Markdown Official Specification (the same ones from this specifiation) -- GitLab Flavored Markdown Internal Extensions. - -<!-- BEGIN TESTS --> -# GitLab Official Specification Markdown - -Note: This specification is a work in progress. Only some of the official GLFM extensions -are defined. We will continue to add any additional ones found in the -[user-facing documentation for GitLab Flavored Markdown](https://docs.gitlab.com/ee/user/markdown.html). - -There is currently only this single top-level heading, but the -examples may be split into multiple top-level headings in the future. - -## Task list items - -See -[Task lists](https://docs.gitlab.com/ee/user/markdown.html#task-lists) in the GitLab Flavored Markdown documentation. - -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. - -Some of the behavior of task list items is implemented as client-side JavaScript/CSS. - -The following are some basic examples; more examples may be added in the future. - -Incomplete task: - -```````````````````````````````` example gitlab -- [ ] incomplete -. -<ul> -<li> -<task-button/> -<input type="checkbox" disabled/> -incomplete -</li> -</ul> -```````````````````````````````` - -Completed task: - -```````````````````````````````` example gitlab -- [x] completed -. -<ul> -<li> -<task-button/> -<input type="checkbox" checked disabled/> -completed -</li> -</ul> -```````````````````````````````` - -Inapplicable task: - -```````````````````````````````` example gitlab -- [~] inapplicable -. -<ul> -<li> -<task-button/> -<input type="checkbox" data-inapplicable disabled> -<s> -inapplicable -</s> -</li> -</ul> -```````````````````````````````` - -Inapplicable task in a "loose" list. Note that the `<del>` tag is not applied to the -loose text; it has strikethrough applied with CSS. - -```````````````````````````````` example gitlab -- [~] inapplicable - - text in loose list -. -<ul> -<li> -<p> -<task-button/> -<input type="checkbox" data-inapplicable disabled> -<s> -inapplicable -</s> -</p> -<p> -text in loose list -</p> -</li> -</ul> -```````````````````````````````` - -## Front matter - -See -[Front matter](https://docs.gitlab.com/ee/user/markdown.html#front-matter) in the GitLab Flavored Markdown documentation. - -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. - -YAML front matter: - -```````````````````````````````` example gitlab ---- -title: YAML front matter ---- -. -<pre> -<code> -title: YAML front matter -</code> -</pre> -```````````````````````````````` - -TOML front matter: - -```````````````````````````````` example gitlab -+++ -title: TOML front matter -+++ -. -<pre> -<code> -title: TOML front matter -</code> -</pre> -```````````````````````````````` - -JSON front matter: - -```````````````````````````````` example gitlab -;;; -{ - "title": "JSON front matter" -} -;;; -. -<pre> -<code> -{ - "title": "JSON front matter" -} -</code> -</pre> -```````````````````````````````` - -Front matter blocks should be inserted at the top of the document: - -```````````````````````````````` example gitlab -text - ---- -title: YAML front matter ---- -. -<p>text</p> -<hr> -<h2>title: YAML front matter</h2> -```````````````````````````````` - -Front matter block delimiters shouldn’t be preceded by space characters: - -```````````````````````````````` example gitlab - --- -title: YAML front matter ---- -. -<hr> -<h2>title: YAML front matter</h2> -```````````````````````````````` - -## Table of contents - -See -[table of contents](https://docs.gitlab.com/ee/user/markdown.html#table-of-contents) -in the GitLab Flavored Markdown documentation. - -NOTE: Because of this bug (https://gitlab.com/gitlab-org/gitlab/-/issues/359077), -we cannot actually include the `TOC` tag with single brackets in backticks -in this Markdown document, otherwise it would render a table of contents inline -right here. So, it's been switched to `[` + `TOC` + `]` instead. This can be reverted -once that bug is fixed. - -A table of contents is an unordered list that links to subheadings in the document. -Add either the `[[_TOC_]]` tag or the `[` + `TOC` + `]` tag on its own line. - -```````````````````````````````` example gitlab -[TOC] - -# Heading 1 - -## Heading 2 -. -<nav> - <ul> - <li><a href="#heading-1">Heading 1</a></li> - <ul> - <li><a href="#heading-2">Heading 2</a></li> - </ul> - </ul> -</nav> -<h1>Heading 1</h1> -<h2>Heading 2</h2> -```````````````````````````````` - -```````````````````````````````` example gitlab -[[_TOC_]] - -# Heading 1 - -## Heading 2 -. -<nav> - <ul> - <li><a href="#heading-1">Heading 1</a></li> - <ul> - <li><a href="#heading-2">Heading 2</a></li> - </ul> - </ul> -</nav> -<h1>Heading 1</h1> -<h2>Heading 2</h2> -```````````````````````````````` - -A table of contents is a block element. It should preceded and followed by a blank -line. - -```````````````````````````````` example gitlab -[[_TOC_]] -text - -text -[TOC] -. -<p>[[<em>TOC</em>]]text</p> -<p>text[TOC]</p> -```````````````````````````````` - -A table of contents can be indented with up to three spaces. - -```````````````````````````````` example gitlab - [[_TOC_]] - -# Heading 1 -. -<nav> - <ul> - <li><a href="#heading-1">Heading 1</a></li> - </ul> -</nav> -<h1>Heading 1</h1> -```````````````````````````````` -<!-- END TESTS --> diff --git a/scripts/glfm/run-snapshot-tests.sh b/scripts/glfm/run-snapshot-tests.sh deleted file mode 100755 index 0a3891e243af356d88d389a10d49e81ea930a4d4..0000000000000000000000000000000000000000 --- a/scripts/glfm/run-snapshot-tests.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash - -# shellcheck disable=SC2059 - -set -o errexit # AKA -e - exit immediately on errors (http://mywiki.wooledge.org/BashFAQ/105) - -# https://stackoverflow.com/a/28938235 -BCyan='\033[1;36m' # Bold Cyan -BRed='\033[1;31m' # Bold Red -BGreen='\033[1;32m' # Bold Green -BBlue='\033[1;34m' # Bold Blue -Color_Off='\033[0m' # Text Reset - -function onexit_err() { - local exit_status=${1:-$?} - printf "\nâŒâŒâŒ ${BRed}GLFM snapshot tests failed!${Color_Off} âŒâŒâŒ\n" - exit "${exit_status}" -} -trap onexit_err ERR -set -o errexit - -printf "${BCyan}" -printf "\nStarting GLFM snapshot example tests. See https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#run-snapshot-testssh-script for more details.\n\n" -printf "Set 'FOCUSED_MARKDOWN_EXAMPLES=example_name_1[,...]' for focused examples, with example name(s) from https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#glfm_specificationexample_snapshotsexamples_indexyml.\n" -printf "${Color_Off}" - -# NOTE: Unlike the backend markdown_snapshot_spec.rb which has a CE and EE version, there is only -# one version of this spec. This is because the frontend markdown rendering does not require EE-only -# backend features. -printf "\n${BBlue}Running frontend 'yarn jest spec/frontend/content_editor/markdown_snapshot_spec.js'...${Color_Off}\n\n" -yarn jest spec/frontend/content_editor/markdown_snapshot_spec.js -printf "\n${BBlue}'yarn jest spec/frontend/content_editor/markdown_snapshot_spec.js' passed!${Color_Off}\n\n" - -printf "\n${BBlue}Running CE backend 'bundle exec rspec spec/requests/api/markdown_snapshot_spec.rb'...${Color_Off}\n\n" -bundle exec rspec spec/requests/api/markdown_snapshot_spec.rb -printf "\n${BBlue}'bundle exec rspec spec/requests/api/markdown_snapshot_spec.rb' passed!${Color_Off}\n\n" - -printf "\n${BBlue}Running EE backend 'bundle exec rspec ee/spec/requests/api/markdown_snapshot_spec.rb'...${Color_Off}\n\n" -bundle exec rspec ee/spec/requests/api/markdown_snapshot_spec.rb -printf "\n${BBlue}'bundle exec rspec ee/spec/requests/api/markdown_snapshot_spec.rb' passed!${Color_Off}\n\n" - -printf "\n✅✅✅ ${BGreen}All GLFM snapshot example tests passed successfully!${Color_Off} ✅✅✅\n" diff --git a/scripts/glfm/run-spec-tests.sh b/scripts/glfm/run-spec-tests.sh deleted file mode 100755 index b60f6b05051e8de9d80b307b29600e4a497f3685..0000000000000000000000000000000000000000 --- a/scripts/glfm/run-spec-tests.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash - -# shellcheck disable=SC2059 - -set -o errexit # AKA -e - exit immediately on errors (http://mywiki.wooledge.org/BashFAQ/105) - -# https://stackoverflow.com/a/28938235 -BCyan='\033[1;36m' # Bold Cyan -BRed='\033[1;31m' # Bold Red -Color_Off='\033[0m' # Text Reset - -function onexit_err() { - local exit_status=${1:-$?} - printf "\nâŒâŒâŒ ${BRed}GLFM spec tests failed!${Color_Off} âŒâŒâŒ\n" - exit "${exit_status}" -} -trap onexit_err ERR -set -o errexit - -printf "${BCyan}" -printf "\nThis script is not yet implemented!\n" -printf "\nSee https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#run-spec-testssh-script for more details.\n\n" -printf "${Color_Off}" diff --git a/scripts/glfm/update-example-snapshots.rb b/scripts/glfm/update-example-snapshots.rb deleted file mode 100755 index ff02ce5964c8da52c97f5432ef8878e12051d431..0000000000000000000000000000000000000000 --- a/scripts/glfm/update-example-snapshots.rb +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -require_relative '../lib/glfm/update_example_snapshots' -Glfm::UpdateExampleSnapshots.new.process diff --git a/scripts/glfm/update-specification.rb b/scripts/glfm/update-specification.rb deleted file mode 100755 index 7b2c30be61c57fe4e4531259913f2060d4ba7710..0000000000000000000000000000000000000000 --- a/scripts/glfm/update-specification.rb +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -require_relative '../lib/glfm/update_specification' -Glfm::UpdateSpecification.new.process diff --git a/scripts/lib/glfm/constants.rb b/scripts/lib/glfm/constants.rb deleted file mode 100644 index 16ffb12db5713a664b2448edd4f1afa18e25c6e3..0000000000000000000000000000000000000000 --- a/scripts/lib/glfm/constants.rb +++ /dev/null @@ -1,68 +0,0 @@ -# frozen_string_literal: true - -require 'pathname' - -module Glfm - module Constants - # Version and titles for rendering - GLFM_SPEC_VERSION = 'alpha' - GLFM_SPEC_TXT_TITLE = 'GitLab Flavored Markdown Official Specification' - ES_SNAPSHOT_SPEC_TITLE = 'GitLab Flavored Markdown Internal Extensions' - - # Root dir containing all specification files - specification_path = Pathname.new(File.expand_path("../../../glfm_specification", __dir__)) - - # GitHub Flavored Markdown specification file - GHFM_SPEC_TXT_URI = 'https://raw.githubusercontent.com/github/cmark-gfm/master/test/spec.txt' - GHFM_SPEC_VERSION = '0.29' - GHFM_SPEC_MD_FILENAME = "ghfm_spec_v_#{GHFM_SPEC_VERSION}.md" - GHFM_SPEC_MD_PATH = specification_path.join('input/github_flavored_markdown', GHFM_SPEC_MD_FILENAME) - - # GitLab Flavored Markdown specification files - specification_input_glfm_path = specification_path.join('input/gitlab_flavored_markdown') - GLFM_OFFICIAL_SPECIFICATION_MD_PATH = - specification_input_glfm_path.join('glfm_official_specification.md') - GLFM_INTERNAL_EXTENSIONS_MD_PATH = specification_input_glfm_path.join('glfm_internal_extensions.md') - GLFM_EXAMPLE_STATUS_YML_PATH = specification_input_glfm_path.join('glfm_example_status.yml') - GLFM_EXAMPLE_METADATA_YML_PATH = - specification_input_glfm_path.join('glfm_example_metadata.yml') - GLFM_EXAMPLE_NORMALIZATIONS_YML_PATH = specification_input_glfm_path.join('glfm_example_normalizations.yml') - GLFM_OUTPUT_SPEC_PATH = specification_path.join('output_spec') - GLFM_SPEC_TXT_PATH = GLFM_OUTPUT_SPEC_PATH.join('spec.txt') - GLFM_SPEC_HTML_PATH = GLFM_OUTPUT_SPEC_PATH.join('spec.html') - GLFM_SPEC_TXT_HEADER = <<~MARKDOWN - --- - title: #{GLFM_SPEC_TXT_TITLE} - version: #{GLFM_SPEC_VERSION} - ... - MARKDOWN - - # Example Snapshot (ES) files - ES_OUTPUT_EXAMPLE_SNAPSHOTS_PATH = specification_path.join('output_example_snapshots') - ES_SNAPSHOT_SPEC_MD_PATH = ES_OUTPUT_EXAMPLE_SNAPSHOTS_PATH.join('snapshot_spec.md') - ES_SNAPSHOT_SPEC_HTML_PATH = ES_OUTPUT_EXAMPLE_SNAPSHOTS_PATH.join('snapshot_spec.html') - ES_EXAMPLES_INDEX_YML_PATH = ES_OUTPUT_EXAMPLE_SNAPSHOTS_PATH.join('examples_index.yml') - ES_MARKDOWN_YML_PATH = ES_OUTPUT_EXAMPLE_SNAPSHOTS_PATH.join('markdown.yml') - ES_HTML_YML_PATH = ES_OUTPUT_EXAMPLE_SNAPSHOTS_PATH.join('html.yml') - ES_PROSEMIRROR_JSON_YML_PATH = ES_OUTPUT_EXAMPLE_SNAPSHOTS_PATH.join('prosemirror_json.yml') - ES_SNAPSHOT_SPEC_MD_HEADER = <<~MARKDOWN - --- - title: #{ES_SNAPSHOT_SPEC_TITLE} - version: #{GLFM_SPEC_VERSION} - ... - MARKDOWN - - # Other constants used for processing files - 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 -->' - MARKDOWN_TEMPFILE_BASENAME = %w[MARKDOWN_TEMPFILE_ .yml].freeze - METADATA_TEMPFILE_BASENAME = %w[METADATA_TEMPFILE_ .yml].freeze - STATIC_HTML_TEMPFILE_BASENAME = %w[STATIC_HTML_TEMPFILE_ .yml].freeze - WYSIWYG_HTML_AND_JSON_TEMPFILE_BASENAME = %w[WYSIWYG_HTML_AND_JSON_TEMPFILE_ .yml].freeze - end -end diff --git a/scripts/lib/glfm/parse_examples.rb b/scripts/lib/glfm/parse_examples.rb deleted file mode 100644 index f8f6960a3516e25e591b1ca50c4621dedc361567..0000000000000000000000000000000000000000 --- a/scripts/lib/glfm/parse_examples.rb +++ /dev/null @@ -1,199 +0,0 @@ -# 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 -# -# The logic and structure is as unchanged as possible from the original Python - no -# cleanup or refactoring was done. -# -# Changes from the original logic were made to follow Ruby/GitLab syntax, idioms, and linting rules. -# -# Additional logic was also added to: -# 1. Capture all nested headers, not just the most recent. -# 2. Raise an exception if an unexpected state is encountered. -# -# Comments indicate where changes, deletions, or additions were made. -# -# See more detailed documentation of rules regarding the handling of headers -# in the comments at the top of `Glfm::UpdateExampleSnapshots#add_example_names`, -# in `scripts/lib/glfm/update_example_snapshots.rb` -module Glfm - module ParseExamples - include Constants - - REGULAR_TEXT = 0 - MARKDOWN_EXAMPLE = 1 - HTML_OUTPUT = 2 - - # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/AbcSize - def parse_examples(spec_txt_lines) - line_number = 0 - start_line = 0 - example_number = 0 - markdown_lines = [] - html_lines = [] - state = REGULAR_TEXT # 0 regular text, 1 markdown example, 2 html output - extensions = [] - headertext = '' # most recent header text - headers = [] # all nested headers since last H2 - new logic compared to original Python code - tests = [] - - h1_regex = /\A# / # new logic compared to original Python code - h2_regex = /\A## / # new logic compared to original Python code - h3_regex = /\A### / # new logic compared to original Python code - header_regex = /\A#+ / # Added beginning of line anchor to original Python code - - spec_txt_lines.each do |line| - line_number += 1 - stripped_line = line.strip - 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_END_STRING - # Else if end line of an example block... - state = REGULAR_TEXT - example_number += 1 - end_line = line_number - - # NOTE: The original implementation completely excludes disabled examples, but we need - # to include them in order to correctly count the header numbering, so we set a flag - # instead. This will need to be accounted for when we run conformance testing. - - # unless extensions.include?('disabled') # commented logic compared to original Python code - tests << - { - markdown: markdown_lines.join.tr('→', "\t"), - html: html_lines.join.tr('→', "\t"), - example: example_number, - start_line: start_line, - end_line: end_line, - section: headertext, - extensions: extensions, - headers: headers.dup, # new logic compared to original Python code - disabled: extensions.include?('disabled') # new logic compared to original Python code - } - # end # commented logic compared to original Python code - - start_line = 0 - markdown_lines = [] - html_lines = [] - elsif stripped_line == "." - # Else if the example divider line... - state = HTML_OUTPUT - # Else if we are currently in a markdown example... - elsif state == MARKDOWN_EXAMPLE - start_line = line_number - 1 if start_line == 0 - - markdown_lines.append(line) - elsif state == HTML_OUTPUT - # Else if we are currently in the html output... - html_lines.append(line) - elsif state == REGULAR_TEXT && line =~ header_regex - # Else if we are in regular text and it is a header line - # NOTE: This assumes examples are within the section under - # Heading level 2 with Heading levels above 2 ignored - - # Extract the header text from the line - headertext = line.gsub(header_regex, '').strip - - # The 'headers' array is new logic compared to the original Python code - - # reset the headers array if we found a new H1 - headers = [] if line =~ h1_regex - - # headers should be size 3 or less [<H1_headertext>, <H2_headertext>, <H3_headertext>] - - if headers.length == 1 && line =~ h3_regex - errmsg = "Error: The H3 '#{headertext}' may not be nested directly within the H1 '#{headers[0]}'. " \ - "Add an H2 header before the H3 header." - raise errmsg - end - - if (headers.length == 2 || headers.length == 3) && line =~ h2_regex - # drop the everything but first entry from the headers array if we are in an H2 and found a new H2 - headers = [headers[0]] - elsif headers.length == 3 && line =~ h3_regex - # pop the last entry from the headers array if we are in an H3 and found a new H3 - headers.pop - end - - # push the new header text to the headers array - headers << headertext if line =~ h1_regex || line =~ h2_regex || line =~ h3_regex - else - # Else if we are in regular text... - - # This else block is new logic compared to original Python code - - # Sanity check for state machine - raise 'Unexpected state encountered when parsing examples' unless state == REGULAR_TEXT - - # no-op - skips any other non-header regular text lines - end - end - # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/AbcSize - - tests - end - end -end - -# Original `get_tests` method from spec_test.py: -# rubocop:disable Style/BlockComments -# rubocop:disable Style/AsciiComments -=begin -def get_tests(specfile): - line_number = 0 - start_line = 0 - end_line = 0 - example_number = 0 - markdown_lines = [] - html_lines = [] - state = 0 # 0 regular text, 1 markdown example, 2 html output - extensions = [] - headertext = '' - tests = [] - - header_re = re.compile('#+ ') - - with open(specfile, 'r', encoding='utf-8', newline='\n') as specf: - for line in specf: - line_number = line_number + 1 - l = line.strip() - if l.startswith("`" * 32 + " example"): - state = 1 - extensions = l[32 + len(" example"):].split() - elif l == "`" * 32: - state = 0 - example_number = example_number + 1 - end_line = line_number - if 'disabled' not in extensions: - tests.append({ - "markdown":''.join(markdown_lines).replace('→',"\t"), - "html":''.join(html_lines).replace('→',"\t"), - "example": example_number, - "start_line": start_line, - "end_line": end_line, - "section": headertext, - "extensions": extensions}) - start_line = 0 - markdown_lines = [] - html_lines = [] - elif l == ".": - state = 2 - elif state == 1: - if start_line == 0: - start_line = line_number - 1 - markdown_lines.append(line) - elif state == 2: - html_lines.append(line) - elif state == 0 and re.match(header_re, line): - headertext = header_re.sub('', line).strip() - return tests - -=end -# rubocop:enable Style/BlockComments -# rubocop:enable Style/AsciiComments diff --git a/scripts/lib/glfm/render_static_html.rb b/scripts/lib/glfm/render_static_html.rb deleted file mode 100644 index ef2dc071c38f76cd6d6a703ea0fa384c0f93d305..0000000000000000000000000000000000000000 --- a/scripts/lib/glfm/render_static_html.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_relative 'constants' -require_relative 'shared' - -# Purpose: -# - Reads a set of markdown examples from a hash which has been serialized to disk -# - Sets up the appropriate fixture data for the markdown examples -# - Converts each example to static HTML using the appropriate API markdown endpoint -# - Writes the HTML for each example to a hash which is serialized to disk -# -# Requirements: -# The input and output files are specified via these environment variables: -# - INPUT_MARKDOWN_YML_PATH -# - OUTPUT_STATIC_HTML_TEMPFILE_PATH -# -# Although it is implemented as an RSpec test, it is not a unit test. We use -# RSpec because that is the simplest environment in which we can use the -# Factorybot factory methods to create persisted model objects with stable -# and consistent data values, to ensure consistent example snapshot HTML -# across various machines and environments. RSpec also makes it easy to invoke -# the API and obtain the response. -# -# It is intended to be invoked as a helper subprocess from the `update_example_snapshots.rb` -# and `update_specification.rb` script classes. It's not intended to be run or used directly. -# This usage is also reinforced by not naming the file with a `_spec.rb` ending. -RSpec.describe 'Render Static HTML', :api, type: :request do - include Glfm::Constants - include Glfm::Shared - - include_context 'with GLFM example snapshot fixtures' - - it do - markdown_hash = YAML.safe_load(File.open(ENV.fetch('INPUT_MARKDOWN_YML_PATH')), symbolize_names: true) - metadata_hash = - if input_metadata_yml_path = ENV['INPUT_METADATA_YML_PATH'] - YAML.safe_load(File.open(input_metadata_yml_path), symbolize_names: true) || {} - else - {} - end - - # NOTE: We cannot parallelize this loop like the Javascript WYSIWYG example generation does, - # because the rspec `post` API cannot be parallized (it is not thread-safe, it can't find - # the controller). - static_html_hash = markdown_hash.transform_values.with_index do |markdown, index| - name = markdown_hash.keys[index] - api_url = metadata_hash.dig(name, :api_request_override_path) || (api "/markdown") - - post api_url, params: { text: markdown, gfm: true } - expect(response).to be_successful - - returned_html_value = - begin - parsed_response = Gitlab::Json.parse(response.body, symbolize_names: true) - # Some responses have the HTML in the `html` key, others in the `body` key. - parsed_response[:body] || parsed_response[:html] - rescue JSON::ParserError - # if we got a parsing error, just return the raw response body for debugging purposes. - response.body - end - - returned_html_value - end - - write_output_file(static_html_hash) - end - - private - - def write_output_file(static_html_hash) - yaml_string = dump_yaml_with_formatting(static_html_hash) - write_file(ENV.fetch('OUTPUT_STATIC_HTML_TEMPFILE_PATH'), yaml_string) - end -end diff --git a/scripts/lib/glfm/shared.rb b/scripts/lib/glfm/shared.rb deleted file mode 100644 index a17f4b30271564ee6f219a7fbe65d42a7a4c8fc3..0000000000000000000000000000000000000000 --- a/scripts/lib/glfm/shared.rb +++ /dev/null @@ -1,77 +0,0 @@ -# frozen_string_literal: true -require 'fileutils' -require 'open3' -require 'active_support/core_ext/hash/keys' - -# This module contains shared methods used by other GLFM scripts and modules. -module Glfm - module Shared - def write_file(file_path, file_content_string) - FileUtils.mkdir_p(File.dirname(file_path)) - # NOTE: We don't use the block form of File.open because we want to be able to easily - # mock it for testing. - io = File.open(file_path, 'w') - io.binmode - io.write(file_content_string) - # NOTE: We are using #fsync + #close_write instead of just #close`, in order to unit test - # with a real StringIO and not just a mock object. - io.fsync - io.close_write - end - - # All script output goes through this method. This makes it easy to mock in order to prevent - # output from being printed to the console during tests. We don't want to directly mock - # Kernel#puts, because that could interfere or cause spurious test failures when #puts is used - # for debugging. And for some reason RuboCop says `rubocop:disable Rails/Output` would be - # redundant here, so not including it. - def output(string) - puts string - end - - def run_external_cmd(cmd) - rails_root = File.expand_path('../../../', __dir__) - - # See https://stackoverflow.com/a/20001569/25192 - stdout_and_stderr_str, status = Open3.capture2e(cmd, chdir: rails_root) - - return stdout_and_stderr_str if status.success? - - warn("Error running command `#{cmd}`\n") - warn(stdout_and_stderr_str) - raise - end - - # Construct an AST so we can control YAML formatting for - # YAML block scalar literals and key quoting. - # - # Note that when Psych dumps the markdown to YAML, it will - # automatically use the default "clip" behavior of the Block Chomping Indicator (`|`) - # https://yaml.org/spec/1.2.2/#8112-block-chomping-indicator, - # when the markdown strings contain a trailing newline. The type of - # Block Chomping Indicator is automatically determined, you cannot specify it - # manually. - def dump_yaml_with_formatting(hash, literal_scalars: false) - stringified_keys_hash = hash.deep_stringify_keys - visitor = Psych::Visitors::YAMLTree.create - visitor << stringified_keys_hash - ast = visitor.tree - - # Force all scalars to have literal formatting (using Block Chomping Indicator instead of quotes) - if literal_scalars - ast.grep(Psych::Nodes::Scalar).each do |node| - node.style = Psych::Nodes::Scalar::LITERAL - end - end - - # Do not quote the keys - ast.grep(Psych::Nodes::Mapping).each do |node| - node.children.each_slice(2) do |k, _| - k.quoted = false - k.style = Psych::Nodes::Scalar::PLAIN - end - end - - ast.to_yaml - end - end -end diff --git a/scripts/lib/glfm/specification_html_template.erb b/scripts/lib/glfm/specification_html_template.erb deleted file mode 100644 index f75cb4002294286d049c0cd3f0c8de7029c0c818..0000000000000000000000000000000000000000 --- a/scripts/lib/glfm/specification_html_template.erb +++ /dev/null @@ -1,244 +0,0 @@ -<!DOCTYPE html> -<!-- NOTE: Styling is based on the CommonMark specification template: --> -<!-- - https://github.com/commonmark/commonmark-spec/blob/master/tools/make_spec.lua --> -<!-- - https://github.com/commonmark/commonmark-spec/blob/master/tools/template.html --> -<!-- --> -<!-- NOTE: 'TODO:' comments will be followed up as task(s) on this issue: --> -<!-- - https://gitlab.com/gitlab-org/gitlab/-/issues/361241 --> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <title><%= title %></title> - <style type="text/css"> - body { - font-family: Helvetica, arial, freesans, clean, sans-serif; - line-height: 1.4; - max-width: 48em; - margin: auto; - padding: 0 0.5em 4em; - color: #333333; - background-color: #ffffff; - font-size: 13pt; - } - - div#TOC ul { list-style: none; } - h1 { - font-size: 140%; - font-weight: bold; - border-top: 1px solid gray; - padding-top: 0.5em; - } - - h2 { - font-size: 120%; - font-weight: bold; - } - - h3 { - font-size: 110%; - font-weight: bold; - } - - h4 { - font-size: 100%; - font-weight: bold; - } - - /* NOTE: "font-weight: bold" was applied to "a.definition" class in original CommonMark */ - /* template, but in practice it was applied to all anchors */ - a { - font-weight: bold; - } - - - /* TODO: Format whitespace in examples. This will require preprocessing to insert spans around them. */ - /*span.space { position: relative; }*/ - /*span.space:after {*/ - /* content: "·";*/ - /* position: absolute;*/ - /* !* create a mark that indicates a space (trick from D. Greenspan) *!*/ - /* top: 0; bottom: 7px; left: 1px; right: 1px;*/ - /* color: #aaaaaa;*/ - /*}*/ - /*@media print {*/ - /* a.dingus { display: none; }*/ - /*}*/ - - div.example { - overflow: hidden; - } - - p { - text-align: justify; - } - - pre { - padding: 0.5em; - margin: 0.2em 0 0.5em; - font-size: 88%; - } - - pre { - white-space: pre-wrap; /* css-3 */ - white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ - white-space: -o-pre-wrap; /* Opera 7 */ - word-wrap: break-word; /* Internet Explorer 5.5+ */ - } - - code { - font-family: monospace; - background-color: #d3e1e4; - } - - pre > code { - background-color: transparent; - } - - .example { - font-size: 0; /* hack to get width: 50% to work on inline-block */ - padding-bottom: 6pt; - } - - .column pre { - font-size: 11pt; - padding: 2pt 6pt; - } - - div.examplenum { - font-size: 11pt; - text-align: left; - margin-bottom: 10px; - } - - div.column { - display: inline-block; - width: 50%; - vertical-align: top; - } - - div.example > div:nth-child(2) { - clear: left; - background-color: #d3e1e4; - } - - div.example > div:nth-child(3) { - clear: right; - background-color: #c9cace; - } - - @media print { - @page { - size: auto; - margin: 1.2in 1.2in 1.2in 1.2in; - } - - body { - margin: 0; - line-height: 1.2; - font-size: 10pt; - } - - .column pre { - font-size: 9pt; - } - - div.examplenum { - font-size: 9pt; - } - } - </style> - <!-- TODO: Extract this javascript out to a separate file and unit test it --> - <script type="text/javascript"> - /* NOTE: The following code performs many of the pre-processing steps originally handled */ - /* in https://github.com/commonmark/commonmark-spec/blob/master/tools/make_spec.lua */ - - /* Adds a div.example wrapper around each pair of example code blocks. */ - function addAttributesToExampleWrapperDivs() { - const exampleAnchorTags = document.querySelectorAll("a[href^=\"#example-\"]"); - for (const exampleAnchorTag of exampleAnchorTags) { - const examplenumDiv = exampleAnchorTag.parentElement; - examplenumDiv.classList.add("examplenum"); - const exampleDiv = examplenumDiv.parentElement; - exampleDiv.classList.add("example"); - exampleDiv.id = exampleAnchorTag.getAttribute("href").substring(1); - } - } - - function addColumnClassToMarkdownDivs() { - const markdownCodeBlockDivs = document.querySelectorAll("div.markdown-code-block"); - for (const markdownCodeBlockDiv of markdownCodeBlockDivs) { - markdownCodeBlockDiv.classList.add("column"); - } - } - - function addNumbersToHeaders() { - const headers = document.querySelectorAll('h1,h2,h3'); - let h1Index = -1; // NOTE: -1 because we don't assign a number to the title - let h2Index = 0; - let h3Index = 0; - const tocEntries = []; - for (const header of headers) { - if (h1Index === -1) { - h1Index++; - continue; - } - - const originalHeaderTextContent = header.textContent.trim(); - const headerAnchor = originalHeaderTextContent.toLowerCase().replaceAll(' ', '-'); - header.id = headerAnchor; - let indent; - let headerTextContent; - if (header.tagName === 'H1') { - h1Index++; - h2Index = 0; - h3Index = 0; - header.textContent = headerTextContent = h1Index + ' ' + originalHeaderTextContent; - indent = 0; - } else if (header.tagName === 'H2') { - h2Index++; - h3Index = 0; - header.textContent = - headerTextContent = h1Index + '.' + h2Index + ' ' + originalHeaderTextContent; - indent = 1; - } else if (header.tagName === 'H3') { - h3Index++; - header.textContent = headerTextContent = - h1Index + '.' + h2Index + '.' + h3Index + ' ' + originalHeaderTextContent; - indent = 2; - } - tocEntries.push({headerAnchor, headerTextContent, indent}); - } - } - - document.addEventListener("DOMContentLoaded", function(_event) { - addAttributesToExampleWrapperDivs(); - addColumnClassToMarkdownDivs(); - const tocEntries = addNumbersToHeaders(); - addToc(tocEntries); - }); - - /* NOTE: The following code is to support the "Try it" interactive "dingus", which */ - /* we do not yet support. But it is being left here for comparison context with the */ - /* original CommonMark template. */ - // $$(document).ready(function() { - // $$("div.example").each(function(e) { - // var t = $$(this).find('code.language-markdown').text(); - // $$(this).find('a.dingus').click(function(f) { - // window.open('/dingus/?text=' + - // encodeURIComponent(t.replace(/→/g,"\t"))); - // }); - // }); - // $$("code.language-markdown").dblclick(function(e) { window.open('/dingus/?text=' + - // encodeURIComponent($$(this).text())); - // }); - // }); - </script> -</head> -<body> -<h1 class="title"><%= title %></h1> -<div class="version">Version <%= version %></div> - -<%= body %> - -</body> -</html> diff --git a/scripts/lib/glfm/update_example_snapshots.rb b/scripts/lib/glfm/update_example_snapshots.rb deleted file mode 100644 index 8bbf91c6f1357a745f2e3dfe5c22d571589750dd..0000000000000000000000000000000000000000 --- a/scripts/lib/glfm/update_example_snapshots.rb +++ /dev/null @@ -1,329 +0,0 @@ -# frozen_string_literal: true -require 'fileutils' -require 'open-uri' -require 'yaml' -require 'psych' -require 'tempfile' -require 'open3' -require 'active_support/core_ext/enumerable' -require_relative 'constants' -require_relative 'shared' -require_relative 'parse_examples' - -# IMPORTANT NOTE: See https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#update-example-snapshotsrb-script -# for details on the implementation and usage of this script. This developers guide -# contains diagrams and documentation of this script, -# including explanations and examples of all files it reads and writes. -# -# Also note that this script is intentionally written in a pure-functional (not OO) style, -# with no dependencies on Rails or the GitLab libraries. These choices are intended to make -# it faster and easier to test and debug. -module Glfm - class UpdateExampleSnapshots - include Constants - include Shared - include ParseExamples - - # skip_static can be used to skip the backend html generation which depends on external - # calls. This allows for faster processing in unit tests which do not require it. - def process(skip_static: false) - output('Updating example snapshots...') - - output("Reading #{ES_SNAPSHOT_SPEC_MD_PATH}...") - es_snapshot_spec_md_lines = File.open(ES_SNAPSHOT_SPEC_MD_PATH).readlines - - # Parse all the examples from `snapshot_spec.md`, using a Ruby port of the Python `get_tests` - # function the from original CommonMark/GFM `spec_test.py` script. - all_examples = parse_examples(es_snapshot_spec_md_lines) - - add_example_names(all_examples) - - reject_disabled_examples(all_examples) - - write_snapshot_example_files(all_examples, skip_static: skip_static) - end - - private - - def add_example_names(all_examples) - # NOTE: This method and the parse_examples method assume: - # 1. Section 2 is the first section which contains examples - # 2. Examples are always nested in an H2 or an H3, never directly in an H1 - # 3. There may exist headings with no examples (e.g. "Motivation" in the GLFM spec.txt) - # 4. The Appendix doesn't ever contain any examples, so it doesn't show up - # in the H1 header count. So, even though due to the concatenation it appears before the - # GitLab examples sections, it doesn't result in their header counts being off by +1. - # 5. If an example contains the 'disabled' string extension, it is skipped (and will thus - # result in a skip in the `spec_example_position`). This behavior is taken from the - # GFM `spec_test.py` script (but it's NOT in the original CommonMark `spec_test.py`). - # 6. If a section contains ONLY disabled examples, the section numbering will still be - # incremented to match the rendered HTML specification section numbering. - # 7. Every H2 or H3 must contain at least one example, but it is allowed that they are - # all disabled. - - h1_count = 1 # examples start in H1 section 2; section 1 is the overview with no examples. - h2_count = 0 - h3_count = 0 - previous_h1 = '' - previous_h2 = '' - previous_h3 = '' - index_within_current_heading = 0 - all_examples.each do |example| - headers = example[:headers] - - if headers[0] != previous_h1 - h1_count += 1 - h2_count = 0 - h3_count = 0 - previous_h1 = headers[0] - end - - if headers[1] != previous_h2 - h2_count += 1 - h3_count = 0 - previous_h2 = headers[1] - index_within_current_heading = 0 - end - - if headers[2] && headers[2] != previous_h3 - h3_count += 1 - previous_h3 = headers[2] - index_within_current_heading = 0 - end - - index_within_current_heading += 1 - - # convert headers array to lowercase string with underscores, and double underscores between headers - formatted_headers_text = headers.join('__').tr('-', '_').tr(' ', '_').downcase - - hierarchy_level = - "#{h1_count.to_s.rjust(2, '0')}_" \ - "#{h2_count.to_s.rjust(2, '0')}_" \ - "#{h3_count.to_s.rjust(2, '0')}" - position_within_section = index_within_current_heading.to_s.rjust(3, '0') - name = "#{hierarchy_level}__#{formatted_headers_text}__#{position_within_section}" - converted_name = name.tr('(', '').tr(')', '') # remove any parens from the name - example[:name] = converted_name - end - end - - def reject_disabled_examples(all_examples) - all_examples.reject! { |example| example[:disabled] } - end - - def write_snapshot_example_files(all_examples, skip_static: false) - output("Reading #{GLFM_EXAMPLE_STATUS_YML_PATH}...") - glfm_examples_statuses = YAML.safe_load(File.open(GLFM_EXAMPLE_STATUS_YML_PATH), symbolize_names: true) || {} - validate_glfm_example_status_yml(glfm_examples_statuses) - - write_examples_index_yml(all_examples) - - validate_glfm_config_file_example_names(all_examples) - - write_markdown_yml(all_examples) - - if skip_static - output("Skipping static HTML generation...") - return - end - - # NOTE: We pass the INPUT_MARKDOWN_YML_PATH and INPUT_METADATA_YML_PATH via - # environment variables to the static/wysiwyg HTML generation scripts. This is because they - # are implemented as subprocesses which invoke rspec/jest scripts, and rspec/jest do not make - # it straightforward to pass arguments via the command line. - ENV['INPUT_MARKDOWN_YML_PATH'], ENV['INPUT_METADATA_YML_PATH'] = copy_tempfiles_for_subprocesses - static_html_hash = generate_static_html - - write_html_yml(all_examples, static_html_hash, glfm_examples_statuses) - end - - def validate_glfm_example_status_yml(glfm_examples_statuses) - glfm_examples_statuses.each do |example_name, statuses| - next unless statuses && - statuses[:skip_update_example_snapshots] && - statuses.any? { |key, value| key.to_s.include?('skip_update_example_snapshot_') && !!value } - - raise "Error: '#{example_name}' must not have any 'skip_update_example_snapshot_*' values specified " \ - "if 'skip_update_example_snapshots' is truthy" - end - end - - def validate_glfm_config_file_example_names(all_examples) - valid_example_names = all_examples.pluck(:name).map(&:to_sym) # rubocop:disable CodeReuse/ActiveRecord - - # We are re-reading GLFM_EXAMPLE_STATUS_YML_PATH here, but that's OK, it's a small file, and rereading it - # allows us to handle it in the same loop as the other manually-curated config files. - [ - GLFM_EXAMPLE_STATUS_YML_PATH, - GLFM_EXAMPLE_METADATA_YML_PATH, - GLFM_EXAMPLE_NORMALIZATIONS_YML_PATH - ].each do |path| - output("Reading #{path}...") - io = File.open(path) - config_file_examples = YAML.safe_load(io, symbolize_names: true, aliases: true) - - # Skip validation if the config file is empty - next unless config_file_examples - - config_file_example_names = config_file_examples.keys - - # Validate that all example names exist in the config file refer to an existing example in `examples_index.yml`, - # unless it starts with the special prefix `00_`, which is preserved for usage as YAML anchors. - invalid_name = config_file_example_names.detect do |name| - !name.start_with?('00_') && valid_example_names.exclude?(name) - end - next unless invalid_name - - # NOTE: The extra spaces before punctuation in the error message allows for easier copy/pasting of the paths. - err_msg = - <<~TXT - - Error in input specification config file #{path} : - - Config file entry named #{invalid_name} - does not have a corresponding example entry in - #{ES_EXAMPLES_INDEX_YML_PATH} . - - Please delete or rename this config file entry. - - If this entry is being used as a YAML anchor, please rename it to start with '00_'. - TXT - raise err_msg - end - end - - def write_examples_index_yml(all_examples) - generate_and_write_for_all_examples( - all_examples, ES_EXAMPLES_INDEX_YML_PATH, literal_scalars: false - ) do |example, hash| - name = example.fetch(:name).to_sym - hash[name] = { - 'spec_example_position' => example.fetch(:example), - 'source_specification' => source_specification_for_extensions(example.fetch(:extensions)) - } - end - end - - def source_specification_for_extensions(extensions) - unprocessed_extensions = extensions.map(&:to_sym) - unprocessed_extensions.delete(:disabled) - - source_specification = - if unprocessed_extensions.empty? - 'commonmark' - elsif unprocessed_extensions.include?(:gitlab) - unprocessed_extensions.delete(:gitlab) - 'gitlab' - else - 'github' - end - - # We should only be left with at most one extension, which is an optional name for the example - raise "Error: Invalid extension(s) found: #{unprocessed_extensions.join(', ')}" if unprocessed_extensions.size > 1 - - source_specification - end - - def write_markdown_yml(all_examples) - generate_and_write_for_all_examples(all_examples, ES_MARKDOWN_YML_PATH) do |example, hash| - name = example.fetch(:name).to_sym - hash[name] = example.fetch(:markdown) - end - end - - def copy_tempfiles_for_subprocesses - # NOTE: We must copy the input YAML files used by the `render_static_html.rb` - # and `render_wysiwyg_html_and_json.js` scripts to a separate temporary file in order for - # the scripts to read them, because the scripts are run in - # separate subprocesses, and during unit testing we are unable to substitute the mock - # StringIO when reading the input files in the subprocess. - { - ES_MARKDOWN_YML_PATH => MARKDOWN_TEMPFILE_BASENAME, - GLFM_EXAMPLE_METADATA_YML_PATH => METADATA_TEMPFILE_BASENAME - }.map do |original_file_path, tempfile_basename| - Dir::Tmpname.create(tempfile_basename) do |path| - io = File.open(original_file_path) - io.seek(0) # rewind the file. This is necessary when testing with a mock StringIO - contents = io.read - write_file(path, contents) - end - end - end - - def generate_static_html - output("Generating static HTML from markdown examples...") - - # NOTE 1: We shell out to perform the conversion of markdown to static HTML by invoking a - # separate subprocess. This allows us to avoid using the Rails API or environment in this - # script, which makes developing and running the unit tests for this script much faster, - # because they can use 'fast_spec_helper' which does not require the entire Rails environment. - - # NOTE 2: We run this as an RSpec process, for the same reasons we run via Jest process below: - # because that's the easiest way to ensure a reliable, fully-configured environment in which - # to execute the markdown-processing logic. Also, in the static/backend case, Rspec - # provides the easiest and most reliable way to generate example data via Factorybot - # creation of stable model records. This ensures consistent snapshot values across - # machines/environments. - - # Dir::Tmpname.create requires a block, but we are using the non-block form to get the path - # via the return value, so we pass an empty block to avoid an error. - static_html_tempfile_path = Dir::Tmpname.create(STATIC_HTML_TEMPFILE_BASENAME) {} - ENV['OUTPUT_STATIC_HTML_TEMPFILE_PATH'] = static_html_tempfile_path - - cmd = %(bin/rspec #{__dir__}/render_static_html.rb) - run_external_cmd(cmd) - - output("Reading generated static HTML from tempfile #{static_html_tempfile_path}...") - YAML.safe_load(File.open(static_html_tempfile_path), symbolize_names: true) - end - - def write_html_yml(all_examples, static_html_hash, glfm_examples_statuses) - generate_and_write_for_all_examples( - all_examples, ES_HTML_YML_PATH, glfm_examples_statuses: glfm_examples_statuses - ) do |example, hash, existing_hash| - name = example.fetch(:name).to_sym - example_statuses = glfm_examples_statuses[name] || {} - - static = if example_statuses[:skip_update_example_snapshot_html_static] - existing_hash.dig(name, :static) - else - static_html_hash[name] - end - - hash[name] = { - 'canonical' => example.fetch(:html), - 'static' => static - }.compact # Do not assign nil values - end - end - - def generate_and_write_for_all_examples( - all_examples, output_file_path, glfm_examples_statuses: {}, literal_scalars: true - ) - preserve_existing = !glfm_examples_statuses.empty? - output("#{preserve_existing ? 'Creating/Updating' : 'Creating/Overwriting'} #{output_file_path}...") - existing_hash = preserve_existing ? YAML.safe_load(File.open(output_file_path), symbolize_names: true) : {} - - output_hash = all_examples.each_with_object({}) do |example, hash| - name = example.fetch(:name).to_sym - if (reason = glfm_examples_statuses.dig(name, :skip_update_example_snapshots)) - # Output the reason for skipping the example, but only once, not multiple times for each file - output("Skipping '#{name}'. Reason: #{reason}") unless glfm_examples_statuses.dig(name, :already_printed) - # We just store the `:already_printed` flag in the hash entry itself. Then we - # don't need an instance variable to keep the state, and this can remain a pure function ;) - glfm_examples_statuses[name][:already_printed] = true - - # Copy over the existing example only if it exists and preserve_existing is true, otherwise omit this example - hash[name] = existing_hash[name] if existing_hash[name] - - next - end - - yield(example, hash, existing_hash) - end - - yaml_string = dump_yaml_with_formatting(output_hash, literal_scalars: literal_scalars) - write_file(output_file_path, yaml_string) - end - end -end diff --git a/scripts/lib/glfm/update_specification.rb b/scripts/lib/glfm/update_specification.rb deleted file mode 100644 index 0effea833781a0063e69f9732361cde838690dc9..0000000000000000000000000000000000000000 --- a/scripts/lib/glfm/update_specification.rb +++ /dev/null @@ -1,329 +0,0 @@ -# frozen_string_literal: true -require 'erb' -require 'fileutils' -require 'open-uri' -require 'pathname' -require 'tempfile' -require 'yaml' -require_relative 'constants' -require_relative 'shared' - -# IMPORTANT NOTE: See https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#update-specificationrb-script -# for details on the implementation and usage of this script. This developers guide -# contains diagrams and documentation of this script, -# including explanations and examples of all files it reads and writes. -# -# Also note that this script is intentionally written in a pure-functional (not OO) style, -# with no dependencies on Rails or the GitLab libraries. These choices are intended to make -# it faster and easier to test and debug. -module Glfm - class UpdateSpecification - include Constants - include Shared - - def process(skip_spec_html_generation: false) - output('Updating specification...') - - # read and optionally update `input/github_flavored_markdown/ghfm_spec_v_x.yy.md` - ghfm_spec_lines = load_ghfm_spec - - # create `output_spec/spec.txt` - glfm_spec_txt_header_lines = GLFM_SPEC_TXT_HEADER.split("\n").map { |line| "#{line}\n" } - official_spec_lines = readlines_from_path!(GLFM_OFFICIAL_SPECIFICATION_MD_PATH) - glfm_spec_txt_string = (glfm_spec_txt_header_lines + official_spec_lines).join('') - write_glfm_spec_txt(glfm_spec_txt_string) - - # create `output_example_snapshots/snapshot_spec.md` - snapshot_spec_md_header_lines = ES_SNAPSHOT_SPEC_MD_HEADER.split("\n").map { |line| "#{line}\n" } - ghfm_spec_example_lines = extract_ghfm_spec_example_lines(ghfm_spec_lines) - official_spec_example_lines = - extract_glfm_spec_example_lines(official_spec_lines, GLFM_OFFICIAL_SPECIFICATION_MD_PATH) - internal_extension_lines = readlines_from_path!(GLFM_INTERNAL_EXTENSIONS_MD_PATH) - validate_internal_extensions_md(internal_extension_lines) - internal_extension_example_lines = - extract_glfm_spec_example_lines(internal_extension_lines, GLFM_INTERNAL_EXTENSIONS_MD_PATH) - - snapshot_spec_md_string = ( - snapshot_spec_md_header_lines + - ghfm_spec_example_lines + - official_spec_example_lines + - ["\n"] + - internal_extension_example_lines - ).join('') - write_snapshot_spec_md(snapshot_spec_md_string) - - # Some unit tests can skip HTML generation if they don't need it, so they run faster - if skip_spec_html_generation - output("Skipping GLFM spec.html and snapshot_spec.html generation...") - return - end - - # Use the backend markdown processing to render un-styled GLFM specification HTML files from the markdown - # We strip off the frontmatter headers before rendering. - spec_html_unstyled_string, snapshot_spec_html_unstyled_string = - generate_spec_html_files( - glfm_spec_txt_string.gsub!(GLFM_SPEC_TXT_HEADER, "[TOC]\n\n"), - snapshot_spec_md_string.gsub!(ES_SNAPSHOT_SPEC_MD_HEADER, "[TOC]\n\n"), - ghfm_spec_example_lines.join('') - ) - - # Add styling to the rendered HTML files, to make them look like the CommonMark and - # GitHub Flavored Markdown HTML-rendered specifications - spec_html_styled_string = add_styling_to_specification_html( - body: spec_html_unstyled_string, - title: GLFM_SPEC_TXT_TITLE, - version: GLFM_SPEC_VERSION - ) - snapshot_spec_html_styled_string = add_styling_to_specification_html( - body: snapshot_spec_html_unstyled_string, - title: ES_SNAPSHOT_SPEC_TITLE, - version: GLFM_SPEC_VERSION - ) - - # Write out the styled HTML GLFM specification HTML files - write_spec_html(spec_html_styled_string) - write_snapshot_spec_html(snapshot_spec_html_styled_string) - end - - private - - def load_ghfm_spec - # We only re-download the GitHub Flavored Markdown specification if the - # UPDATE_GHFM_SPEC_MD environment variable is set to true, which should only - # ever be done manually and locally, never in CI. This provides some security - # protection against a possible injection attack vector, if the GitHub-hosted - # version of the spec is ever temporarily compromised with an injection attack. - # - # This also avoids doing external network access to download the file - # in CI jobs, which can avoid potentially flaky builds if the GitHub-hosted - # version of the file is temporarily unavailable. - if ENV['UPDATE_GHFM_SPEC_MD'] == 'true' - update_ghfm_spec_md - else - read_existing_ghfm_spec_md - end - end - - def read_existing_ghfm_spec_md - output("Reading existing #{GHFM_SPEC_MD_PATH}...") - File.open(GHFM_SPEC_MD_PATH).readlines - end - - def update_ghfm_spec_md - output("Downloading #{GHFM_SPEC_TXT_URI}...") - # NOTE: We use `URI.parse` to avoid RuboCop warning "Security/Open", - # even though we are using a trusted URI from a string literal constant. - # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/98656#note_1138595002 for details. - ghfm_spec_txt_uri_parsed = URI.parse(GHFM_SPEC_TXT_URI) - ghfm_spec_txt_uri_io = ghfm_spec_txt_uri_parsed.open - - ghfm_spec_lines = readlines_from_io!(ghfm_spec_txt_uri_io, GHFM_SPEC_TXT_URI) - - # Make sure the GHFM spec version has not changed - validate_expected_spec_version!(ghfm_spec_lines[2]) - - # Reset IO stream and re-read into a single string for easy writing - ghfm_spec_txt_uri_io.seek(0) - ghfm_spec_string = ghfm_spec_txt_uri_io.read - raise "Unable to read string from #{GHFM_SPEC_TXT_URI}" unless ghfm_spec_string - - output("Writing #{GHFM_SPEC_MD_PATH}...") - GHFM_SPEC_MD_PATH.dirname.mkpath - write_file(GHFM_SPEC_MD_PATH, ghfm_spec_string) - - ghfm_spec_lines - end - - def validate_expected_spec_version!(version_line) - return if version_line =~ /\Aversion: #{GHFM_SPEC_VERSION}\Z/o - - raise "GitHub Flavored Markdown spec.txt version mismatch! " \ - "Expected 'version: #{GHFM_SPEC_VERSION}', got '#{version_line}'" - end - - def extract_ghfm_spec_example_lines(spec_lines) - # In the GHFM spec.txt format, all we have to identify the headers containing examples - # is the presence of a single initial H1 named "Introduction" before the first - # header containing examples, and the <!-- END TESTS --> comment after the last header - # containing examples. - path = GHFM_SPEC_MD_PATH - first_examples_header_index = spec_lines.index do |line| - line.start_with?('# ') && !line.start_with?(INTRODUCTION_HEADER_LINE_TEXT) - end - raise "Unable to find first examples header in #{path}" unless first_examples_header_index - - end_tests_comment_index = spec_lines.index do |line| - line.start_with?(END_TESTS_COMMENT_LINE_TEXT) - end - raise "Unable to locate 'END TESTS' comment line in #{path}" if end_tests_comment_index.nil? - - spec_lines[first_examples_header_index..(end_tests_comment_index - 1)] - end - - def extract_glfm_spec_example_lines(spec_lines, path) - # In the GLFM input markdown files (unlike the GLFM spec.txt format), we have control over - # the contents, so we can use explicit <!-- BEGIN TESTS --> and <!-- END TESTS --> - # is the presence of a single initial H1 named "Introduction" before the first - # header containing examples, and the <!-- END TESTS --> comment after the last header - # containing examples. - begin_tests_comment_line_index = spec_lines.index do |line| - line.start_with?(BEGIN_TESTS_COMMENT_LINE_TEXT) - end - raise "Unable to locate 'BEGIN TESTS' comment line in #{path}" unless begin_tests_comment_line_index - - end_tests_comment_index = spec_lines.index do |line| - line.start_with?(END_TESTS_COMMENT_LINE_TEXT) - end - raise "Unable to locate 'END TESTS' comment line in #{path}" if end_tests_comment_index.nil? - - spec_lines[(begin_tests_comment_line_index + 1)..(end_tests_comment_index - 1)] - end - - def validate_internal_extensions_md(internal_extension_lines) - first_line = internal_extension_lines[0].strip - last_line = internal_extension_lines[-1].strip - return unless first_line != BEGIN_TESTS_COMMENT_LINE_TEXT || last_line != END_TESTS_COMMENT_LINE_TEXT - - raise "Error: No content is allowed outside of the " \ - "'#{BEGIN_TESTS_COMMENT_LINE_TEXT}' and '#{END_TESTS_COMMENT_LINE_TEXT}' comments " \ - "in '#{GLFM_INTERNAL_EXTENSIONS_MD_PATH}'." - end - - def write_glfm_spec_txt(glfm_spec_txt_string) - output("Writing #{GLFM_SPEC_TXT_PATH}...") - FileUtils.mkdir_p(Pathname.new(GLFM_SPEC_TXT_PATH).dirname) - write_file(GLFM_SPEC_TXT_PATH, glfm_spec_txt_string) - end - - def write_snapshot_spec_md(snapshot_spec_md_string) - output("Writing #{ES_SNAPSHOT_SPEC_MD_PATH}...") - FileUtils.mkdir_p(Pathname.new(ES_SNAPSHOT_SPEC_MD_PATH).dirname) - write_file(ES_SNAPSHOT_SPEC_MD_PATH, snapshot_spec_md_string) - end - - def generate_spec_html_files(spec_txt_string, snapshot_spec_md_string, ghfm_spec_examples_string) - output("Generating spec.html and snapshot_spec.html from spec.txt and snapshot_spec.md markdown...") - - # NOTE: spec.txt only contains official GLFM examples, but snapshot_spec.md contains ALL examples, with the - # official GLFM examples coming _after_ the GHFM (which contains CommonMark + GHFM) examples, and the - # internal extension examples coming last. In the snapshot_spec.md, The CommonMark and GLFM examples come - # first, in order for the example numbers to match tne numbers in those separate specifications [1]. But, we - # also need for the numbering of the official examples in spec.txt to match the numbering of the official - # examples in snapshot_spec.md. Here's the ordering: - # - # spec.txt: - # 1. GLFM Official - # - # snapshot_spec.md: - # 1. GHFM (contains CommonMark + GHFM) - # 2. GLFM Official - # 3. GLFM Internal - # - # [1] Note that the example numbering in the GLFM spec.html is currently out of sync with its corresponding - # spec.txt because its rendering is out of date. This has been reported in the following issue: - # https://github.com/github/cmark-gfm/issues/288 - ghfm_spec_examples_count = ghfm_spec_examples_string.scan(EXAMPLE_BEGIN_STRING).length - - spec_txt_string_split_examples = - transform_examples_for_rendering(spec_txt_string, starting_example_number: ghfm_spec_examples_count + 1) - snapshot_spec_md_string_split_examples = transform_examples_for_rendering(snapshot_spec_md_string) - - input_markdown_yml_string = <<~MARKDOWN - --- - spec_txt: | - #{spec_txt_string_split_examples.gsub(/^/, ' ')} - snapshot_spec_md: | - #{snapshot_spec_md_string_split_examples.gsub(/^/, ' ')} - MARKDOWN - - # NOTE: We must copy the input YAML file used by the `render_static_html.rb` - # to a separate temporary file in order for the script to read them, because it is run in - # a separate subprocess, and during unit testing we are unable to substitute the mock - # StringIO when reading the input files in the subprocess. - ENV['INPUT_MARKDOWN_YML_PATH'] = Dir::Tmpname.create(MARKDOWN_TEMPFILE_BASENAME) do |path| - write_file(path, input_markdown_yml_string) - end - - # NOTE 1: We shell out to perform the conversion of markdown to static HTML by invoking a - # separate subprocess. This allows us to avoid using the Rails API or environment in this - # script, which makes developing and running the unit tests for this script much faster, - # because they can use 'fast_spec_helper' which does not require the entire Rails environment. - - # NOTE 2: We run this as an RSpec process, for the same reasons we run via Jest process below: - # because that's the easiest way to ensure a reliable, fully-configured environment in which - # to execute the markdown-processing logic. Also, in the static/backend case. - - # Dir::Tmpname.create requires a block, but we are using the non-block form to get the path - # via the return value, so we pass an empty block to avoid an error. - static_html_tempfile_path = Dir::Tmpname.create(STATIC_HTML_TEMPFILE_BASENAME) {} - ENV['OUTPUT_STATIC_HTML_TEMPFILE_PATH'] = static_html_tempfile_path - - cmd = %(bin/rspec #{__dir__}/render_static_html.rb) - run_external_cmd(cmd) - - output("Reading generated html from tempfile #{static_html_tempfile_path}...") - rendered_html_hash = YAML.safe_load(File.open(static_html_tempfile_path), symbolize_names: true) - [rendered_html_hash.fetch(:spec_txt), rendered_html_hash.fetch(:snapshot_spec_md)] - end - - # NOTE: body, title, and version are used by the ERB binding. - def add_styling_to_specification_html(body:, title:, version:) - ERB.new(File.read(File.expand_path('specification_html_template.erb', __dir__))).result(binding) - end - - def transform_examples_for_rendering(spec_md_string, starting_example_number: 1) - # This method: - # 1. Splits the single example code block which has a period between the markdown and HTML into two code blocks - # 2. Adds a wrapper div for use in styling and target for the example number named anchor. This will get the - # 'class="example" id="example-n"' attributes applied via javascript (since markdown rendering does not - # preserve classes or IDs) - # 3. Adds a div which includes the example number named anchor and text. This will get the 'class="examplenum"' - # attribute applied via javascript. - # - # NOTE: Even though they will get stripped durning markdown rendering, we will go ahead and add the class and id - # attributes here, for easier debugging and comparison to the source markdown. - example_replacement_regex = /(^#{EXAMPLE_BEGIN_STRING}.*?$(?:.|\n)*?)^\.$(\n(?:.|\n)*?^#{EXAMPLE_END_STRING}$)/mo - example_num = starting_example_number - spec_md_string.gsub(example_replacement_regex) do |_example_string| - markdown_part = ::Regexp.last_match(1) - html_part = ::Regexp.last_match(2) - example_anchor_name = "example-#{example_num}" - examplenum_div = %(<div class="examplenum"><a href="##{example_anchor_name}">Example #{example_num}</a></div>\n) - example_num += 1 - # NOTE: We need blank lines before the markdown code blocks so they will be rendered properly - %(<div class="example" id="#{example_anchor_name}">\n) + - "#{examplenum_div}\n" \ - "#{markdown_part}" \ - "#{EXAMPLE_BACKTICKS_STRING}" \ - "\n\n" \ - "#{EXAMPLE_BACKTICKS_STRING}" \ - "#{html_part}\n" \ - '</div>' - end - end - - def write_spec_html(spec_html_string) - output("Writing #{GLFM_SPEC_HTML_PATH}...") - FileUtils.mkdir_p(Pathname.new(GLFM_SPEC_HTML_PATH).dirname) - write_file(GLFM_SPEC_HTML_PATH, "#{spec_html_string}\n") - end - - def write_snapshot_spec_html(snapshot_spec_html_string) - output("Writing #{ES_SNAPSHOT_SPEC_HTML_PATH}...") - FileUtils.mkdir_p(Pathname.new(ES_SNAPSHOT_SPEC_HTML_PATH).dirname) - write_file(ES_SNAPSHOT_SPEC_HTML_PATH, "#{snapshot_spec_html_string}\n") - end - - def readlines_from_path!(path) - io = File.open(path) - readlines_from_io!(io, path) - end - - def readlines_from_io!(io, uri_or_path) - lines = io.readlines - raise "Unable to read lines from #{uri_or_path}" if lines.empty? - - lines - end - end -end diff --git a/spec/dot_gitlab_ci/rules_spec.rb b/spec/dot_gitlab_ci/rules_spec.rb index c5e26b27f80ada5c37cfce47ae61358e9057c9d3..0a3a159f97b12a4b5b5182b3f8a4c03c83ca6205 100644 --- a/spec/dot_gitlab_ci/rules_spec.rb +++ b/spec/dot_gitlab_ci/rules_spec.rb @@ -253,7 +253,6 @@ Dir.glob('*.md') + Dir.glob('changelogs/*') + Dir.glob('doc/.{markdownlint,vale}/**/*', File::FNM_DOTMATCH) + - Dir.glob('glfm_specification/**/*') + Dir.glob('node_modules/**/*', File::FNM_DOTMATCH) + Dir.glob('patches/*') + Dir.glob('public/assets/**/.*') + diff --git a/spec/scripts/lib/glfm/parse_examples_spec.rb b/spec/scripts/lib/glfm/parse_examples_spec.rb deleted file mode 100644 index a1ee6b3f440ebec2385859ba4af0b4e161f64ab3..0000000000000000000000000000000000000000 --- a/spec/scripts/lib/glfm/parse_examples_spec.rb +++ /dev/null @@ -1,331 +0,0 @@ -# frozen_string_literal: true -require 'fast_spec_helper' -require_relative '../../../../scripts/lib/glfm/parse_examples' - -RSpec.describe Glfm::ParseExamples, '#parse_examples' do - subject do - described_module = described_class - Class.new { include described_module }.new - end - - let(:spec_txt_contents) do - <<~MARKDOWN - --- - title: Spec - ... - - # Introduction - - intro - - # 1.0.0 H1 - - ## 1.1.0 H2 - - no extension - - ```````````````````````````````` example - example 1 md - . - html - ```````````````````````````````` - - one extension - - ```````````````````````````````` example extension_1.1.0-1 - example 2 md - . - html - ```````````````````````````````` - - ### 1.1.1 H3 with no examples - - text - - ### 1.1.2 Consecutive H3 with example - - text - - ```````````````````````````````` example disabled - example 3 md - . - html - ```````````````````````````````` - - ## 1.2.0 H2 with all disabled examples - - - ```````````````````````````````` example disabled - example 4 md - . - html - ```````````````````````````````` - - ## 1.2.0 New H2 - - - ```````````````````````````````` example extension_1.2.0-1 - example 5 md - . - html - ```````````````````````````````` - - # 2.0.0 New H1 - - ## 2.1.0 H2 - - ```````````````````````````````` example gitlab - example 6 md - . - html - ```````````````````````````````` - - ## 2.2.0 H2 which contains an H3 - - No example here, just text - - ### 2.2.1 H3 - - The CommonMark and GHFM specifications don't have any examples inside an H3, but it is - supported for the GLFM specification. - - ```````````````````````````````` example extension_2.2.1-1 - example 7 md - . - html - ```````````````````````````````` - - # 3.0.0 New H1 - - ## 3.1.0 H2 - - ```````````````````````````````` example - example 8 md - . - html - ```````````````````````````````` - - ### 3.1.1 H3 - - ```````````````````````````````` example - example 9 md - . - html - ```````````````````````````````` - - ### 3.1.1 Consecutive H3 - - ```````````````````````````````` example - example 10 md - . - html - ```````````````````````````````` - - ## 3.2.0 Another H2 - - ```````````````````````````````` example - example 11 md - . - html - ```````````````````````````````` - - <!-- END TESTS --> - - # Appendix - - Appendix text. - MARKDOWN - end - - let(:spec_txt_lines) { spec_txt_contents.split("\n") } - - describe "parsing" do - it 'correctly parses' do - examples = subject.parse_examples(spec_txt_lines) - - expected = - [ - { - disabled: false, - end_line: 19, - example: 1, - extensions: [], - headers: [ - '1.0.0 H1', - '1.1.0 H2' - ], - html: 'html', - markdown: 'example 1 md', - section: '1.1.0 H2', - start_line: 15 - }, - { - disabled: false, - end_line: 27, - example: 2, - extensions: %w[extension_1.1.0-1], - headers: [ - '1.0.0 H1', - '1.1.0 H2' - ], - html: 'html', - markdown: 'example 2 md', - section: '1.1.0 H2', - start_line: 23 - }, - { - disabled: true, - end_line: 41, - example: 3, - extensions: %w[disabled], - headers: [ - '1.0.0 H1', - '1.1.0 H2', - '1.1.2 Consecutive H3 with example' - ], - html: 'html', - markdown: 'example 3 md', - section: '1.1.2 Consecutive H3 with example', - start_line: 37 - }, - { - disabled: true, - end_line: 50, - example: 4, - extensions: %w[disabled], - headers: [ - '1.0.0 H1', - '1.2.0 H2 with all disabled examples' - ], - html: 'html', - markdown: 'example 4 md', - section: '1.2.0 H2 with all disabled examples', - start_line: 46 - }, - { - disabled: false, - end_line: 59, - example: 5, - extensions: %w[extension_1.2.0-1], - headers: [ - '1.0.0 H1', - '1.2.0 New H2' - ], - html: 'html', - markdown: 'example 5 md', - section: '1.2.0 New H2', - start_line: 55 - }, - { - disabled: false, - end_line: 69, - example: 6, - extensions: %w[gitlab], - headers: [ - '2.0.0 New H1', - '2.1.0 H2' - ], - html: 'html', - markdown: 'example 6 md', - section: '2.1.0 H2', - start_line: 65 - }, - { - disabled: false, - end_line: 84, - example: 7, - extensions: %w[extension_2.2.1-1], - headers: [ - '2.0.0 New H1', - '2.2.0 H2 which contains an H3', - '2.2.1 H3' - ], - html: 'html', - markdown: 'example 7 md', - section: '2.2.1 H3', - start_line: 80 - }, - { - disabled: false, - end_line: 94, - example: 8, - extensions: [], - headers: [ - '3.0.0 New H1', - '3.1.0 H2' - ], - html: 'html', - markdown: 'example 8 md', - section: '3.1.0 H2', - start_line: 90 - }, - { - disabled: false, - end_line: 102, - example: 9, - extensions: [], - headers: [ - '3.0.0 New H1', - '3.1.0 H2', - '3.1.1 H3' - ], - html: 'html', - markdown: 'example 9 md', - section: '3.1.1 H3', - start_line: 98 - }, - { - disabled: false, - end_line: 110, - example: 10, - extensions: [], - headers: [ - '3.0.0 New H1', - '3.1.0 H2', - '3.1.1 Consecutive H3' - ], - html: 'html', - markdown: 'example 10 md', - section: '3.1.1 Consecutive H3', - start_line: 106 - }, - { - disabled: false, - end_line: 118, - example: 11, - extensions: [], - headers: [ - '3.0.0 New H1', - '3.2.0 Another H2' - ], - html: 'html', - markdown: 'example 11 md', - section: '3.2.0 Another H2', - start_line: 114 - } - ] - - expect(examples).to eq(expected) - end - end - - describe "with incorrect header nesting" do - let(:spec_txt_contents) do - <<~MARKDOWN - --- - title: Spec - ... - - # H1 - - ### H3 - - MARKDOWN - end - - it "raises if H3 is nested directly in H1" do - expect { subject.parse_examples(spec_txt_lines) } - .to raise_error(/The H3 'H3' may not be nested directly within the H1 'H1'/) - end - end -end diff --git a/spec/scripts/lib/glfm/shared_spec.rb b/spec/scripts/lib/glfm/shared_spec.rb deleted file mode 100644 index d407bd49d75ff97bb6e14d957b723a7b850c0b82..0000000000000000000000000000000000000000 --- a/spec/scripts/lib/glfm/shared_spec.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true -require 'fast_spec_helper' -require 'tmpdir' -require_relative '../../../../scripts/lib/glfm/shared' - -RSpec.describe Glfm::Shared, feature_category: :team_planning do - let(:instance) do - Class.new do - include Glfm::Shared - end.new - end - - describe '#write_file' do - it 'creates the file' do - filename = Dir::Tmpname.create('basename') do |path| - instance.write_file(path, 'test') - end - - expect(File.read(filename)).to eq 'test' - end - end - - describe '#run_external_cmd' do - it 'runs the external command' do - expect(instance.run_external_cmd('echo "hello"')).to eq("hello\n") - end - - context 'when command fails' do - it 'raises error' do - invalid_cmd = 'ls nonexistent_file' - expect(instance).to receive(:warn).with(/Error running command `#{invalid_cmd}`/) - expect(instance).to receive(:warn).with(/nonexistent_file.*no such file/i) - expect { instance.run_external_cmd(invalid_cmd) }.to raise_error(RuntimeError) - end - end - end - - describe '#dump_yaml_with_formatting' do - it 'returns formatted yaml' do - hash = { a: 'b' } - yaml = instance.dump_yaml_with_formatting(hash, literal_scalars: true) - expect(yaml).to eq("---\na: |-\n b\n") - end - end - - describe '#output' do - # NOTE: The #output method is normally always mocked, to prevent output while the specs are - # running. However, in order to provide code coverage for the method, we have to invoke - # it at least once. - it 'has code coverage' do - allow(instance).to receive(:puts) - instance.output('') - end - end -end diff --git a/spec/scripts/lib/glfm/update_example_snapshots_spec.rb b/spec/scripts/lib/glfm/update_example_snapshots_spec.rb deleted file mode 100644 index bba64a7fee37054a211e8be607e1eba09992aa47..0000000000000000000000000000000000000000 --- a/spec/scripts/lib/glfm/update_example_snapshots_spec.rb +++ /dev/null @@ -1,611 +0,0 @@ -# frozen_string_literal: true -require 'fast_spec_helper' -require_relative '../../../../scripts/lib/glfm/update_example_snapshots' - -# IMPORTANT NOTE: See https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#update-example-snapshotsrb-script -# for details on the implementation and usage of the `update_example_snapshots.rb` script being tested. -# This developers guide contains diagrams and documentation of the script, -# including explanations and examples of all files it reads and writes. -# -# Note that this test is not structured in a traditional way, with multiple examples -# to cover all different scenarios. Instead, the content of the stubbed test fixture -# files are crafted to cover multiple scenarios with in a single example run. -# -# This is because the invocation of the full script is slow, because it executes -# two subshells for processing, one which runs a full Rails environment, and one -# which runs a jest test environment. This results in each full run of the script -# taking between 30-60 seconds. The majority of this is spent loading the Rails environment. -# -# However, only the `with full processing of static and WYSIWYG HTML` context is used -# to test these slow sub-processes, and it only contains two examples. -# -# All other tests currently in the file pass the `skip_static: true` -# flag to `#process`, which skips the slow sub-processes. All of these other tests -# should run in sub-second time when the Spring pre-loader is used. This allows -# logic which is not directly related to the slow sub-processes to be TDD'd with a -# very rapid feedback cycle. -# -# Also, the textual content of the individual fixture file entries is also crafted to help -# indicate which scenarios which they are covering. -# rubocop:disable RSpec/MultipleMemoizedHelpers -RSpec.describe Glfm::UpdateExampleSnapshots, '#process', :uses_fast_spec_helper_but_runs_slow, feature_category: :team_planning do - subject { described_class.new } - - # GLFM input files - let(:es_snapshot_spec_md_path) { described_class::ES_SNAPSHOT_SPEC_MD_PATH } - let(:es_snapshot_spec_md_local_io) { StringIO.new(es_snapshot_spec_md_contents) } - let(:glfm_example_status_yml_path) { described_class::GLFM_EXAMPLE_STATUS_YML_PATH } - let(:glfm_example_metadata_yml_path) { described_class::GLFM_EXAMPLE_METADATA_YML_PATH } - let(:glfm_example_normalizations_yml_path) { described_class::GLFM_EXAMPLE_NORMALIZATIONS_YML_PATH } - - # Example Snapshot (ES) output files - let(:es_examples_index_yml_path) { described_class::ES_EXAMPLES_INDEX_YML_PATH } - let(:es_examples_index_yml_io) { StringIO.new } - let(:es_markdown_yml_path) { described_class::ES_MARKDOWN_YML_PATH } - let(:es_markdown_yml_io) { StringIO.new } - let(:es_html_yml_path) { described_class::ES_HTML_YML_PATH } - let(:es_html_yml_io_existing) { StringIO.new(es_html_yml_io_existing_contents) } - let(:es_html_yml_io) { StringIO.new } - - # Internal tempfiles - let(:static_html_tempfile_path) { Tempfile.new.path } - - let(:es_snapshot_spec_md_contents) do - <<~MARKDOWN - --- - title: GitLab Flavored Markdown Spec - ... - # Inlines - - ## Strong - - This example doesn't have an extension after the `example` keyword, so its - `source_specification` will be `commonmark`. - - ```````````````````````````````` example - __bold__ - . - <p><strong>bold</strong></p> - ```````````````````````````````` - - This example has an extension after the `example` keyword, so its - `source_specification` will be `github`. - - ```````````````````````````````` example some_extension_name - __bold with more text__ - . - <p><strong>bold with more text</strong></p> - ```````````````````````````````` - - <div class="extension"> - - ### Motivation - - This is a third-level heading with no examples, as exists in the actual GHFM - specification. It exists to drive a fix for a bug where this caused the - indexing and ordering to in examples_index.yml to be incorrect. - - ### Another H3 - - This is a second consecutive third-level heading. It exists to drive full code coverage - for this scenario, although it doesn't (yet) exist in the actual snapshot_spec.md. - - ## An H2 with all disabled examples - - In the GHFM specification, the 'Task list items (extension)' contains only "disabled" - examples, which are ignored by the GitHub fork of `spec_test.py`, and thus not part of the - Markdown conformance tests, but are part of the HTML-rendered version of the specification. - We also exclude them from our GLFM specification for consistency, but we may add - GitLab-specific examples for the behavior instead. - - ```````````````````````````````` example disabled - this example is disabled during conformance testing - . - <p>this example is disabled during conformance testing</p> - ```````````````````````````````` - - ## Strikethrough (extension) - - GFM enables the `strikethrough` extension. - - ```````````````````````````````` example strikethrough - ~~Hi~~ Hello, world! - . - <p><del>Hi</del> Hello, world!</p> - ```````````````````````````````` - - </div> - - End of last GitHub examples section. - - # First GitLab-Specific Section with Examples - - ## Strong but with two asterisks - - ```````````````````````````````` example gitlab - **bold** - . - <p><strong>bold</strong></p> - ```````````````````````````````` - - ## H2 which contains an H3 - - ### Example in an H3 - - The CommonMark and GHFM specifications don't have any examples inside an H3, but it is - supported for the GLFM specification. - - ```````````````````````````````` example gitlab - Example in an H3 - . - <p>Example in an H3</p> - ```````````````````````````````` - - # Second GitLab-Specific Section with Examples - - ## Strong but with HTML - - This example has the `gitlab` keyword after the `example` keyword, so its - `source_specification` will be `gitlab`. - - - ```````````````````````````````` example gitlab - <strong> - bold - </strong> - . - <p><strong> - bold - </strong></p> - ```````````````````````````````` - - # Third GitLab-Specific Section with skipped Examples - - ## Strong but skipped - - ```````````````````````````````` example gitlab - **this example will be skipped** - . - <p><strong>this example will be skipped</strong></p> - ```````````````````````````````` - - ## Strong but manually modified and skipped - - ```````````````````````````````` example gitlab - **This example will have its manually modified static HTML, WYSIWYG HTML, and ProseMirror JSON preserved** - . - <p><strong>This example will have its manually modified static HTML, WYSIWYG HTML, and ProseMirror JSON preserved</strong></p> - ```````````````````````````````` - - # API Request Overrides - - This section contains examples which verify that all of the fixture models which are set up - in `render_static_html.rb` are correctly configured. They exercise various `preview_markdown` - endpoints via `glfm_example_metadata.yml`. - - ## Group Upload Link - - `preview_markdown` exercising `groups` API endpoint and `UploadLinkFilter`: - - ```````````````````````````````` example gitlab - [groups-test-file](/uploads/groups-test-file) - . - <p><a href="groups-test-file">groups-test-file</a></p> - ```````````````````````````````` - - ## Project Repo Link - - `preview_markdown` exercising `projects` API endpoint and `RepositoryLinkFilter`: - - ```````````````````````````````` example gitlab - [projects-test-file](projects-test-file) - . - <p><a href="projects-test-file">projects-test-file</a></p> - ```````````````````````````````` - - ## Project Snippet Ref - - `preview_markdown` exercising `projects` API endpoint and `SnippetReferenceFilter`: - - ```````````````````````````````` example gitlab - This project snippet ID reference IS filtered: $88888 - . - <p>This project snippet ID reference IS filtered: <a href="/glfm_group/glfm_project/-/snippets/88888">$88888</a> - ```````````````````````````````` - - ## Personal Snippet Ref - - `preview_markdown` exercising personal (non-project) `snippets` 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 - `SnippetReferenceFilter`, even if the ID is valid. - - ```````````````````````````````` example gitlab - This personal snippet ID reference is NOT filtered: $99999 - . - <p>This personal snippet ID reference is NOT filtered: $99999</p> - ```````````````````````````````` - - ## Project Wiki Link - - `preview_markdown` exercising project `wikis` API endpoint and `WikiLinkFilter`: - - ```````````````````````````````` example gitlab - [project-wikis-test-file](project-wikis-test-file) - . - <p><a href="project-wikis-test-file">project-wikis-test-file</a></p> - ```````````````````````````````` - MARKDOWN - end - - let(:glfm_example_status_yml_contents) do - <<~YAML - --- - 02_01_00__inlines__strong__001: - # The skip_update_example_snapshots key is present, but false, so this example is not skipped - skip_update_example_snapshots: false - 02_01_00__inlines__strong__002: - # It is OK to have an empty (nil) value for an example statuses entry, it means they will all be false. - 05_01_00__third_gitlab_specific_section_with_skipped_examples__strong_but_skipped__001: - # Always skip this example - skip_update_example_snapshots: 'skipping this example because it is very bad' - 05_02_00__third_gitlab_specific_section_with_skipped_examples__strong_but_manually_modified_and_skipped__001: - # Always skip this example, but preserve the existing manual modifications - skip_update_example_snapshots: 'skipping this example because we have manually modified it' - YAML - end - - let(:glfm_example_metadata_yml_contents) do - <<~YAML - --- - 06_01_00__api_request_overrides__group_upload_link__001: - api_request_override_path: /groups/glfm_group/-/preview_markdown - 06_02_00__api_request_overrides__project_repo_link__001: - api_request_override_path: /glfm_group/glfm_project/-/preview_markdown - 06_03_00__api_request_overrides__project_snippet_ref__001: - api_request_override_path: /glfm_group/glfm_project/-/preview_markdown - 06_04_00__api_request_overrides__personal_snippet_ref__001: - api_request_override_path: /-/snippets/preview_markdown - 06_05_00__api_request_overrides__project_wiki_link__001: - api_request_override_path: /glfm_group/glfm_project/-/wikis/new_page/preview_markdown - YAML - end - - let(:test1) { '\1\2URI_PREFIX\4' } - - let(:glfm_example_normalizations_yml_contents) do - # NOTE: This heredoc identifier must be quoted because we are using control characters in the heredoc body. - # See https://stackoverflow.com/a/73831037/25192 - <<~'YAML' - --- - # If a config file entry starts with `00_`, it will be skipped for validation that it exists in `examples_index.yml` - 00_shared: - 00_uri: &00_uri - - regex: '(href|data-src)(=")(.*?)(test-file\.(png|zip)")' - replacement: '\1\2URI_PREFIX\4' - YAML - end - - let(:es_html_yml_io_existing_contents) do - <<~YAML - --- - 01_00_00__obsolete_entry_to_be_deleted__001: - canonical: | - This entry is no longer exists in the snapshot_spec.md, so it will be deleted. - static: |- - This entry is no longer exists in the snapshot_spec.md, so it will be deleted. - 02_01_00__inlines__strong__001: - canonical: | - This entry is existing, but not skipped, so it will be overwritten. - static: |- - This entry is existing, but not skipped, so it will be overwritten. - 05_02_00__third_gitlab_specific_section_with_skipped_examples__strong_but_manually_modified_and_skipped__001: - canonical: | - <p><strong>This example will have its manually modified static HTML, WYSIWYG HTML, and ProseMirror JSON preserved</strong></p> - static: |- - <p>This is the manually modified static HTML which will be preserved</p> - YAML - end - - before do - # We mock out the URI and local file IO objects with real StringIO, instead of just mock - # objects. This gives better and more realistic coverage, while still avoiding - # actual network and filesystem I/O during the spec run. - - # input files - allow(File).to receive(:open).with(es_snapshot_spec_md_path) { es_snapshot_spec_md_local_io } - allow(File).to receive(:open).with(glfm_example_status_yml_path) do - StringIO.new(glfm_example_status_yml_contents) - end - allow(File).to receive(:open).with(glfm_example_metadata_yml_path) do - StringIO.new(glfm_example_metadata_yml_contents) - end - allow(File).to receive(:open).with(glfm_example_normalizations_yml_path) do - StringIO.new(glfm_example_normalizations_yml_contents) - end - - # output files - allow(File).to receive(:open).with(es_examples_index_yml_path, 'w') { es_examples_index_yml_io } - - # output files which are also input files - allow(File).to receive(:open).with(es_markdown_yml_path, 'w') { es_markdown_yml_io } - allow(File).to receive(:open).with(es_markdown_yml_path) { es_markdown_yml_io } - allow(File).to receive(:open).with(es_html_yml_path, 'w') { es_html_yml_io } - allow(File).to receive(:open).with(es_html_yml_path) { es_html_yml_io_existing } - - # Allow normal opening of Tempfile files created during script execution. - tempfile_basenames = [ - described_class::MARKDOWN_TEMPFILE_BASENAME[0], - described_class::METADATA_TEMPFILE_BASENAME[0], - described_class::STATIC_HTML_TEMPFILE_BASENAME[0] - ].join('|') - # NOTE: This approach with a single regex seems to be the only way this can work. If you - # attempt to have multiple `allow...and_call_original` with `any_args`, the mocked - # parameter matching will fail to match the second one. - tempfiles_regex = /(#{tempfile_basenames})/ - allow(File).to receive(:open).with(tempfiles_regex, any_args).and_call_original - - # Prevent console output when running tests - allow(subject).to receive(:output) - end - - describe 'glfm_example_status.yml' do - describe 'when skip_update_example_snapshots entry is truthy' do - let(:es_examples_index_yml_contents) { reread_io(es_examples_index_yml_io) } - let(:es_markdown_yml_contents) { reread_io(es_markdown_yml_io) } - let(:expected_unskipped_example) do - /05_01_00__third_gitlab_specific_section_with_skipped_examples__strong_but_skipped__001/ - end - - it 'still writes the example to examples_index.yml' do - subject.process(skip_static: true) - - expect(es_examples_index_yml_contents).to match(expected_unskipped_example) - end - - it 'still writes the example to markdown.yml' do - subject.process(skip_static: true) - - expect(es_markdown_yml_contents).to match(expected_unskipped_example) - end - - describe 'when any other skip_update_example_snapshot_* is also truthy' do - let(:glfm_example_status_yml_contents) do - <<~YAML - --- - 02_01_00__inlines__strong__001: - skip_update_example_snapshots: 'if the skip_update_example_snapshots key is truthy...' - skip_update_example_snapshot_html_static: '...then no other skip_update_example_* keys can be truthy' - YAML - end - - it 'raises an error' do - expected_msg = "Error: '02_01_00__inlines__strong__001' must not have any 'skip_update_example_snapshot_*' " \ - "values specified if 'skip_update_example_snapshots' is truthy" - expect { subject.process }.to raise_error(/#{Regexp.escape(expected_msg)}/) - end - end - end - end - - describe 'writing examples_index.yml' do - let(:es_examples_index_yml_contents) { reread_io(es_examples_index_yml_io) } - let(:expected_examples_index_yml_contents) do - <<~YAML - --- - 02_01_00__inlines__strong__001: - spec_example_position: 1 - source_specification: commonmark - 02_01_00__inlines__strong__002: - spec_example_position: 2 - source_specification: github - 02_03_00__inlines__strikethrough_extension__001: - spec_example_position: 4 - source_specification: github - 03_01_00__first_gitlab_specific_section_with_examples__strong_but_with_two_asterisks__001: - spec_example_position: 5 - source_specification: gitlab - 03_02_01__first_gitlab_specific_section_with_examples__h2_which_contains_an_h3__example_in_an_h3__001: - spec_example_position: 6 - source_specification: gitlab - 04_01_00__second_gitlab_specific_section_with_examples__strong_but_with_html__001: - spec_example_position: 7 - source_specification: gitlab - 05_01_00__third_gitlab_specific_section_with_skipped_examples__strong_but_skipped__001: - spec_example_position: 8 - source_specification: gitlab - 05_02_00__third_gitlab_specific_section_with_skipped_examples__strong_but_manually_modified_and_skipped__001: - spec_example_position: 9 - source_specification: gitlab - 06_01_00__api_request_overrides__group_upload_link__001: - spec_example_position: 10 - source_specification: gitlab - 06_02_00__api_request_overrides__project_repo_link__001: - spec_example_position: 11 - source_specification: gitlab - 06_03_00__api_request_overrides__project_snippet_ref__001: - spec_example_position: 12 - source_specification: gitlab - 06_04_00__api_request_overrides__personal_snippet_ref__001: - spec_example_position: 13 - source_specification: gitlab - 06_05_00__api_request_overrides__project_wiki_link__001: - spec_example_position: 14 - source_specification: gitlab - YAML - end - - it 'writes the correct content' do - subject.process(skip_static: true) - - expect(es_examples_index_yml_contents).to eq(expected_examples_index_yml_contents) - end - end - - describe 'writing markdown.yml' do - let(:es_markdown_yml_contents) { reread_io(es_markdown_yml_io) } - let(:expected_markdown_yml_contents) do - <<~YAML - --- - 02_01_00__inlines__strong__001: | - __bold__ - 02_01_00__inlines__strong__002: | - __bold with more text__ - 02_03_00__inlines__strikethrough_extension__001: | - ~~Hi~~ Hello, world! - 03_01_00__first_gitlab_specific_section_with_examples__strong_but_with_two_asterisks__001: | - **bold** - 03_02_01__first_gitlab_specific_section_with_examples__h2_which_contains_an_h3__example_in_an_h3__001: | - Example in an H3 - 04_01_00__second_gitlab_specific_section_with_examples__strong_but_with_html__001: | - <strong> - bold - </strong> - 05_01_00__third_gitlab_specific_section_with_skipped_examples__strong_but_skipped__001: | - **this example will be skipped** - 05_02_00__third_gitlab_specific_section_with_skipped_examples__strong_but_manually_modified_and_skipped__001: | - **This example will have its manually modified static HTML, WYSIWYG HTML, and ProseMirror JSON preserved** - 06_01_00__api_request_overrides__group_upload_link__001: | - [groups-test-file](/uploads/groups-test-file) - 06_02_00__api_request_overrides__project_repo_link__001: | - [projects-test-file](projects-test-file) - 06_03_00__api_request_overrides__project_snippet_ref__001: | - This project snippet ID reference IS filtered: $88888 - 06_04_00__api_request_overrides__personal_snippet_ref__001: | - This personal snippet ID reference is NOT filtered: $99999 - 06_05_00__api_request_overrides__project_wiki_link__001: | - [project-wikis-test-file](project-wikis-test-file) - YAML - end - - it 'writes the correct content' do - subject.process(skip_static: true) - - expect(es_markdown_yml_contents).to eq(expected_markdown_yml_contents) - end - end - - context 'with full processing of static HTML' do - describe 'manually-curated input specification config files' do - let(:glfm_example_status_yml_contents) { '' } - let(:glfm_example_metadata_yml_contents) { '' } - let(:glfm_example_normalizations_yml_contents) { '' } - - it 'can be empty' do - expect { subject.process }.not_to raise_error - end - end - - describe 'writing html.yml' do - let(:es_html_yml_contents) { reread_io(es_html_yml_io) } - - # NOTE: This example_status.yml is crafted in conjunction with expected_html_yml_contents - # to test the behavior of the `skip_update_*` flags - let(:glfm_example_status_yml_contents) do - <<~YAML - --- - 02_01_00__inlines__strong__002: - # NOTE: 02_01_00__inlines__strong__002: is omitted from the existing prosemirror_json.yml file, and is also - # skipped here, to show that an example does not need to exist in order to be skipped. - # TODO: This should be changed to raise an error instead, to enforce that there cannot be orphaned - # entries in glfm_example_status.yml. This task is captured in - # https://gitlab.com/gitlab-org/gitlab/-/issues/361241#other-cleanup-tasks - skip_update_example_snapshot_prosemirror_json: "skipping because JSON isn't cool enough" - 03_01_00__first_gitlab_specific_section_with_examples__strong_but_with_two_asterisks__001: - skip_update_example_snapshot_html_static: "skipping because there's too much static" - 04_01_00__second_gitlab_specific_section_with_examples__strong_but_with_html__001: - skip_update_example_snapshot_html_wysiwyg: 'skipping because what you see is NOT what you get' - skip_update_example_snapshot_prosemirror_json: "skipping because JSON still isn't cool enough" - 05_01_00__third_gitlab_specific_section_with_skipped_examples__strong_but_skipped__001: - skip_update_example_snapshots: 'skipping this example because it is very bad' - 05_02_00__third_gitlab_specific_section_with_skipped_examples__strong_but_manually_modified_and_skipped__001: - skip_update_example_snapshots: 'skipping this example because we have manually modified it' - YAML - end - - let(:expected_html_yml_contents) do - <<~YAML - --- - 02_01_00__inlines__strong__001: - canonical: | - <p><strong>bold</strong></p> - static: |- - <p data-sourcepos="1:1-1:8" dir="auto"><strong data-sourcepos="1:1-1:8">bold</strong></p> - 02_01_00__inlines__strong__002: - canonical: | - <p><strong>bold with more text</strong></p> - static: |- - <p data-sourcepos="1:1-1:23" dir="auto"><strong data-sourcepos="1:1-1:23">bold with more text</strong></p> - 02_03_00__inlines__strikethrough_extension__001: - canonical: | - <p><del>Hi</del> Hello, world!</p> - static: |- - <p data-sourcepos="1:1-1:20" dir="auto"><del data-sourcepos="1:1-1:6">Hi</del> Hello, world!</p> - 03_01_00__first_gitlab_specific_section_with_examples__strong_but_with_two_asterisks__001: - canonical: | - <p><strong>bold</strong></p> - 03_02_01__first_gitlab_specific_section_with_examples__h2_which_contains_an_h3__example_in_an_h3__001: - canonical: | - <p>Example in an H3</p> - static: |- - <p data-sourcepos="1:1-1:16" dir="auto">Example in an H3</p> - 04_01_00__second_gitlab_specific_section_with_examples__strong_but_with_html__001: - canonical: | - <p><strong> - bold - </strong></p> - static: |- - <strong> - bold - </strong> - 05_02_00__third_gitlab_specific_section_with_skipped_examples__strong_but_manually_modified_and_skipped__001: - canonical: | - <p><strong>This example will have its manually modified static HTML, WYSIWYG HTML, and ProseMirror JSON preserved</strong></p> - static: |- - <p>This is the manually modified static HTML which will be preserved</p> - 06_01_00__api_request_overrides__group_upload_link__001: - canonical: | - <p><a href="groups-test-file">groups-test-file</a></p> - static: |- - <p data-sourcepos="1:1-1:45" dir="auto"><a data-sourcepos="1:1-1:45" href="/-/group/66666/uploads/groups-test-file" data-canonical-src="/uploads/groups-test-file" data-link="true" class="gfm">groups-test-file</a></p> - 06_02_00__api_request_overrides__project_repo_link__001: - canonical: | - <p><a href="projects-test-file">projects-test-file</a></p> - static: |- - <p data-sourcepos="1:1-1:40" dir="auto"><a data-sourcepos="1:1-1:40" href="/glfm_group/glfm_project/-/blob/master/projects-test-file" class="gfm">projects-test-file</a></p> - 06_03_00__api_request_overrides__project_snippet_ref__001: - canonical: | - <p>This project snippet ID reference IS filtered: <a href="/glfm_group/glfm_project/-/snippets/88888">$88888</a> - static: |- - <p data-sourcepos="1:1-1:53" dir="auto">This project snippet ID reference IS filtered: <a href="/glfm_group/glfm_project/-/snippets/88888" data-reference-type="snippet" data-original="$88888" data-link="false" data-link-reference="false" data-snippet="88888" data-project="77777" data-container="body" data-placement="top" title="glfm_project_snippet" class="gfm gfm-snippet has-tooltip">$88888</a></p> - 06_04_00__api_request_overrides__personal_snippet_ref__001: - canonical: | - <p>This personal snippet ID reference is NOT filtered: $99999</p> - static: |- - <p data-sourcepos="1:1-1:58" dir="auto">This personal snippet ID reference is NOT filtered: $99999</p> - 06_05_00__api_request_overrides__project_wiki_link__001: - canonical: | - <p><a href="project-wikis-test-file">project-wikis-test-file</a></p> - static: |- - <p data-sourcepos="1:1-1:50" dir="auto"><a data-sourcepos="1:1-1:50" href="/glfm_group/glfm_project/-/wikis/project-wikis-test-file" data-canonical-src="project-wikis-test-file">project-wikis-test-file</a></p> - YAML - end - - it 'writes the correct content', :unlimited_max_formatted_output_length do - # expectation that skipping message is only output once per example - expect(subject).to receive(:output).once.with(/reason.*skipping this example because it is very bad/i) - - subject.process - - expect(es_html_yml_contents).to eq(expected_html_yml_contents) - end - end - end - # rubocop:enable RSpec/MultipleMemoizedHelpers - - def reread_io(io) - # Reset the io StringIO to the beginning position of the buffer - io.seek(0) - io.read - end -end diff --git a/spec/scripts/lib/glfm/update_specification_spec.rb b/spec/scripts/lib/glfm/update_specification_spec.rb deleted file mode 100644 index 753623979f261d5062b0fd96efdcd566450d16a7..0000000000000000000000000000000000000000 --- a/spec/scripts/lib/glfm/update_specification_spec.rb +++ /dev/null @@ -1,380 +0,0 @@ -# frozen_string_literal: true - -require 'fast_spec_helper' -require 'gitlab/rspec/next_instance_of' - -require_relative '../../../../scripts/lib/glfm/update_specification' - -# IMPORTANT NOTE: See https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#update-specificationrb-script -# for details on the implementation and usage of the `update_specification.rb` script being tested. -# This developers guide contains diagrams and documentation of the script, -# including explanations and examples of all files it reads and writes. -# -# Note that this test is not structured in a traditional way, with multiple examples -# to cover all different scenarios. Instead, the content of the stubbed test fixture -# files are crafted to cover multiple scenarios with in a single example run. -# -# This is because the invocation of the full script is slow, because it executes -# a subshell for processing, which runs a full Rails environment. -# This results in each full run of the script taking between 30-60 seconds. -# The majority of this is spent loading the Rails environment. -# -# However, only the `with generation of spec.html` context is used -# to test this slow sub-process, and it only contains one example. -# -# All other tests currently in the file pass the `skip_spec_html_generation: true` -# flag to `#process`, which skips the slow sub-process. All of these other tests -# should run in sub-second time when the Spring pre-loader is used. This allows -# logic which is not directly related to the slow sub-processes to be TDD'd with a -# very rapid feedback cycle. -RSpec.describe Glfm::UpdateSpecification, '#process', :uses_fast_spec_helper_but_runs_slow, feature_category: :team_planning do - include NextInstanceOf - - subject { described_class.new } - - let(:ghfm_spec_txt_uri) { described_class::GHFM_SPEC_TXT_URI } - let(:ghfm_spec_txt_uri_parsed) { instance_double(URI::HTTPS, :ghfm_spec_txt_uri_parsed) } - let(:ghfm_spec_txt_uri_io) { StringIO.new(ghfm_spec_txt_contents) } - let(:ghfm_spec_md_path) { described_class::GHFM_SPEC_MD_PATH } - let(:ghfm_spec_txt_local_io) { StringIO.new(ghfm_spec_txt_contents) } - - let(:glfm_official_specification_md_path) { described_class::GLFM_OFFICIAL_SPECIFICATION_MD_PATH } - let(:glfm_official_specification_md_io) { StringIO.new(glfm_official_specification_md_contents) } - let(:glfm_internal_extensions_md_path) { described_class::GLFM_INTERNAL_EXTENSIONS_MD_PATH } - let(:glfm_internal_extensions_md_io) { StringIO.new(glfm_internal_extensions_md_contents) } - let(:glfm_spec_txt_path) { described_class::GLFM_SPEC_TXT_PATH } - let(:glfm_spec_txt_io) { StringIO.new } - let(:glfm_spec_html_path) { described_class::GLFM_SPEC_HTML_PATH } - let(:glfm_spec_html_io) { StringIO.new } - let(:es_snapshot_spec_md_path) { described_class::ES_SNAPSHOT_SPEC_MD_PATH } - let(:es_snapshot_spec_md_io) { StringIO.new } - let(:es_snapshot_spec_html_path) { described_class::ES_SNAPSHOT_SPEC_HTML_PATH } - let(:es_snapshot_spec_html_io) { StringIO.new } - let(:markdown_tempfile_io) { StringIO.new } - - let(:ghfm_spec_txt_examples) do - <<~MARKDOWN - # Section with examples - - ## Emphasis and strong - - ```````````````````````````````` example - _EMPHASIS LINE 1_ - _EMPHASIS LINE 2_ - . - <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. - MARKDOWN - end - - let(:ghfm_spec_txt_contents) do - <<~MARKDOWN - --- - title: GitHub Flavored Markdown Spec - version: 0.29 - date: '2019-04-06' - license: '[CC-BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)' - ... - - # Introduction - - GHFM Intro. - - #{ghfm_spec_txt_examples} - <!-- END TESTS --> - - # Appendix - - Appendix text. - MARKDOWN - end - - let(:glfm_official_specification_md_examples) do - <<~MARKDOWN - # Official Specification Section with Examples - - ```````````````````````````````` example - official example - . - <p>official example</p> - ```````````````````````````````` - - MARKDOWN - end - - let(:glfm_official_specification_md_contents) do - <<~MARKDOWN - GLFM official text before examples - - #{described_class::BEGIN_TESTS_COMMENT_LINE_TEXT} - #{glfm_official_specification_md_examples} - #{described_class::END_TESTS_COMMENT_LINE_TEXT} - - GLFM official text after examples - MARKDOWN - end - - let(:glfm_internal_extensions_md_examples) do - <<~MARKDOWN - # Internal Extension Section with Examples - - ```````````````````````````````` example - internal example - . - <p>internal extension example</p> - ```````````````````````````````` - MARKDOWN - end - - let(:glfm_internal_extensions_md_contents) do - <<~MARKDOWN - #{described_class::BEGIN_TESTS_COMMENT_LINE_TEXT} - #{glfm_internal_extensions_md_examples} - #{described_class::END_TESTS_COMMENT_LINE_TEXT} - MARKDOWN - end - - before do - # Mock default ENV var values - stub_env('UPDATE_GHFM_SPEC_MD') - - # We mock out the URI and local file IO objects with real StringIO, instead of just mock - # objects. This gives better and more realistic coverage, while still avoiding - # actual network and filesystem I/O during the spec run. - - # input files - allow(URI).to receive(:parse).with(ghfm_spec_txt_uri).and_return(ghfm_spec_txt_uri_parsed) - allow(ghfm_spec_txt_uri_parsed).to receive(:open).and_return(ghfm_spec_txt_uri_io) - allow(File).to receive(:open).with(ghfm_spec_md_path) { ghfm_spec_txt_local_io } - allow(File).to receive(:open).with(glfm_official_specification_md_path) do - glfm_official_specification_md_io - end - allow(File).to receive(:open).with(glfm_internal_extensions_md_path) do - glfm_internal_extensions_md_io - end - - # output files - allow(File).to receive(:open).with(glfm_spec_txt_path, 'w') { glfm_spec_txt_io } - allow(File).to receive(:open).with(glfm_spec_html_path, 'w') { glfm_spec_html_io } - allow(File).to receive(:open).with(es_snapshot_spec_md_path, 'w') { es_snapshot_spec_md_io } - allow(File).to receive(:open).with(es_snapshot_spec_html_path, 'w') { es_snapshot_spec_html_io } - - # Allow normal opening of Tempfile files created during script execution. - tempfile_basenames = [ - described_class::MARKDOWN_TEMPFILE_BASENAME[0], - described_class::STATIC_HTML_TEMPFILE_BASENAME[0] - ].join('|') - # NOTE: This approach with a single regex seems to be the only way this can work. If you - # attempt to have multiple `allow...and_call_original` with `any_args`, the mocked - # parameter matching will fail to match the second one. - tempfiles_regex = /(#{tempfile_basenames})/ - allow(File).to receive(:open).with(tempfiles_regex, any_args).and_call_original - - # Prevent console output when running tests - allow(subject).to receive(:output) - end - - describe 'retrieving latest GHFM spec.txt' do - context 'when UPDATE_GHFM_SPEC_MD is not true (default)' do - it 'does not download' do - expect(URI).not_to receive(:parse).with(ghfm_spec_txt_uri) - - subject.process(skip_spec_html_generation: true) - - expect(reread_io(ghfm_spec_txt_local_io)).to eq(ghfm_spec_txt_contents) - end - end - - context 'when UPDATE_GHFM_SPEC_MD is true' do - let(:ghfm_spec_txt_local_io) { StringIO.new } - - before do - stub_env('UPDATE_GHFM_SPEC_MD', 'true') - allow(File).to receive(:open).with(ghfm_spec_md_path, 'w') { ghfm_spec_txt_local_io } - end - - context 'with success' do - it 'downloads and saves' do - subject.process(skip_spec_html_generation: true) - - expect(reread_io(ghfm_spec_txt_local_io)).to eq(ghfm_spec_txt_contents) - end - end - - context 'with error handling' do - context 'with a version mismatch' do - let(:ghfm_spec_txt_contents) do - <<~MARKDOWN - --- - title: GitHub Flavored Markdown Spec - version: 0.30 - ... - MARKDOWN - end - - it 'raises an error' do - expect do - subject.process(skip_spec_html_generation: true) - end.to raise_error(/version mismatch.*expected.*29.*got.*30/i) - end - end - - context 'with a failed read of file lines' do - let(:ghfm_spec_txt_contents) { '' } - - it 'raises an error if lines cannot be read' do - expect { subject.process(skip_spec_html_generation: true) }.to raise_error(/unable to read lines/i) - end - end - - context 'with a failed re-read of file string' do - before do - allow(ghfm_spec_txt_uri_io).to receive(:read).and_return(nil) - end - - it 'raises an error if file is blank' do - expect { subject.process(skip_spec_html_generation: true) }.to raise_error(/unable to read string/i) - end - end - end - end - end - - describe 'writing output_spec/spec.txt' do - let(:glfm_spec_txt_contents) { reread_io(glfm_spec_txt_io) } - - before do - subject.process(skip_spec_html_generation: true) - end - - it 'includes only the header and official examples' do - expected = described_class::GLFM_SPEC_TXT_HEADER + glfm_official_specification_md_contents - expect(glfm_spec_txt_contents).to eq(expected) - end - end - - describe 'writing output_example_snapshots/snapshot_spec.md' do - let(:es_snapshot_spec_md_contents) { reread_io(es_snapshot_spec_md_io) } - - context 'with valid glfm_internal_extensions.md' do - before do - subject.process(skip_spec_html_generation: true) - end - - it 'replaces the header text with the GitLab version' do - expect(es_snapshot_spec_md_contents).not_to match(/GitHub Flavored Markdown Spec/m) - expect(es_snapshot_spec_md_contents).not_to match(/^version: \d\.\d/m) - expect(es_snapshot_spec_md_contents).not_to match(/^date: /m) - - expect(es_snapshot_spec_md_contents).to match(/#{Regexp.escape(described_class::ES_SNAPSHOT_SPEC_MD_HEADER)}/mo) - end - - it 'includes header and all examples', :unlimited_max_formatted_output_length do - # rubocop:disable Style/StringConcatenation -- string contatenation is more readable - expected = described_class::ES_SNAPSHOT_SPEC_MD_HEADER + - ghfm_spec_txt_examples + - "\n" + - glfm_official_specification_md_examples + - "\n\n" + # NOTE: We want a blank line between the official and internal examples - glfm_internal_extensions_md_examples + - "\n" - # rubocop:enable Style/StringConcatenation - expect(es_snapshot_spec_md_contents).to eq(expected) - end - end - - context 'with invalid non-example content in glfm_internal_extensions.md' do - let(:glfm_internal_extensions_md_contents) do - <<~MARKDOWN - THIS TEXT IS NOT ALLOWED IN THIS FILE, ONLY EXAMPLES IN BEGIN/END TEST BLOCK ARE ALLOWED - #{described_class::BEGIN_TESTS_COMMENT_LINE_TEXT} - #{glfm_internal_extensions_md_examples} - #{described_class::END_TESTS_COMMENT_LINE_TEXT} - MARKDOWN - end - - it 'raises an error' do - expect { subject.process(skip_spec_html_generation: true) }.to raise_error(/no content is allowed outside/i) - end - end - end - - # rubocop:disable RSpec/MultipleMemoizedHelpers - describe 'writing output html files' do - let(:spec_html_contents) { reread_io(glfm_spec_html_io) } - let(:snapshot_spec_html_contents) { reread_io(es_snapshot_spec_html_io) } - - before do - subject.process - end - - it 'renders expected HTML', :unlimited_max_formatted_output_length do - # NOTE: We do all assertions for both output HTML files in this same `it` example block, - # because calling a full `subject.process` without `skip_spec_html_generation: true` - # is very slow, and want to avoid doing it multiple times - # - # We also do fairly loose and minimal assertions around the basic structure of the files. - # Otherwise, if we asserted the complete exact structure of the HTML, this would be a - # brittle test which would breaks every time that something minor changed around the - # GLFM rendering. E.g. classes, ids, attribute ordering, etc. All of this behavior - # should be thoroughly covered elsewhere by other testing. If there are regressions - # in the update specification logic in the future which are not caught by this example, - # additional test coverage can be added as necessary. - - # -------------------- - # spec.html assertions - # -------------------- - - # correct title should in a header - expect(spec_html_contents).to match(%r{<h1.*#{described_class::GLFM_SPEC_TXT_TITLE}</h1>}o) - - # correct text should be included with correct ordering - expect(spec_html_contents) - .to match(%r{official text before.*official example.*official text after}m) - - # ----------------------------- - # snapshot_spec.html assertions - # ----------------------------- - - # correct title should in a header - expect(snapshot_spec_html_contents).to match(%r{<h1.*#{described_class::ES_SNAPSHOT_SPEC_TITLE}</h1>}o) - - # correct example text should be included - expect(snapshot_spec_html_contents) - .to match(%r{internal example}m) - - # ----------------------------- - # general formatting assertions - # ----------------------------- - - md = '_EMPHASIS LINE 1_' - html = '<em>EMPHASIS LINE 1</em>' - - # examples should have markdown and HTML in separate pre+code blocks - expected_example_1_regex = "<pre.*<code.*#{md}.*</code></pre>.*<pre.*<code.*#{html}.*</code></pre>" - expect(snapshot_spec_html_contents).to match(%r{#{expected_example_1_regex}}m) - - # examples should have proper divs prepended for numbering, links, and styling - empty_div_for_example_class = '<div>' - examplenum_div = '<div><a href="#example-1">Example 1</a></div>' - expect(snapshot_spec_html_contents) - .to match(%r{#{empty_div_for_example_class}\n#{examplenum_div}.*#{expected_example_1_regex}.*}m) - end - end - # rubocop:enable RSpec/MultipleMemoizedHelpers - - def reread_io(io) - # Reset the io StringIO to the beginning position of the buffer - io.seek(0) - io.read - end -end diff --git a/spec/support/shared_contexts/glfm/api_markdown_snapshot_shared_context.rb b/spec/support/shared_contexts/glfm/api_markdown_snapshot_shared_context.rb deleted file mode 100644 index a0d91d813ae5f0a588171505fea24aa5a0e315fd..0000000000000000000000000000000000000000 --- a/spec/support/shared_contexts/glfm/api_markdown_snapshot_shared_context.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../../../scripts/lib/glfm/constants' - -# See https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#markdown-snapshot-testing -# for documentation on this spec. -RSpec.shared_context 'with API::Markdown Snapshot shared context' do |ee_only: false| - include_context 'with GLFM example snapshot fixtures' - - include ApiHelpers - - markdown_examples, html_examples, normalizations_by_example_name, metadata_by_example_name = [ - Glfm::Constants::ES_MARKDOWN_YML_PATH, - Glfm::Constants::ES_HTML_YML_PATH, - Glfm::Constants::GLFM_EXAMPLE_NORMALIZATIONS_YML_PATH, - Glfm::Constants::GLFM_EXAMPLE_METADATA_YML_PATH - ].map { |path| YAML.safe_load(File.open(path), symbolize_names: true, aliases: true) } - - if (focused_markdown_examples_string = ENV['FOCUSED_MARKDOWN_EXAMPLES']) - focused_markdown_examples = focused_markdown_examples_string.split(',').map(&:strip).map(&:to_sym) - markdown_examples.select! { |example_name| focused_markdown_examples.include?(example_name) } - end - - markdown_examples.select! { |example_name| !!metadata_by_example_name&.dig(example_name, :ee) == ee_only } - - markdown_examples.each do |name, markdown| - context "for #{name}" do - let(:html) { html_examples.fetch(name).fetch(:static) } - let(:normalizations) { normalizations_by_example_name.dig(name, :html, :static, :snapshot) } - - it "verifies conversion of GLFM to HTML", :unlimited_max_formatted_output_length do - normalized_html = normalize_html(html, normalizations) - api_url = metadata_by_example_name&.dig(name, :api_request_override_path) || (api "/markdown") - - post api_url, params: { text: markdown, gfm: true } - expect(response).to be_successful - parsed_response = Gitlab::Json.parse(response.body, symbolize_names: true) - # Some responses have the HTML in the `html` key, others in the `body` key. - response_html = parsed_response[:body] || parsed_response[:html] - normalized_response_html = normalize_html(response_html, normalizations) - - expect(normalized_response_html).to eq(normalized_html) - end - - def normalize_html(html, normalizations) - return html unless normalizations - - normalized_html = html.dup - normalizations.each_value do |normalization_entry| - normalization_entry.each do |normalization| - regex = normalization.fetch(:regex) - replacement = normalization.fetch(:replacement) - normalized_html.gsub!(%r{#{regex}}, replacement) - end - end - - normalized_html - end - end - end -end diff --git a/spec/support/shared_contexts/glfm/example_snapshot_fixtures.rb b/spec/support/shared_contexts/glfm/example_snapshot_fixtures.rb deleted file mode 100644 index 9dd2dc17e251245c85669690cd9f8ff045af2fed..0000000000000000000000000000000000000000 --- a/spec/support/shared_contexts/glfm/example_snapshot_fixtures.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true - -RSpec.shared_context 'with GLFM example snapshot fixtures' do - let_it_be(:user) { create(:user) } - let_it_be(:group) { create(:group, name: 'glfm_group', owners: user, id: 66666) } - - let_it_be(:project) do - # NOTE: We hardcode the IDs on all fixtures to prevent variability in the - # rendered HTML/Prosemirror JSON, and to minimize the need for normalization: - # https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#normalization - create(:project, :repository, creator: user, group: group, path: 'glfm_project', id: 77777) - end - - let_it_be(:project_snippet) { create(:project_snippet, title: 'glfm_project_snippet', id: 88888, project: project) } - let_it_be(:personal_snippet) { create(:snippet, id: 99999) } - - before do - # Set 'GITLAB_TEST_FOOTNOTE_ID' in order to override random number generation in - # Banzai::Filter::FootnoteFilter#random_number, and thus avoid the need to - # perform normalization on the value. See: - # https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#normalization - stub_env('GITLAB_TEST_FOOTNOTE_ID', 42) - - stub_licensed_features(group_wikis: true) - sign_in(user) - end - - after(:all) do - # We need to clean up the repository explicitly as we're using a static project ID. If two tests - # use this fixture, they'd attempt to create repositories with the same disk path and conflict. - ::Gitlab::GitalyClient::RepositoryService.new(project.repository).remove - end -end diff --git a/spec/tooling/danger/project_helper_spec.rb b/spec/tooling/danger/project_helper_spec.rb index ab5d933f8f6b66c614f1000e85be8435c29e5471..33a3747710413d968558f903152c902729c52493 100644 --- a/spec/tooling/danger/project_helper_spec.rb +++ b/spec/tooling/danger/project_helper_spec.rb @@ -30,9 +30,6 @@ end where(:path, :expected_categories) do - 'glfm_specification/example_snapshots/prosemirror_json.yml' | [:frontend] - 'glfm_specification/input/glfm_anything.yml' | [:frontend, :backend] - 'doc/api/graphql/reference/index.md' | [:docs, :backend] 'doc/api/graphql/reference/some_other_file.txt' | [:docs, :backend] 'doc/api/openapi/openapi.yaml' | [:docs, :backend] diff --git a/tooling/danger/project_helper.rb b/tooling/danger/project_helper.rb index a44501868a80c45986f434694abe1811dfecd422..ac8a21324dfd9696f31c865aa68d55676f28166c 100644 --- a/tooling/danger/project_helper.rb +++ b/tooling/danger/project_helper.rb @@ -17,10 +17,6 @@ module ProjectHelper # First-match win, so be sure to put more specific regex at the top... CATEGORIES = { - # GitLab Flavored Markdown Specification files. See more context at: https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#specification-files - %r{\Aglfm_specification/.+prosemirror_json\.yml} => [:frontend], - %r{\Aglfm_specification/.+\.yml} => [:frontend, :backend], - # API auto generated doc files and schema (must come before generic docs regex) %r{\Adoc/api/graphql/reference/} => [:docs, :backend], %r{\Adoc/api/openapi/.*\.yaml\z} => [:docs, :backend],