Skip to content

Commit d45a244

Browse files
committed
Merge remote-tracking branch 'origin/main' into ossobuffo-main
2 parents c4d73a9 + 3da3a97 commit d45a244

File tree

370 files changed

+862
-30499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

370 files changed

+862
-30499
lines changed

docs/1.6/security.md

Lines changed: 0 additions & 92 deletions
This file was deleted.

docs/1.6/basic-usage.md renamed to docs/1.x/basic-usage.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
layout: default
33
title: Basic Usage
44
description: Basic usage of the CommonMark parser
5+
redirect_from: /1.6/basic-usage/
56
---
67

78
# Basic Usage
@@ -32,7 +33,7 @@ echo $converter->convertToHtml('# Hello World!');
3233
// <h1>Hello World!</h1>
3334
```
3435

35-
Or you can use the generic `MarkdownConverter` class to customize [the environment](/1.6/customization/environment/) with whatever extensions you wish to use:
36+
Or you can use the generic `MarkdownConverter` class to customize [the environment](/1.x/customization/environment/) with whatever extensions you wish to use:
3637

3738
```php
3839
require __DIR__ . '/vendor/autoload.php';
@@ -56,9 +57,9 @@ echo $converter->convertToHtml('**Hello World!**');
5657
```
5758

5859
<i class="fa fa-exclamation-triangle"></i>
59-
**Important:** See the [security](/1.6/security/) section for important details on avoiding security misconfigurations.
60+
**Important:** See the [security](/1.x/security/) section for important details on avoiding security misconfigurations.
6061

61-
[Additional customization](/1.6/customization/overview/) is also possible, and we have many handy [extensions](/1.6/extensions/overview/) to enable additional syntax and features.
62+
[Additional customization](/1.x/customization/overview/) is also possible, and we have many handy [extensions](/1.x/extensions/overview/) to enable additional syntax and features.
6263

6364
## Supported Character Encodings
6465

docs/1.6/changelog.md renamed to docs/1.x/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
layout: default
33
title: Changelog
44
description: Important changes made in recent releases
5+
redirect_from: /1.6/changelog/
56
---
67

78
# Changelog

docs/1.6/command-line.md renamed to docs/1.x/command-line.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: default
33
title: Command Line
4-
redirect_from: /command-line/
4+
redirect_from: /1.6/command-line/
55
---
66

77
# Command Line

docs/1.6/configuration.md renamed to docs/1.x/configuration.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: default
33
title: Configuration
4+
redirect_from: /1.6/configuration/
45
---
56

67
# Configuration
@@ -40,7 +41,7 @@ $converter = new CommonMarkConverter($config);
4041
$converter = new GithubFlavoredMarkdownConverter($config);
4142
```
4243

43-
Otherwise, if you're using `MarkdownConverter` to customize the extensions in your parser, pass the configuration into the [Environment](/1.6/customization/environment/)'s `mergeConfig()` method instead:
44+
Otherwise, if you're using `MarkdownConverter` to customize the extensions in your parser, pass the configuration into the [Environment](/1.x/customization/environment/)'s `mergeConfig()` method instead:
4445

