diff --git a/.gitlab/CODEOWNERS b/.gitlab/CODEOWNERS
index 85ad4adbede..0635006943e 100644
--- a/.gitlab/CODEOWNERS
+++ b/.gitlab/CODEOWNERS
@@ -156,7 +156,7 @@ Dangerfile @gl-quality/eng-prod
/app/assets/javascripts/ci_variable_list/ @gitlab-org/ci-cd/verify/frontend
/app/assets/javascripts/pipeline_schedules/ @gitlab-org/ci-cd/verify/frontend
/app/assets/javascripts/pipeline_editor/ @gitlab-org/ci-cd/verify/frontend
-/ee/app/assets/javascripts/ci_minutes_usage/ @gitlab-org/ci-cd/verify/frontend
+/ee/app/assets/javascripts/ci/ci_minutes_usage/ @gitlab-org/ci-cd/verify/frontend
/ee/app/assets/javascripts/usage_quotas/ci_minutes_usage/ @gitlab-org/ci-cd/verify/frontend
/ee/app/assets/javascripts/usage_quotas/pipelines/ @gitlab-org/ci-cd/verify/frontend
/ee/app/assets/javascripts/reports/ @gitlab-org/ci-cd/verify/frontend
diff --git a/.gitlab/issue_templates/Geo Replicate a new Git repository type.md b/.gitlab/issue_templates/Geo Replicate a new Git repository type.md
index 6c9b8bb6d78..2348fa5b86f 100644
--- a/.gitlab/issue_templates/Geo Replicate a new Git repository type.md
+++ b/.gitlab/issue_templates/Geo Replicate a new Git repository type.md
@@ -57,46 +57,38 @@ Geo secondary sites have a [Geo tracking database](https://gitlab.com/gitlab-org
# frozen_string_literal: true
class CreateCoolWidgetRegistry < Gitlab::Database::Migration[2.0]
- disable_ddl_transaction!
+ def change
+ create_table :cool_widget_registry, id: :bigserial, force: :cascade do |t|
+ t.bigint :cool_widget_id, null: false
+ t.datetime_with_timezone :created_at, null: false
+ t.datetime_with_timezone :last_synced_at
+ t.datetime_with_timezone :retry_at
+ t.datetime_with_timezone :verified_at
+ t.datetime_with_timezone :verification_started_at
+ t.datetime_with_timezone :verification_retry_at
+ t.integer :state, default: 0, null: false, limit: 2
+ t.integer :verification_state, default: 0, null: false, limit: 2
+ t.integer :retry_count, default: 0, limit: 2, null: false
+ t.integer :verification_retry_count, default: 0, limit: 2, null: false
+ t.boolean :checksum_mismatch, default: false, null: false
+ t.boolean :force_to_redownload, default: false, null: false
+ t.boolean :missing_on_primary, default: false, null: false
+ t.binary :verification_checksum
+ t.binary :verification_checksum_mismatched
+ t.text :verification_failure, limit: 255
+ t.text :last_sync_failure, limit: 255
- def up
- Geo::TrackingBase.transaction do
- create_table :cool_widget_registry, id: :bigserial, force: :cascade do |t|
- t.bigint :cool_widget_id, null: false
- t.datetime_with_timezone :created_at, null: false
- t.datetime_with_timezone :last_synced_at
- t.datetime_with_timezone :retry_at
- t.datetime_with_timezone :verified_at
- t.datetime_with_timezone :verification_started_at
- t.datetime_with_timezone :verification_retry_at
- t.integer :state, default: 0, null: false, limit: 2
- t.integer :verification_state, default: 0, null: false, limit: 2
- t.integer :retry_count, default: 0, limit: 2, null: false
- t.integer :verification_retry_count, default: 0, limit: 2, null: false
- t.boolean :checksum_mismatch, default: false, null: false
- t.boolean :force_to_redownload, default: false, null: false
- t.boolean :missing_on_primary, default: false, null: false
- t.binary :verification_checksum
- t.binary :verification_checksum_mismatched
- t.text :verification_failure, limit: 255
- t.text :last_sync_failure, limit: 255
-
- t.index :cool_widget_id, name: :index_cool_widget_registry_on_cool_widget_id, unique: true
- t.index :retry_at
- t.index :state
- # To optimize performance of CoolWidgetRegistry.verification_failed_batch
- t.index :verification_retry_at, name: :cool_widget_registry_failed_verification, order: "NULLS FIRST", where: "((state = 2) AND (verification_state = 3))"
- # To optimize performance of CoolWidgetRegistry.needs_verification_count
- t.index :verification_state, name: :cool_widget_registry_needs_verification, where: "((state = 2) AND (verification_state = ANY (ARRAY[0, 3])))"
- # To optimize performance of CoolWidgetRegistry.verification_pending_batch
- t.index :verified_at, name: :cool_widget_registry_pending_verification, order: "NULLS FIRST", where: "((state = 2) AND (verification_state = 0))"
- end
+ t.index :cool_widget_id, name: :index_cool_widget_registry_on_cool_widget_id, unique: true
+ t.index :retry_at
+ t.index :state
+ # To optimize performance of CoolWidgetRegistry.verification_failed_batch
+ t.index :verification_retry_at, name: :cool_widget_registry_failed_verification, order: "NULLS FIRST", where: "((state = 2) AND (verification_state = 3))"
+ # To optimize performance of CoolWidgetRegistry.needs_verification_count
+ t.index :verification_state, name: :cool_widget_registry_needs_verification, where: "((state = 2) AND (verification_state = ANY (ARRAY[0, 3])))"
+ # To optimize performance of CoolWidgetRegistry.verification_pending_batch
+ t.index :verified_at, name: :cool_widget_registry_pending_verification, order: "NULLS FIRST", where: "((state = 2) AND (verification_state = 0))"
end
end
-
- def down
- drop_table :cool_widget_registry
- end
end
```
diff --git a/.gitlab/issue_templates/Geo Replicate a new blob type.md b/.gitlab/issue_templates/Geo Replicate a new blob type.md
index 76fe1772921..2bb8918df60 100644
--- a/.gitlab/issue_templates/Geo Replicate a new blob type.md
+++ b/.gitlab/issue_templates/Geo Replicate a new blob type.md
@@ -59,44 +59,36 @@ Geo secondary sites have a [Geo tracking database](https://gitlab.com/gitlab-org
# frozen_string_literal: true
class CreateCoolWidgetRegistry < Gitlab::Database::Migration[2.0]
- disable_ddl_transaction!
+ def change
+ create_table :cool_widget_registry, id: :bigserial, force: :cascade do |t|
+ t.bigint :cool_widget_id, null: false
+ t.datetime_with_timezone :created_at, null: false
+ t.datetime_with_timezone :last_synced_at
+ t.datetime_with_timezone :retry_at
+ t.datetime_with_timezone :verified_at
+ t.datetime_with_timezone :verification_started_at
+ t.datetime_with_timezone :verification_retry_at
+ t.integer :state, default: 0, null: false, limit: 2
+ t.integer :verification_state, default: 0, null: false, limit: 2
+ t.integer :retry_count, default: 0, limit: 2, null: false
+ t.integer :verification_retry_count, default: 0, limit: 2, null: false
+ t.boolean :checksum_mismatch, default: false, null: false
+ t.binary :verification_checksum
+ t.binary :verification_checksum_mismatched
+ t.text :verification_failure, limit: 255
+ t.text :last_sync_failure, limit: 255
- def up
- Geo::TrackingBase.transaction do
- create_table :cool_widget_registry, id: :bigserial, force: :cascade do |t|
- t.bigint :cool_widget_id, null: false
- t.datetime_with_timezone :created_at, null: false
- t.datetime_with_timezone :last_synced_at
- t.datetime_with_timezone :retry_at
- t.datetime_with_timezone :verified_at
- t.datetime_with_timezone :verification_started_at
- t.datetime_with_timezone :verification_retry_at
- t.integer :state, default: 0, null: false, limit: 2
- t.integer :verification_state, default: 0, null: false, limit: 2
- t.integer :retry_count, default: 0, limit: 2, null: false
- t.integer :verification_retry_count, default: 0, limit: 2, null: false
- t.boolean :checksum_mismatch, default: false, null: false
- t.binary :verification_checksum
- t.binary :verification_checksum_mismatched
- t.text :verification_failure, limit: 255
- t.text :last_sync_failure, limit: 255
-
- t.index :cool_widget_id, name: :index_cool_widget_registry_on_cool_widget_id, unique: true
- t.index :retry_at
- t.index :state
- # To optimize performance of CoolWidgetRegistry.verification_failed_batch
- t.index :verification_retry_at, name: :cool_widget_registry_failed_verification, order: "NULLS FIRST", where: "((state = 2) AND (verification_state = 3))"
- # To optimize performance of CoolWidgetRegistry.needs_verification_count
- t.index :verification_state, name: :cool_widget_registry_needs_verification, where: "((state = 2) AND (verification_state = ANY (ARRAY[0, 3])))"
- # To optimize performance of CoolWidgetRegistry.verification_pending_batch
- t.index :verified_at, name: :cool_widget_registry_pending_verification, order: "NULLS FIRST", where: "((state = 2) AND (verification_state = 0))"
- end
+ t.index :cool_widget_id, name: :index_cool_widget_registry_on_cool_widget_id, unique: true
+ t.index :retry_at
+ t.index :state
+ # To optimize performance of CoolWidgetRegistry.verification_failed_batch
+ t.index :verification_retry_at, name: :cool_widget_registry_failed_verification, order: "NULLS FIRST", where: "((state = 2) AND (verification_state = 3))"
+ # To optimize performance of CoolWidgetRegistry.needs_verification_count
+ t.index :verification_state, name: :cool_widget_registry_needs_verification, where: "((state = 2) AND (verification_state = ANY (ARRAY[0, 3])))"
+ # To optimize performance of CoolWidgetRegistry.verification_pending_batch
+ t.index :verified_at, name: :cool_widget_registry_pending_verification, order: "NULLS FIRST", where: "((state = 2) AND (verification_state = 0))"
end
end
-
- def down
- drop_table :cool_widget_registry
- end
end
```
diff --git a/app/assets/javascripts/ide/components/ide.vue b/app/assets/javascripts/ide/components/ide.vue
index d589f56dd7c..838debf1ceb 100644
--- a/app/assets/javascripts/ide/components/ide.vue
+++ b/app/assets/javascripts/ide/components/ide.vue
@@ -47,6 +47,7 @@ export default {
data() {
return {
loadDeferred: false,
+ skipBeforeUnload: false,
};
},
computed: {
@@ -78,9 +79,14 @@ export default {
mounted() {
window.onbeforeunload = (e) => this.onBeforeUnload(e);
+ eventHub.$on('skip-beforeunload', this.handleSkipBeforeUnload);
+
if (this.themeName)
document.querySelector('.navbar-gitlab').classList.add(`theme-${this.themeName}`);
},
+ destroyed() {
+ eventHub.$off('skip-beforeunload', this.handleSkipBeforeUnload);
+ },
beforeCreate() {
performanceMarkAndMeasure({
mark: WEBIDE_MARK_APP_START,
@@ -94,6 +100,11 @@ export default {
methods: {
...mapActions(['toggleFileFinder']),
onBeforeUnload(e = {}) {
+ if (this.skipBeforeUnload) {
+ this.skipBeforeUnload = false;
+ return undefined;
+ }
+
const returnValue = __('Are you sure you want to lose unsaved changes?');
if (!this.someUncommittedChanges) return undefined;
@@ -103,6 +114,9 @@ export default {
});
return returnValue;
},
+ handleSkipBeforeUnload() {
+ this.skipBeforeUnload = true;
+ },
openFile(file) {
this.$router.push(this.getUrlForPath(file.path));
},
diff --git a/app/assets/javascripts/ide/components/panes/collapsible_sidebar.vue b/app/assets/javascripts/ide/components/panes/collapsible_sidebar.vue
index 6f42ae48cc9..bf99538a2ad 100644
--- a/app/assets/javascripts/ide/components/panes/collapsible_sidebar.vue
+++ b/app/assets/javascripts/ide/components/panes/collapsible_sidebar.vue
@@ -13,6 +13,11 @@ export default {
required: false,
default: () => [],
},
+ initOpenView: {
+ type: String,
+ required: false,
+ default: '',
+ },
side: {
type: String,
required: true,
@@ -44,6 +49,9 @@ export default {
return this.tabViews.filter((view) => this.isAliveView(view.name));
},
},
+ created() {
+ this.openViewByName(this.initOpenView);
+ },
methods: {
...mapActions({
toggleOpen(dispatch) {
@@ -53,6 +61,13 @@ export default {
return dispatch(`${this.namespace}/open`, view);
},
}),
+ openViewByName(viewName) {
+ const view = viewName && this.tabViews.find((x) => x.name === viewName);
+
+ if (view) {
+ this.open(view);
+ }
+ },
},
};
diff --git a/app/assets/javascripts/ide/components/panes/right.vue b/app/assets/javascripts/ide/components/panes/right.vue
index da2d4fbe7f0..c74a5052573 100644
--- a/app/assets/javascripts/ide/components/panes/right.vue
+++ b/app/assets/javascripts/ide/components/panes/right.vue
@@ -7,6 +7,7 @@ import PipelinesList from '../pipelines/list.vue';
import Clientside from '../preview/clientside.vue';
import ResizablePanel from '../resizable_panel.vue';
import TerminalView from '../terminal/view.vue';
+import SwitchEditorsView from '../switch_editors/switch_editors_view.vue';
import CollapsibleSidebar from './collapsible_sidebar.vue';
// Need to add the width of the nav buttons since the resizable container contains those as well
@@ -20,7 +21,7 @@ export default {
},
computed: {
...mapState('terminal', { isTerminalVisible: 'isVisible' }),
- ...mapState(['currentMergeRequestId', 'clientsidePreviewEnabled']),
+ ...mapState(['currentMergeRequestId', 'clientsidePreviewEnabled', 'canUseNewWebIde']),
...mapGetters(['packageJson']),
...mapState('rightPane', ['isOpen']),
showLivePreview() {
@@ -28,6 +29,12 @@ export default {
},
rightExtensionTabs() {
return [
+ {
+ show: this.canUseNewWebIde,
+ title: __('Switch editors'),
+ views: [{ component: SwitchEditorsView, ...rightSidebarViews.switchEditors }],
+ icon: 'bullhorn',
+ },
{
show: true,
title: __('Pipelines'),
@@ -53,6 +60,7 @@ export default {
},
},
WIDTH,
+ SWITCH_EDITORS_VIEW_NAME: rightSidebarViews.switchEditors.name,
};
@@ -64,6 +72,11 @@ export default {
:min-size="$options.WIDTH"
:resizable="isOpen"
>
-
foo\tbaz\t\tbim\n\n"
static: "foo\tbaz\t\tbim\nfoo\tbaz\t\tbim"
02_01_00__preliminaries__tabs__002:
canonical: "foo\tbaz\t\tbim\n\n"
static: "foo\tbaz\t\tbim\nfoo\tbaz\t\tbim"
02_01_00__preliminaries__tabs__003:
canonical: "a\ta\nὐ\ta\n\n"
static: "a\ta\nὐ\ta\na\ta\nὐ\ta"
@@ -52,7 +52,7 @@
foo
bar
+ bar
@@ -86,7 +86,7 @@-+foofoo
foo
+ foo
foo
+ foo
bar
***
+ ***
# foo
+ # foo
Foo
+ Foo
---
Foo
@@ -806,7 +806,7 @@
Baz
static: |-
- Foo
+ Foo
@@ -829,7 +829,7 @@
static: |-
-
+
wysiwyg: |-
@@ -855,7 +855,7 @@
static: |-
- foo
+ foo
@@ -953,7 +953,7 @@
static: |-
a simple
+ a simple
indented code block
<a/>
+ <a/>
*hi*
- one
@@ -1030,7 +1030,7 @@
static: |-
chunk1
+ chunk1
chunk2
@@ -1051,7 +1051,7 @@
canonical: "chunk1\n \n chunk2\n
\n"
static: |-
- chunk1
+ chunk1
chunk2
@@ -1075,7 +1075,7 @@
bar
static: |-
- foo
+ foo
bar
@@ -1095,13 +1095,13 @@
Heading
- foo
+ foo
Heading
- foo
+ foo
@@ -1118,7 +1118,7 @@
static: |-
- foo
+ foo
bar
@@ -1131,7 +1131,7 @@
static: |-
- foo
+ foo
wysiwyg: |-
@@ -1140,7 +1140,7 @@
canonical: "foo \n
\n"
static: |-
- foo
+ foo
wysiwyg: |-
@@ -1152,7 +1152,7 @@
static: |-
- <
+ <
>
@@ -1166,7 +1166,7 @@
static: |-
- <
+ <
>
@@ -1187,7 +1187,7 @@
static: |-
- aaa
+ aaa
~~~
@@ -1201,7 +1201,7 @@
static: |-
- aaa
+ aaa
```
@@ -1215,7 +1215,7 @@
static: |-
- aaa
+ aaa
```
@@ -1229,7 +1229,7 @@
static: |-
- aaa
+ aaa
~~~
@@ -1241,7 +1241,7 @@
static: |-
-
+
wysiwyg: |-
@@ -1254,7 +1254,7 @@
static: |-
-
+
```
aaa
@@ -1273,7 +1273,7 @@
static: |-
- aaa
+ aaa
@@ -1285,7 +1285,7 @@
canonical: "\n \n
\n"
static: |-
-
+
@@ -1296,7 +1296,7 @@
static: |-
-
+
wysiwyg: |-
@@ -1308,7 +1308,7 @@
static: |-
- aaa
+ aaa
aaa
@@ -1323,7 +1323,7 @@
static: |-
- aaa
+ aaa
aaa
aaa
@@ -1340,7 +1340,7 @@
static: |-
- aaa
+ aaa
aaa
aaa
@@ -1357,7 +1357,7 @@
static: |-
- ```
+ ```
aaa
```
@@ -1372,7 +1372,7 @@
static: |-
- aaa
+ aaa
wysiwyg: |-
@@ -1383,7 +1383,7 @@
static: |-
- aaa
+ aaa
wysiwyg: |-
@@ -1395,7 +1395,7 @@
static: |-
- aaa
+ aaa
```
@@ -1419,7 +1419,7 @@
static: |-
- aaa
+ aaa
~~~ ~~
@@ -1435,7 +1435,7 @@
static: |-
foo
- bar
+ bar
baz
@@ -1453,7 +1453,7 @@
foo
- bar
+ bar
@@ -1470,7 +1470,7 @@
static: |-
- def foo(x)
+ def foo(x)
return 3
end
@@ -1487,7 +1487,7 @@
static: |-
- def foo(x)
+ def foo(x)
return 3
end
@@ -1501,7 +1501,7 @@
static: |-
-
+
wysiwyg: |-
@@ -1522,7 +1522,7 @@
static: |-
- foo
+ foo
wysiwyg: |-
@@ -1533,7 +1533,7 @@
static: |-
- ``` aaa
+ ``` aaa
wysiwyg: |-
@@ -1799,7 +1799,7 @@
okay
static: |-
-
+
import Text.HTML.TagSoup
main :: IO ()
@@ -1989,8 +1989,8 @@
<!-- foo -->
static: " \n\n<!-- foo -->
\n \n"
wysiwyg: |-
<!-- foo -->
@@ -2002,7 +2002,7 @@
static: |2-
- <div>
+ <div>
@@ -2113,7 +2113,7 @@
- <td>
+ <td>
Hi
</td>
@@ -2306,7 +2306,7 @@
[foo]
static: |-
- [foo]: /url "title"
+ [foo]: /url "title"
[foo]
@@ -2320,7 +2320,7 @@
[foo]
static: |-
- [foo]: /url
+ [foo]: /url
[foo]
@@ -2489,7 +2489,7 @@
bbb
static: |-
- aaa
+ aaa
bbb
@@ -2836,7 +2836,7 @@
static: |-
- > # Foo
+ > # Foo
> bar
> baz
@@ -2926,12 +2926,12 @@
static: |-
- foo
+ foo
- bar
+ bar
wysiwyg: |-
@@ -2947,13 +2947,13 @@
static: |-
-
+
foo
-
+
wysiwyg: |-
@@ -3184,7 +3184,7 @@
static: |-
- code
+ code
@@ -3207,7 +3207,7 @@
A paragraph
with two lines.
- indented code
+ indented code
@@ -3237,7 +3237,7 @@
A paragraph
with two lines.
- indented code
+ indented code
@@ -3291,7 +3291,7 @@
- one
- two
+ two
wysiwyg: |-
@@ -3405,7 +3405,7 @@
-
foo
- bar
+ bar
baz
@@ -3433,7 +3433,7 @@
-
Foo
- bar
+ bar
baz
@@ -3507,7 +3507,7 @@
-
foo
- bar
+ bar
@@ -3528,7 +3528,7 @@
-
foo
- bar
+ bar
@@ -3544,12 +3544,12 @@
static: |-
- indented code
+ indented code
paragraph
- more code
+ more code
wysiwyg: |-
@@ -3571,12 +3571,12 @@
-
-
indented code
+ indented code
paragraph
- more code
+ more code
@@ -3598,12 +3598,12 @@
-
-
indented code
+ indented code
paragraph
- more code
+ more code
@@ -3669,13 +3669,13 @@
- foo
-
-
bar
+ bar
-
-
baz
+ baz
@@ -3803,7 +3803,7 @@
A paragraph
with two lines.
- indented code
+ indented code
@@ -3833,7 +3833,7 @@
A paragraph
with two lines.
- indented code
+ indented code
@@ -3863,7 +3863,7 @@
A paragraph
with two lines.
- indented code
+ indented code
@@ -3885,7 +3885,7 @@
static: |-
- 1. A paragraph
+ 1. A paragraph
with two lines.
indented code
@@ -3919,7 +3919,7 @@
A paragraph
with two lines.
- indented code
+ indented code
@@ -4345,7 +4345,7 @@
- code
+ code
wysiwyg: |-
@@ -4443,7 +4443,7 @@
- 3. c
+ 3. c
wysiwyg: |-
@@ -4573,7 +4573,7 @@
- a
-
-
b
+ b
@@ -4650,7 +4650,7 @@
b
- c
+ c
@@ -4701,7 +4701,7 @@
-
-
foo
+ foo
bar
@@ -4848,7 +4848,7 @@
static: |-
- \[\]
+ \[\]
wysiwyg: |-
@@ -4859,7 +4859,7 @@
static: |-
- \[\]
+ \[\]
wysiwyg: |-
@@ -4899,7 +4899,7 @@
static: |-
- foo
+ foo
wysiwyg: |-
@@ -4989,7 +4989,7 @@
static: |-
- foo
+ foo
wysiwyg: |-
@@ -5007,7 +5007,7 @@
static: |-
- föfö
+ föfö
wysiwyg: |-
@@ -7741,7 +7741,7 @@
static: |-
- title: YAML front matter
+ title: YAML front matter
wysiwyg: |-
@@ -7755,7 +7755,7 @@
static: |-
- title: TOML front matter
+ title: TOML front matter
wysiwyg: |-
@@ -7771,7 +7771,7 @@
static: |-
- {
+ {
"title": "JSON front matter"
}
diff --git a/glfm_specification/output_example_snapshots/snapshot_spec.html b/glfm_specification/output_example_snapshots/snapshot_spec.html
index c78d41e1392..1f9c5ca2e0e 100644
--- a/glfm_specification/output_example_snapshots/snapshot_spec.html
+++ b/glfm_specification/output_example_snapshots/snapshot_spec.html
@@ -1,5 +1,5 @@
-title: GitLab Flavored Markdown (GLFM) Spec
+title: GitLab Flavored Markdown (GLFM) Spec
version: alpha
@@ -59,21 +59,21 @@ in an indented code block. (Note, however, that internal
tabs are passed through as literal tabs, not expanded to
spaces.)
-→foo→baz→→bim
+→foo→baz→→bim
.
<pre><code>foo→baz→→bim
</code></pre>
- →foo→baz→→bim
+ →foo→baz→→bim
.
<pre><code>foo→baz→→bim
</code></pre>
- a→a
+ a→a
ὐ→a
.
<pre><code>a→a
@@ -85,7 +85,7 @@ spaces.)
item is indented with a tab; this has exactly the same effect
as indentation with four spaces would:
- - foo
+ - foo
→bar
.
@@ -98,7 +98,7 @@ as indentation with four spaces would:
-- foo
+- foo
→→bar
.
@@ -120,7 +120,7 @@ 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.
->→→foo
+>→→foo
.
<blockquote>
<pre><code> foo
@@ -129,7 +129,7 @@ code block starting with two spaces.
--→→foo
+-→→foo
.
<ul>
<li>
@@ -140,7 +140,7 @@ code block starting with two spaces.
- foo
+ foo
→bar
.
<pre><code>foo
@@ -149,7 +149,7 @@ code block starting with two spaces.
- - foo
+ - foo
- bar
→ - baz
.
@@ -167,13 +167,13 @@ code block starting with two spaces.
-#→Foo
+#→Foo
.
<h1>Foo</h1>
-*→*→*→
+*→*→*→
.
<hr />
@@ -196,7 +196,7 @@ links, emphasized text, images, code spans, and so on.
of inline structure. So, for example, the following is a list with
two items, not a list with one item containing a code span:
-- `one
+- `one
- two`
.
<ul>
@@ -230,7 +230,7 @@ of three or more matching -, _, or * char
optionally by any number of spaces or tabs, forms a
thematic break.
-***
+***
---
___
.
@@ -241,20 +241,20 @@ optionally by any number of spaces or tabs, forms a
Wrong characters:
-+++
++++
.
<p>+++</p>
-===
+===
.
<p>===</p>
Not enough characters:
---
+--
**
__
.
@@ -265,7 +265,7 @@ optionally by any number of spaces or tabs, forms a
One to three spaces indent are allowed:
- ***
+ ***
***
***
.
@@ -276,14 +276,14 @@ optionally by any number of spaces or tabs, forms a
Four spaces is too many:
- ***
+ ***
.
<pre><code>***
</code></pre>
-Foo
+Foo
***
.
<p>Foo
@@ -292,40 +292,40 @@ optionally by any number of spaces or tabs, forms a
More than three characters may be used:
-_____________________________________
+_____________________________________
.
<hr />
Spaces are allowed between the characters:
- - - -
+ - - -
.
<hr />
- ** * ** * ** * **
+ ** * ** * ** * **
.
<hr />
-- - - -
+- - - -
.
<hr />
Spaces are allowed at the end:
-- - - -
+- - - -
.
<hr />
However, no other characters may occur in the line:
-_ _ _ _ a
+_ _ _ _ a
a------
@@ -339,14 +339,14 @@ optionally by any number of spaces or tabs, forms a
It is required that all of the [non-whitespace characters] be the same.
So, this is not a thematic break:
- *-*
+ *-*
.
<p><em>-</em></p>
Thematic breaks do not need blank lines before or after:
-- foo
+- foo
***
- bar
.
@@ -361,7 +361,7 @@ So, this is not a thematic break:
Thematic breaks can interrupt a paragraph:
-Foo
+Foo
***
bar
.
@@ -376,7 +376,7 @@ 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:
-Foo
+Foo
---
bar
.
@@ -387,7 +387,7 @@ this is a setext heading, not a paragraph followed by a thematic break:
When both a thematic break and a list item are possible
interpretations of a line, the thematic break takes precedence:
-* Foo
+* Foo
* * *
* Bar
.
@@ -402,7 +402,7 @@ interpretations of a line, the thematic break takes precedence:
If you want a thematic break in a list item, use a different bullet:
-- Foo
+- Foo
- * * *
.
<ul>
@@ -428,7 +428,7 @@ as inline content. The heading level is equal to the number of #
characters in the opening sequence.
Simple headings:
-# foo
+# foo
## foo
### foo
#### foo
@@ -445,7 +445,7 @@ characters in the opening sequence.
More than six # characters is not a heading:
-####### foo
+####### foo
.
<p>####### foo</p>
@@ -458,7 +458,7 @@ space was required by the
and it helps prevent things like the following from being parsed as
headings:
-#5 bolt
+#5 bolt
#hashtag
.
@@ -468,28 +468,28 @@ headings:
This is not a heading, because the first # is escaped:
-\## foo
+\## foo
.
<p>## foo</p>
Contents are parsed as inlines:
-# foo *bar* \*baz\*
+# foo *bar* \*baz\*
.
<h1>foo <em>bar</em> *baz*</h1>
Leading and trailing [whitespace] is ignored in parsing inline content:
-# foo
+# foo
.
<h1>foo</h1>
One to three spaces indentation are allowed:
- ### foo
+ ### foo
## foo
# foo
.
@@ -500,14 +500,14 @@ headings:
Four spaces are too much:
- # foo
+ # foo
.
<pre><code># foo
</code></pre>
-foo
+foo
# bar
.
<p>foo
@@ -516,7 +516,7 @@ headings:
A closing sequence of # characters is optional:
-## foo ##
+## foo ##
### bar ###
.
<h2>foo</h2>
@@ -525,7 +525,7 @@ headings:
It need not be the same length as the opening sequence:
-# foo ##################################
+# foo ##################################
##### foo ##
.
<h1>foo</h1>
@@ -534,7 +534,7 @@ headings:
Spaces are allowed after the closing sequence:
-### foo ###
+### foo ###
.
<h3>foo</h3>
@@ -543,14 +543,14 @@ headings:
is not a closing sequence, but counts as part of the contents of the
heading:
-### foo ### b
+### foo ### b
.
<h3>foo ### b</h3>
The closing sequence must be preceded by a space:
-# foo#
+# foo#
.
<h1>foo#</h1>
@@ -558,7 +558,7 @@ heading:
Backslash-escaped # characters do not count as part
of the closing sequence:
-### foo \###
+### foo \###
## foo #\##
# foo \#
.
@@ -570,7 +570,7 @@ of the closing sequence:
ATX headings need not be separated from surrounding content by blank
lines, and they can interrupt paragraphs:
-****
+****
## foo
****
.
@@ -580,7 +580,7 @@ lines, and they can interrupt paragraphs:
-Foo bar
+Foo bar
# baz
Bar foo
.
@@ -591,7 +591,7 @@ lines, and they can interrupt paragraphs:
ATX headings can be empty:
-##
+##
#
### ###
.
@@ -628,7 +628,7 @@ setext heading comes after a paragraph, a blank line is needed between
them.
Simple examples:
-Foo *bar*
+Foo *bar*
=========
Foo *bar*
@@ -640,7 +640,7 @@ them.
The content of the header may span more than one line:
-Foo *bar
+Foo *bar
baz*
====
.
@@ -653,7 +653,7 @@ content as inlines. The heading's raw content is formed by
concatenating the lines and removing initial and final
[whitespace].
- Foo *bar
+ Foo *bar
baz*→
====
.
@@ -663,7 +663,7 @@ concatenating the lines and removing initial and final
The underlining can be any length:
-Foo
+Foo
-------------------------
Foo
@@ -676,7 +676,7 @@ concatenating the lines and removing initial and final
The heading content can be indented up to three spaces, and need
not line up with the underlining:
- Foo
+ Foo
---
Foo
@@ -692,7 +692,7 @@ not line up with the underlining:
Four spaces indent is too much:
- Foo
+ Foo
---
Foo
@@ -709,7 +709,7 @@ not line up with the underlining:
The setext heading underline can be indented up to three spaces, and
may have trailing spaces:
-Foo
+Foo
----
.
<h2>Foo</h2>
@@ -717,7 +717,7 @@ may have trailing spaces:
Four spaces is too much:
-Foo
+Foo
---
.
<p>Foo
@@ -726,7 +726,7 @@ may have trailing spaces:
The setext heading underline cannot contain internal spaces:
-Foo
+Foo
= =
Foo
@@ -740,7 +740,7 @@ may have trailing spaces:
Trailing spaces in the content line do not cause a line break:
-Foo
+Foo
-----
.
<h2>Foo</h2>
@@ -748,7 +748,7 @@ may have trailing spaces:
Nor does a backslash at the end:
-Foo\
+Foo\
----
.
<h2>Foo\</h2>
@@ -757,7 +757,7 @@ may have trailing spaces:
Since indicators of block structure take precedence over
indicators of inline structure, the following are setext headings:
-`Foo
+`Foo
----
`
@@ -774,7 +774,7 @@ indicators of inline structure, the following are setext headings:
The setext heading underline cannot be a [lazy continuation
line] in a list item or block quote:
-> Foo
+> Foo
---
.
<blockquote>
@@ -784,7 +784,7 @@ line] in a list item or block quote:
-> foo
+> foo
bar
===
.
@@ -796,7 +796,7 @@ line] in a list item or block quote:
-- Foo
+- Foo
---
.
<ul>
@@ -809,7 +809,7 @@ line] in a list item or block quote:
setext heading, since otherwise the paragraph becomes part
of the heading's content:
-Foo
+Foo
Bar
---
.
@@ -820,7 +820,7 @@ of the heading's content:
But in general a blank line is not required before or after
setext headings:
----
+---
Foo
---
Bar
@@ -835,7 +835,7 @@ setext headings:
Setext headings cannot be empty:
-
+
====
.
<p>====</p>
@@ -845,7 +845,7 @@ setext headings:
constructs other than paragraphs. So, the line of dashes
in these examples gets interpreted as a thematic break:
----
+---
---
.
<hr />
@@ -853,7 +853,7 @@ in these examples gets interpreted as a thematic break:
-- foo
+- foo
-----
.
<ul>
@@ -863,7 +863,7 @@ in these examples gets interpreted as a thematic break:
- foo
+ foo
---
.
<pre><code>foo
@@ -872,7 +872,7 @@ in these examples gets interpreted as a thematic break:
-> foo
+> foo
-----
.
<blockquote>
@@ -884,7 +884,7 @@ in these examples gets interpreted as a thematic break:
If you want a heading with > foo as its literal text, you can
use backslash escapes:
-\> foo
+\> foo
------
.
<h2>> foo</h2>
@@ -894,7 +894,7 @@ use backslash escapes:
do not allow the text of setext headings to span multiple lines.
But there is no consensus about how to interpret
-Foo
+Foo
bar
---
baz
@@ -912,7 +912,7 @@ increases the expressive power of CommonMark, by allowing
multiline headings. Authors who want interpretation 1 can
put a blank line after the first paragraph:
-Foo
+Foo
bar
---
@@ -926,7 +926,7 @@ put a blank line after the first paragraph:
Authors who want interpretation 2 can put blank lines around
the thematic break,
-Foo
+Foo
bar
---
@@ -942,7 +942,7 @@ the thematic break,
or use a thematic break that cannot count as a [setext heading
underline], such as
-Foo
+Foo
bar
* * *
baz
@@ -955,7 +955,7 @@ underline], such as
Authors who want interpretation 3 can use backslash escapes:
-Foo
+Foo
bar
\---
baz
@@ -980,7 +980,7 @@ 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.)
- a simple
+ a simple
indented code block
.
<pre><code>a simple
@@ -992,7 +992,7 @@ paragraph.)
as a code block and as indicating that material belongs to a [list
item][list items], the list item interpretation takes precedence:
- - foo
+ - foo
bar
.
@@ -1005,7 +1005,7 @@ item][list items], the list item interpretation takes precedence:
-1. foo
+1. foo
- bar
.
@@ -1022,7 +1022,7 @@ item][list items], the list item interpretation takes precedence:
The contents of a code block are literal text, and do not get parsed
as Markdown:
- <a/>
+ <a/>
*hi*
- one
@@ -1036,7 +1036,7 @@ as Markdown:
Here we have three chunks separated by blank lines:
- chunk1
+ chunk1
chunk2
@@ -1057,7 +1057,7 @@ as Markdown:
Any initial spaces beyond four will be included in the content, even
in interior blank lines:
- chunk1
+ chunk1
chunk2
.
@@ -1070,7 +1070,7 @@ in interior blank lines:
An indented code block cannot interrupt a paragraph. (This
allows hanging indents and the like.)
-Foo
+Foo
bar
.
@@ -1082,7 +1082,7 @@ allows hanging indents and the like.)
the code block immediately. So a paragraph may occur immediately
after indented code:
- foo
+ foo
bar
.
<pre><code>foo
@@ -1093,7 +1093,7 @@ after indented code:
And indented code can occur immediately before and after other kinds of
blocks:
-# Heading
+# Heading
foo
Heading
------
@@ -1111,7 +1111,7 @@ blocks:
The first line can be indented more than four spaces:
- foo
+ foo
bar
.
<pre><code> foo
@@ -1122,7 +1122,7 @@ blocks:
Blank lines preceding or following an indented code block
are not included in it:
-
+
foo
@@ -1134,7 +1134,7 @@ are not included in it:
Trailing spaces are included in the code block's content:
- foo
+ foo
.
<pre><code>foo
</code></pre>
@@ -1180,7 +1180,7 @@ 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:
-```
+```
<
>
```
@@ -1192,7 +1192,7 @@ particular treatment of the [info string].
With tildes:
-~~~
+~~~
<
>
~~~
@@ -1204,7 +1204,7 @@ particular treatment of the [info string].
Fewer than three backticks is not enough:
-``
+``
foo
``
.
@@ -1214,7 +1214,7 @@ particular treatment of the [info string].
The closing code fence must use the same character as the opening
fence:
-```
+```
aaa
~~~
```
@@ -1225,7 +1225,7 @@ fence:
-~~~
+~~~
aaa
```
~~~
@@ -1237,7 +1237,7 @@ fence:
The closing code fence must be at least as long as the opening fence:
-````
+````
aaa
```
``````
@@ -1248,7 +1248,7 @@ fence:
-~~~~
+~~~~
aaa
~~~
~~~~
@@ -1261,13 +1261,13 @@ fence:
Unclosed code blocks are closed by the end of the document
(or the enclosing [block quote][block quotes] or [list item][list items]):
-```
+```
.
<pre><code></code></pre>
-`````
+`````
```
aaa
@@ -1279,7 +1279,7 @@ fence:
-> ```
+> ```
> aaa
bbb
@@ -1293,7 +1293,7 @@ fence:
A code block can have all empty lines as its content:
-```
+```
```
@@ -1305,7 +1305,7 @@ fence:
A code block can be empty:
-```
+```
```
.
<pre><code></code></pre>
@@ -1315,7 +1315,7 @@ fence:
content lines will have equivalent opening indentation removed,
if present:
- ```
+ ```
aaa
aaa
```
@@ -1326,7 +1326,7 @@ if present:
- ```
+ ```
aaa
aaa
aaa
@@ -1339,7 +1339,7 @@ if present:
- ```
+ ```
aaa
aaa
aaa
@@ -1353,7 +1353,7 @@ if present:
Four spaces indentation produces an indented code block:
- ```
+ ```
aaa
```
.
@@ -1366,7 +1366,7 @@ if present:
Closing fences may be indented by 0-3 spaces, and their indentation
need not match that of the opening fence:
-```
+```
aaa
```
.
@@ -1375,7 +1375,7 @@ need not match that of the opening fence:
- ```
+ ```
aaa
```
.
@@ -1385,7 +1385,7 @@ need not match that of the opening fence:
This is not a closing fence, because it is indented 4 spaces:
-```
+```
aaa
```
.
@@ -1396,7 +1396,7 @@ need not match that of the opening fence:
Code fences (opening and closing) cannot contain internal spaces:
-``` ```
+``` ```
aaa
.
<p><code> </code>
@@ -1404,7 +1404,7 @@ need not match that of the opening fence:
-~~~~~~
+~~~~~~
aaa
~~~ ~~
.
@@ -1416,7 +1416,7 @@ need not match that of the opening fence:
Fenced code blocks can interrupt paragraphs, and can be followed
directly by paragraphs, without a blank line between:
-foo
+foo
```
bar
```
@@ -1431,7 +1431,7 @@ directly by paragraphs, without a blank line between:
Other blocks can also occur before and after fenced code blocks
without an intervening blank line:
-foo
+foo
---
~~~
bar
@@ -1451,7 +1451,7 @@ 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.
-```ruby
+```ruby
def foo(x)
return 3
end
@@ -1464,7 +1464,7 @@ of language- followed by the language name.
-~~~~ ruby startline=3 $%@#$
+~~~~ ruby startline=3 $%@#$
def foo(x)
return 3
end
@@ -1477,7 +1477,7 @@ of language- followed by the language name.
-````;
+````;
````
.
<pre><code class="language-;"></code></pre>
@@ -1485,7 +1485,7 @@ of language- followed by the language name.
[Info strings] for backtick code blocks cannot contain backticks:
-``` aa ```
+``` aa ```
foo
.
<p><code>aa</code>
@@ -1494,7 +1494,7 @@ of language- followed by the language name.
[Info strings] for tilde code blocks can contain backticks and tildes:
-~~~ aa ``` ~~~
+~~~ aa ``` ~~~
foo
~~~
.
@@ -1504,7 +1504,7 @@ of language- followed by the language name.
Closing code fences cannot have [info strings]:
-```
+```
``` aaa
```
.
@@ -1586,7 +1586,7 @@ the parser's state.
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:
-<table><tr><td>
+<table><tr><td>
<pre>
**Hello**,
@@ -1612,7 +1612,7 @@ of long tags inside a wrapped paragraph as starting HTML blocks.)
Some simple examples follow. Here are some basic HTML blocks
of type 6:
-<table>
+<table>
<tr>
<td>
hi
@@ -1633,7 +1633,7 @@ of type 6:
- <div>
+ <div>
*hello*
<foo><a>
.
@@ -1644,7 +1644,7 @@ of type 6:
A block can also start with a closing tag:
-</div>
+</div>
*foo*
.
</div>
@@ -1653,7 +1653,7 @@ of type 6:
Here we have two HTML blocks with a Markdown paragraph between them:
-<DIV CLASS="foo">
+<DIV CLASS="foo">
*Markdown*
@@ -1667,7 +1667,7 @@ of type 6:
The tag on the first line can be partial, as long
as it is split where there would be whitespace:
-