Skip to content

Commit 262887d

Browse files
committed
Added docs, reversed bbPrefixes list.
1 parent 91bf1d4 commit 262887d

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

data/test_md.bb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
[https://google.com](https://google.com)
1212
[limelight](https://limelightgaming.net)
1313

14-
# this is a header
14+
[h1]this is a header[/h1]
1515

16-
## this is a l2 header
16+
[h2]this is a l2 header[/h2]

src/Converter.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,17 @@ public function __construct(string $text = null){
2828
's' => '~~',
2929
];
3030

31-
/** List of "simple" bbTags and their replacements (which act as prefixes.
31+
/** List of "simple" bbTags and their replacements (which act as prefixes).
32+
* When there are multiple prefixes which use the same character, they must be listed longest first.
3233
* @var array
3334
*/
3435
public static $bbPrefixes = [
35-
'h1' => '#',
36-
'h2' => '##',
37-
'h3' => '###',
38-
'h4' => '####',
39-
'h5' => '#####',
4036
'h6' => '######',
37+
'h5' => '#####',
38+
'h4' => '####',
39+
'h3' => '###',
40+
'h2' => '##',
41+
'h1' => '#',
4142
];
4243

4344
/** List of bbTags with attributes and their replacements.

0 commit comments

Comments
 (0)