4546
```php
4647
use League\CommonMark\Environment;
@@ -78,7 +79,7 @@ Here's a list of currently-supported options:
7879
- `allow_unsafe_links` - Remove risky link and image URLs by setting this to `false` (default: `true`)
7980
- `max_nesting_level` - The maximum nesting level for blocks (default: `PHP_INT_MAX`). Setting this to a positive integer can help protect against long parse times and/or segfaults if blocks are too deeply-nested. Added in 0.17.
8081

81-
Additional configuration options are available for some of the [available extensions](/1.6/customization/extensions/) - refer to their individual documentation for more details.
82+
Additional configuration options are available for some of the [available extensions](/1.x/customization/extensions/) - refer to their individual documentation for more details.
8283

8384
## Environment
8485

@@ -89,4 +90,4 @@ The `Environment` also exposes two methods for managing the configuration:
8990
- `mergeConfig(array $config)` - Recursively merge the current configuration with the given options
9091
- `getConfig(string $key, $default = null)` - Returns the config value. For nested configs, use a `/`-separate path; for example: `renderer/soft_break`
9192

92-
[Learn more about customizing the Environment](/1.6/customization/environment/)
93+
[Learn more about customizing the Environment](/1.x/customization/environment/)

docs/1.6/customization/abstract-syntax-tree.md renamed to docs/1.x/customization/abstract-syntax-tree.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
layout: default
33
title: Abstract Syntax Tree
44
description: Using the Abstract Syntax Tree (AST) to manipulate the parsed content
5+
redirect_from: /1.6/customization/abstract-syntax-tree/
56
---
67

78
# Abstract Syntax Tree
@@ -13,7 +14,7 @@ This library uses a doubly-linked list Abstract Syntax Tree (AST) to represent t
1314
The root node of the AST will always be a `Document` object. You can obtain this node a few different ways:
1415

1516
- By calling the `parse()` method on the `DocParser`
16-
- By calling the `getDocument()` method on either the `DocumentPreParsedEvent` or `DocumentParsedEvent` (see the [Event Dispatcher documentation](/1.6/customization/event-dispatcher/))
17+
- By calling the `getDocument()` method on either the `DocumentPreParsedEvent` or `DocumentParsedEvent` (see the [Event Dispatcher documentation](/1.x/customization/event-dispatcher/))
1718

1819
## Traversal
1920

@@ -57,4 +58,4 @@ The following methods can be used to modify the AST:
5758

5859
## `DocumentParsedEvent`
5960

60-
The best way to access and manipulate the AST is by adding an [event listener](/1.6/customization/event-dispatcher/) for the `DocumentParsedEvent`.
61+
The best way to access and manipulate the AST is by adding an [event listener](/1.x/customization/event-dispatcher/) for the `DocumentParsedEvent`.

docs/1.6/customization/block-parsing.md renamed to docs/1.x/customization/block-parsing.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
layout: default
33
title: Block Parsing
44
description: How to parse block-level elements
5+
redirect_from: /1.6/customization/block-parsing/
56
---
67

78
# Block Parsing
@@ -19,11 +20,11 @@ When parsing a new line, the `DocParser` iterates through all registered block p
1920
### Parameters
2021

2122
- `ContextInterface $context` - Provides information about the current context of the DocParser. Includes access to things like the document, current block container, and more.
22-
- `Cursor $cursor` - The [`Cursor`](/1.6/customization/cursor/) encapsulates the current state of the line being parsed and provides helpers for looking around the current position.
23+
- `Cursor $cursor` - The [`Cursor`](/1.x/customization/cursor/) encapsulates the current state of the line being parsed and provides helpers for looking around the current position.
2324

2425
### Return value
2526

26-
`parse()` should return `false` if it's unable to handle the current line for any reason. (The [`Cursor`](/1.6/customization/cursor/) state should be restored before returning false if modified). Other parsers will then have a chance to try parsing the line. If all registered parsers return false, the line will be parsed as text.
27+
`parse()` should return `false` if it's unable to handle the current line for any reason. (The [`Cursor`](/1.x/customization/cursor/) state should be restored before returning false if modified). Other parsers will then have a chance to try parsing the line. If all registered parsers return false, the line will be parsed as text.
2728

2829
Returning `true` tells the engine that you've successfully parsed the block at the given position. It is your responsibility to:
2930

docs/1.6/customization/block-rendering.md renamed to docs/1.x/customization/block-rendering.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
layout: default
33
title: Block Rendering
44
description: How to customize the rendering of block-level elements
5+
redirect_from: /1.6/customization/block-rendering/
56
---
67

78
# Block Rendering

docs/1.6/customization/cursor.md renamed to docs/1.x/customization/cursor.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
layout: default
33
title: Cursor
44
description: Using the Cursor object to parse Markdown content
5+
redirect_from: /1.6/customization/cursor/
56
---
67

78
# Cursor
@@ -22,7 +23,7 @@ use League\CommonMark\Cursor;
2223
$cursor = new Cursor('Hello World!');
2324
```
2425

25-
Or, if you're creating a custom [block parser](/1.6/customization/block-parsing/) or [inline parser](/1.6/customization/inline-parsing/), a pre-configured `Cursor` will be provided to you with (with the `Cursor` already set to the current `position` trying to be parsed).
26+
Or, if you're creating a custom [block parser](/1.x/customization/block-parsing/) or [inline parser](/1.x/customization/inline-parsing/), a pre-configured `Cursor` will be provided to you with (with the `Cursor` already set to the current `position` trying to be parsed).
2627

2728
## Methods
2829

docs/1.6/customization/delimiter-processing.md renamed to docs/1.x/customization/delimiter-processing.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
layout: default
33
title: Delimiter Processing
44
description: Processing CommonMark delimiter runs with a custom processor
5+
redirect_from: /1.6/customization/delimiter-processing/
56
---
67

78
# Delimiter Processing
@@ -17,11 +18,11 @@ Delimiter runs are a special type of inline:
1718
This is an example of **emphasis**. Note how the text is *wrapped* with the same character(s) before and after.
1819
```
1920

20-
When implementing something with these characteristics you should consider leveraging delimiter runs; otherwise, a basic [inline parser](/1.6/inline-parsing/) should be sufficient.
21+
When implementing something with these characteristics you should consider leveraging delimiter runs; otherwise, a basic [inline parser](/1.x/customization/inline-parsing/) should be sufficient.
2122

2223
## Delimiter Priority
2324

24-
Delimiter processors have a lower priority than inline parsers - if an [inline parser](/1.6/inline-parsing/) successfully handles the same special character you're interested in then your delimiter processor will not be called.
25+
Delimiter processors have a lower priority than inline parsers - if an [inline parser](/1.x/customization/inline-parsing/) successfully handles the same special character you're interested in then your delimiter processor will not be called.
2526

2627
## Implementing Standalone Delimiter Processors
2728

@@ -75,7 +76,7 @@ Note that `$opener` and `$closer` will be automatically removed for you after th
7576

7677
## Combining Inline Parsers with Delimiter Processors
7778

78-
Basic delimiter processors, as covered above, do not require any custom inline parsers - they'll "just work". But in some rare cases you may want to pair it with a custom [inline parser](/1.6/customization/inline-parsing/): the inline parser will identify the delimiter, adding an entry to the delimiter stack for the processor to process later. Note that this is an advanced use case and you probably don't need this. But if you do then read on.
79+
Basic delimiter processors, as covered above, do not require any custom inline parsers - they'll "just work". But in some rare cases you may want to pair it with a custom [inline parser](/1.x/customization/inline-parsing/): the inline parser will identify the delimiter, adding an entry to the delimiter stack for the processor to process later. Note that this is an advanced use case and you probably don't need this. But if you do then read on.
7980

8081
### Inline Parsers and the Delimiter Stack
8182

0 commit comments

Comments
 (0)