@kirigami/php-prepros 1.9.1 → 1.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kirigami/php-prepros",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.2",
|
|
4
4
|
"description": "PHP preprocessor for the Kirigami static site generator. Compile PHP page templates to clean, deployable HTML — with zero server dependency.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kirigami",
|
|
@@ -989,12 +989,17 @@ class MD {
|
|
|
989
989
|
// A single pass detects a contiguous block of lines that are either a
|
|
990
990
|
// bullet (-,*,+) or a numbered item, whatever their indentation level;
|
|
991
991
|
// the block is then rebuilt recursively into nested <ol>/<ul>
|
|
992
|
-
// according to the relative indentation depth.
|
|
992
|
+
// according to the relative indentation depth. An indented line with
|
|
993
|
+
// no marker of its own is a *continuation* of the previous item's
|
|
994
|
+
// text (a soft-wrapped source line) and is appended to it, not
|
|
995
|
+
// treated as the block's end — a marker-less continuation line used
|
|
996
|
+
// to fall outside the match entirely, splitting one list into two
|
|
997
|
+
// with the continuation text stranded as a stray <p> in between.
|
|
993
998
|
// Task items (already converted to <li class="task-item">) no longer
|
|
994
999
|
// match this pattern and are therefore not re-wrapped here.
|
|
995
1000
|
// ====================================================================
|
|
996
1001
|
$html = preg_replace_callback(
|
|
997
|
-
'/^([ \t]*(?:\d+\.|[-*+])[ \t]+.+(?:\n[ \t]*(?:\d+\.|[-*+])[ \t]
|
|
1002
|
+
'/^([ \t]*(?:\d+\.|[-*+])[ \t]+.+(?:\n(?:[ \t]*(?:\d+\.|[-*+])[ \t]+.+|[ \t]+\S.*))*)/m',
|
|
998
1003
|
function ($matches) {
|
|
999
1004
|
$lines = explode("\n", $matches[1]);
|
|
1000
1005
|
$items = [];
|
|
@@ -1003,6 +1008,8 @@ class MD {
|
|
|
1003
1008
|
$items[] = ['indent' => self::indentWidth($m[1]), 'type' => 'ol', 'text' => $m[3]];
|
|
1004
1009
|
} elseif (preg_match('/^([ \t]*)[-*+][ \t]+(.*)$/', $line, $m)) {
|
|
1005
1010
|
$items[] = ['indent' => self::indentWidth($m[1]), 'type' => 'ul', 'text' => $m[2]];
|
|
1011
|
+
} elseif (!empty($items) && preg_match('/^[ \t]+(\S.*)$/', $line, $m)) {
|
|
1012
|
+
$items[count($items) - 1]['text'] .= ' ' . $m[1];
|
|
1006
1013
|
}
|
|
1007
1014
|
}
|
|
1008
1015
|
if (empty($items)) return $matches[1];
|