Skip to content

Commit

Permalink
Update PHP support, wp-cli, and commonmark
Browse files Browse the repository at this point in the history
  • Loading branch information
pjeby committed Oct 12, 2024
1 parent 428bf9a commit a668cd1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -503,10 +503,12 @@ Markdown formatting is controlled by the following filters:

The current default extensions are:

* [`League\CommonMark\Ext\Table\TableExtension`](https://github.com/thephpleague/commonmark-ext-table#syntax), which implements Markdown tables,
* [`Webuni\CommonMark\AttributesExtension\AttributesExtension`](https://github.com/webuni/commonmark-attributes-extension#syntax), which allows adding Kramdown-style HTML attributes to blocks and spans, and
* [`League\CommonMark\Ext\Strikethrough\StrikethroughExtension`](https://github.com/thephpleague/commonmark-ext-strikethrough/#readme), which turns `~~`-wrapped text into `<del>` elements for strikethrough, and
* [`League\CommonMark\Ext\SmartPunct\SmartPunctExtension`](https://github.com/thephpleague/commonmark-ext-smartpunct#readme), which translates dots and hyphens to ellipses and em/en dashes, and converts plain single and double quotes to their left/right versions.
* [`League\CommonMark\Extension\Table\TableExtension`](https://commonmark.thephpleague.com/1.6/extensions/tables/#syntax), which implements Markdown tables,
* [`League\CommonMark\Extension\Attributes\AttributesExtension`](https://commonmark.thephpleague.com/1.6/extensions/attributes/#attribute-syntax), which allows adding Kramdown-style HTML attributes to blocks and spans,
* [`League\CommonMark\Extension\Strikethrough\StrikethroughExtension`](https://commonmark.thephpleague.com/1.6/extensions/strikethrough/), which turns `~~`-wrapped text into `<del>` elements for strikethrough,
* [`League\CommonMark\Extension\SmartPunct\SmartPunctExtension`](https://commonmark.thephpleague.com/1.6/extensions/smart-punctuation/), which translates dots and hyphens to ellipses and em/en dashes, and converts plain single and double quotes to their left/right versions,
* [`League\CommonMark\Extension\Autolink\AutolinkExtension`](https://commonmark.thephpleague.com/1.6/extensions/autolinks/), which supports [Github-style autolinking](https://github.github.com/gfm/#autolinks-extension-) of bare URLs and web hostnames,
* [`League\CommonMark\Extension\TaskList\TaskListExtension`](https://commonmark.thephpleague.com/1.6/extensions/task-lists/), which adds support for [Github-style task lists](https://github.github.com/gfm/#task-list-items-extension-),
* `dirtsimple\Postmark\ShortcodeParser`, which detects lines that consist solely of shortcode opening or closing tags, and passes them through without markdown interpretation. (This allows you to enclose markdown blocks within a shortcode, instead of having the shortcode become part of the block itself, which can be problematic when using e.g. conditional tags.)

* `apply_filters('postmark_markdown', string $markdown, Document $doc, $fieldName)` -- this filter can alter the markdown content of a document (or any of its front-matter fields) before it's converted into HTML. `$fieldName` is `"body"` if `$markdown` came from `$doc->body`; otherwise it is the name of the front matter field being converted. (Such as `"Excerpt"`, or any custom fields added by plugins.)
Expand Down
12 changes: 4 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,12 @@
"require": {
"dirtsimple/clean-yaml": "^0.1",
"dirtsimple/imposer": "dev-master",
"wp-cli/wp-cli": "^2",
"wp-cli/entity-command": "^2",
"wp-cli/wp-cli": "^2.11",
"wp-cli/entity-command": "^2.8",
"rarst/wpdatetime": "^0.3.0",
"league/commonmark": "^1.0",
"league/commonmark-ext-smartpunct": "^1.1",
"league/commonmark-ext-strikethrough": "^1.0",
"league/commonmark-ext-table": "^2.1",
"webuni/commonmark-attributes-extension": "^1.0",
"league/commonmark": "^1.6",
"twig/twig": "^2.4",
"symfony/yaml": "^3.4",
"php": "^7.1"
"php": ">=7.1"
}
}
10 changes: 6 additions & 4 deletions src/Formatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ protected static function formatter() {
'line_break' => "",
),
'extensions' => array(
'League\CommonMark\Ext\Table\TableExtension' => null,
'Webuni\CommonMark\AttributesExtension\AttributesExtension' => null,
'League\CommonMark\Ext\Strikethrough\StrikethroughExtension' => null,
'League\CommonMark\Ext\SmartPunct\SmartPunctExtension' => null,
'League\CommonMark\Extension\Autolink\AutolinkExtension' => null,
'League\CommonMark\Extension\Table\TableExtension' => null,
'League\CommonMark\Extension\TaskList\TaskListExtension' => null,
'League\CommonMark\Extension\Attributes\AttributesExtension' => null,
'League\CommonMark\Extension\Strikethrough\StrikethroughExtension' => null,
'League\CommonMark\Extension\SmartPunct\SmartPunctExtension' => null,
'dirtsimple\Postmark\ShortcodeParser' => null,
),
);
Expand Down
4 changes: 2 additions & 2 deletions src/Option.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
namespace dirtsimple\Postmark;

use WP_CLI\Entity\RecursiveDataStructureTraverser;
use WP_CLI\Entity\NonExistentKeyException;
use WP_CLI\Traverser\RecursiveDataStructureTraverser;
use WP_CLI\Exception\NonExistentKeyException;
use WP_CLI;

class Option {
Expand Down

0 comments on commit a668cd1

Please sign in to comment.