1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-05 08:23:28 +02:00

Merge pull request #5614 from JoshyPHP/ticket/16072

[ticket/16072] Update s9e/text-formatter
This commit is contained in:
Marc Alexander 2019-06-03 21:06:20 +02:00
commit 730e1140e3
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995
3 changed files with 59 additions and 20 deletions

View File

@ -34,7 +34,7 @@
"marc1706/fast-image-size": "^1.1",
"paragonie/random_compat": "^1.4",
"patchwork/utf8": "^1.1",
"s9e/text-formatter": "^1.3",
"s9e/text-formatter": "^2.0",
"symfony/config": "~3.4",
"symfony/console": "~3.4",
"symfony/debug": "~3.4",

71
phpBB/composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "c098125fbe2261605adf47a875fe439b",
"content-hash": "437a262e2dc4d5d92873b9fd7fec3427",
"packages": [
{
"name": "bantu/ini-get-wrapper",
@ -798,30 +798,67 @@
"time": "2016-02-11T07:05:27+00:00"
},
{
"name": "s9e/text-formatter",
"version": "1.4.4",
"name": "s9e/regexp-builder",
"version": "1.4.3",
"source": {
"type": "git",
"url": "https://github.com/s9e/TextFormatter.git",
"reference": "504d538593350150e50c9de0a48418bb0a48e540"
"url": "https://github.com/s9e/RegexpBuilder.git",
"reference": "59d0167a909659d718f53964f7653d2c83a5f8fe"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/s9e/TextFormatter/zipball/504d538593350150e50c9de0a48418bb0a48e540",
"reference": "504d538593350150e50c9de0a48418bb0a48e540",
"url": "https://api.github.com/repos/s9e/RegexpBuilder/zipball/59d0167a909659d718f53964f7653d2c83a5f8fe",
"reference": "59d0167a909659d718f53964f7653d2c83a5f8fe",
"shasum": ""
},
"require": {
"lib-pcre": ">=7.2",
"php": ">=5.5.1"
},
"require-dev": {
"phpunit/phpunit": "<5.8"
},
"type": "library",
"autoload": {
"psr-4": {
"s9e\\RegexpBuilder\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Single-purpose library that generates regular expressions that match a list of strings.",
"homepage": "https://github.com/s9e/RegexpBuilder/",
"keywords": [
"regexp"
],
"time": "2019-04-26T17:55:23+00:00"
},
{
"name": "s9e/text-formatter",
"version": "2.0.0",
"source": {
"type": "git",
"url": "https://github.com/s9e/TextFormatter.git",
"reference": "f15541ce19e9af7eeb48b8b91b3ee93bec5f2f9b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/s9e/TextFormatter/zipball/f15541ce19e9af7eeb48b8b91b3ee93bec5f2f9b",
"reference": "f15541ce19e9af7eeb48b8b91b3ee93bec5f2f9b",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-filter": "*",
"lib-pcre": ">=7.2",
"php": ">=5.4.7"
"lib-pcre": ">=8.13",
"php": ">=7.1",
"s9e/regexp-builder": "^1.4"
},
"require-dev": {
"matthiasmullie/minify": "*",
"php-coveralls/php-coveralls": "*",
"phpunit/phpunit": "<6",
"s9e/regexp-builder": "1.*"
"phpunit/phpunit": "^7"
},
"suggest": {
"ext-curl": "Improves the performance of the MediaEmbed plugin and some JavaScript minifiers",
@ -833,6 +870,9 @@
"ext-zlib": "Enables gzip compression when scraping content via the MediaEmbed plugin"
},
"type": "library",
"extra": {
"version": "2.0.0"
},
"autoload": {
"psr-4": {
"s9e\\TextFormatter\\": "src"
@ -861,7 +901,7 @@
"parser",
"shortcodes"
],
"time": "2019-05-15T00:08:12+00:00"
"time": "2019-05-31T17:56:58+00:00"
},
{
"name": "symfony/config",
@ -1476,7 +1516,7 @@
},
{
"name": "Gert de Pagter",
"email": "BackEndTea@gmail.com"
"email": "backendtea@gmail.com"
}
],
"description": "Symfony polyfill for ctype functions",
@ -2510,8 +2550,7 @@
"authors": [
{
"name": "Michiel Rook",
"email": "mrook@php.net",
"role": "Lead"
"email": "mrook@php.net"
},
{
"name": "Phing Community",

View File

@ -14,7 +14,7 @@
namespace phpbb\textformatter\s9e;
use phpbb\textformatter\s9e\factory;
use s9e\TextFormatter\Configurator\Helpers\TemplateHelper;
use s9e\TextFormatter\Configurator\Helpers\TemplateLoader;
use s9e\TextFormatter\Configurator\Items\UnsafeTemplate;
class bbcode_merger
@ -91,9 +91,9 @@ class bbcode_merger
*/
protected function indent_template($template)
{
$dom = TemplateHelper::loadTemplate($template);
$dom = TemplateLoader::load($template);
$dom->formatOutput = true;
$template = TemplateHelper::saveTemplate($dom);
$template = TemplateLoader::save($dom);
// Remove the first level of indentation if the template starts with whitespace
if (preg_match('(^\\n +)', $template, $m))