aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshyPHP <s9e.dev@gmail.com>2016-07-08 07:46:53 +0200
committerJoshyPHP <s9e.dev@gmail.com>2016-07-08 07:49:10 +0200
commit24da2db987c895c474b1d0a59344a7094133f278 (patch)
tree2ba1ee4c8385ce63f99cac3a2d3acdcc45c22304
parent45ba2e9770f2f012423bfc2a831771f48357e182 (diff)
downloadforums-24da2db987c895c474b1d0a59344a7094133f278.tar
forums-24da2db987c895c474b1d0a59344a7094133f278.tar.gz
forums-24da2db987c895c474b1d0a59344a7094133f278.tar.bz2
forums-24da2db987c895c474b1d0a59344a7094133f278.tar.xz
forums-24da2db987c895c474b1d0a59344a7094133f278.zip
[ticket/14706] Updated [list] BBCode to automatically create a list item
Fixes issues with missing list items. Produces valid HTML. PHPBB3-14706
-rw-r--r--phpBB/composer.json2
-rw-r--r--phpBB/composer.lock14
-rw-r--r--phpBB/phpbb/textformatter/s9e/factory.php2
-rw-r--r--tests/text_formatter/s9e/default_formatting_test.php2
-rw-r--r--tests/text_processing/tickets_data/PHPBB3-14706.html1
-rw-r--r--tests/text_processing/tickets_data/PHPBB3-14706.txt1
6 files changed, 12 insertions, 10 deletions
diff --git a/phpBB/composer.json b/phpBB/composer.json
index 99121e0a08..4f7a86e9bb 100644
--- a/phpBB/composer.json
+++ b/phpBB/composer.json
@@ -33,7 +33,7 @@
"marc1706/fast-image-size": "1.1.*",
"paragonie/random_compat": "^1.2",
"patchwork/utf8": "1.1.*",
- "s9e/text-formatter": "^0.4.2",
+ "s9e/text-formatter": "^0.5.4",
"symfony/config": "2.8.*",
"symfony/console": "2.8.*",
"symfony/debug": "2.8.*",
diff --git a/phpBB/composer.lock b/phpBB/composer.lock
index ac0d01e648..0b6536e741 100644
--- a/phpBB/composer.lock
+++ b/phpBB/composer.lock
@@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "hash": "0a51a3b7218cbf3a5fe6621729b72c05",
- "content-hash": "396082a59d972dd35293fe73b0615e79",
+ "hash": "b0bb6560f0982ecfc8867e762faa3847",
+ "content-hash": "322b621681118fa67925d35030625dae",
"packages": [
{
"name": "bantu/ini-get-wrapper",
@@ -647,16 +647,16 @@
},
{
"name": "s9e/text-formatter",
- "version": "0.4.11",
+ "version": "0.5.4",
"source": {
"type": "git",
"url": "https://github.com/s9e/TextFormatter.git",
- "reference": "e6dc4615081b1668742076aa05d11aa0f7b00103"
+ "reference": "e9363a0d2d6ddef40200854207557c648d36d925"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/s9e/TextFormatter/zipball/e6dc4615081b1668742076aa05d11aa0f7b00103",
- "reference": "e6dc4615081b1668742076aa05d11aa0f7b00103",
+ "url": "https://api.github.com/repos/s9e/TextFormatter/zipball/e9363a0d2d6ddef40200854207557c648d36d925",
+ "reference": "e9363a0d2d6ddef40200854207557c648d36d925",
"shasum": ""
},
"require": {
@@ -703,7 +703,7 @@
"parser",
"shortcodes"
],
- "time": "2016-02-21 20:38:42"
+ "time": "2016-07-08 05:19:02"
},
{
"name": "symfony/config",
diff --git a/phpBB/phpbb/textformatter/s9e/factory.php b/phpBB/phpbb/textformatter/s9e/factory.php
index 8c273c342e..8d1c0fabfe 100644
--- a/phpBB/phpbb/textformatter/s9e/factory.php
+++ b/phpBB/phpbb/textformatter/s9e/factory.php
@@ -82,7 +82,7 @@ class factory implements \phpbb\textformatter\cache_interface
'flash' => '[FLASH={NUMBER1},{NUMBER2} width={NUMBER1;postFilter=#flashwidth} height={NUMBER2;postFilter=#flashheight} url={URL;useContent} /]',
'i' => '[I]{TEXT}[/I]',
'img' => '[IMG src={IMAGEURL;useContent}]',
- 'list' => '[LIST type={HASHMAP=1:decimal,a:lower-alpha,A:upper-alpha,i:lower-roman,I:upper-roman;optional;postFilter=#simpletext}]{TEXT}[/LIST]',
+ 'list' => '[LIST type={HASHMAP=1:decimal,a:lower-alpha,A:upper-alpha,i:lower-roman,I:upper-roman;optional;postFilter=#simpletext} #createChild=LI]{TEXT}[/LIST]',
'li' => '[* $tagName=LI]{TEXT}[/*]',
'quote' =>
"[QUOTE
diff --git a/tests/text_formatter/s9e/default_formatting_test.php b/tests/text_formatter/s9e/default_formatting_test.php
index a41e5da507..5bd1123bba 100644
--- a/tests/text_formatter/s9e/default_formatting_test.php
+++ b/tests/text_formatter/s9e/default_formatting_test.php
@@ -86,7 +86,7 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case
),
array(
'[list]no item[/list]',
- '<ul>no item</ul>'
+ '<ul><li>no item</li></ul>'
),
array(
'[*]unparsed',
diff --git a/tests/text_processing/tickets_data/PHPBB3-14706.html b/tests/text_processing/tickets_data/PHPBB3-14706.html
new file mode 100644
index 0000000000..b8f74c9e93
--- /dev/null
+++ b/tests/text_processing/tickets_data/PHPBB3-14706.html
@@ -0,0 +1 @@
+<ul><li><ol style="list-style-type: lower-alpha"><li>a</li><li>b</li><li>c</li><li>d</li><li>e</li></ol></li><li>outer</li></ul> \ No newline at end of file
diff --git a/tests/text_processing/tickets_data/PHPBB3-14706.txt b/tests/text_processing/tickets_data/PHPBB3-14706.txt
new file mode 100644
index 0000000000..8ec2e9cd35
--- /dev/null
+++ b/tests/text_processing/tickets_data/PHPBB3-14706.txt
@@ -0,0 +1 @@
+[list][list=a][*]a[*]b[*]c[*]d[*]e[/list][*]outer[/list] \ No newline at end of file