Skip to content

Commit

Permalink
Remove Deprecated Message
Browse files Browse the repository at this point in the history
  • Loading branch information
taufik-nurrohman committed Jun 1, 2022
1 parent 1f3506d commit e82bf8f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion about.page
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Convert file and folder structure into web pages.
icon: 'M19 2L14 6.5V17.5L19 13V2M6.5 5C4.55 5 2.45 5.4 1 6.5V21.16C1 21.41 1.25 21.66 1.5 21.66C1.6 21.66 1.65 21.59 1.75 21.59C3.1 20.94 5.05 20.5 6.5 20.5C8.45 20.5 10.55 20.9 12 22C13.35 21.15 15.8 20.5 17.5 20.5C19.15 20.5 20.85 20.81 22.25 21.56C22.35 21.61 22.4 21.59 22.5 21.59C22.75 21.59 23 21.34 23 21.09V6.5C22.4 6.05 21.75 5.75 21 5.5V19C19.9 18.65 18.7 18.5 17.5 18.5C15.8 18.5 13.35 19.15 12 20V6.5C10.55 5.4 8.45 5 6.5 5Z'
author: Taufik Nurrohman
type: Markdown
version: 2.0.2
version: 2.0.3

use:
'.\lot\x\layout': 1
Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
"require": {
"mecha-cms/x.layout": "^2.0.0",
"mecha-cms/x.y-a-m-l": "^2.0.0"
},
"suggest": {
"ext-mbstring": "It would be great if `ext-mbstring` is installed. We will use other ways if `ext-mbstring` is not available."
}
}
6 changes: 3 additions & 3 deletions engine/plug/to.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Make sure to add space at the end of the block tag(s) that will be removed. To make `<p>asdf.</p><p>asdf</p>`
// becomes `asdf. asdf` and not `asdf.asdf`.
$r = 'address|article|blockquote|details|div|d[dt]|figure|(?:fig)?caption|footer|h(?:[1-6]|eader|r)|li|main|nav|p(?:re)?|section|summary|t[dh]';
$value = preg_replace(['/\s+/', '/\s*(<\/(?:' . $r . ')>)\s*/i'], [' ', '$1 '], $value);
$value = preg_replace(['/\s+/', '/\s*(<\/(?:' . $r . ')>)\s*/i'], [' ', '$1 '], $value ?? "");
$value = strip_tags($value, '<a><abbr><b><br><cite><code><del><dfn><em><i><ins><kbd><mark><q><small><span><strong><sub><sup><time><u><var>');
if (is_int($max)) {
$max = [$max, '&#x2026;'];
Expand Down Expand Up @@ -73,15 +73,15 @@
});

To::_('sentence', function(string $value = null, string $tail = '.') {
$value = trim($value);
$value = trim($value ?? "");
if (extension_loaded('mbstring')) {
return mb_strtoupper(mb_substr($value, 0, 1)) . mb_strtolower(mb_substr($value, 1)) . $tail;
}
return ucfirst(strtolower($value)) . $tail;
});

To::_('title', function(string $value = null) {
$value = w($value);
$value = w($value ?? "");
$out = extension_loaded('mbstring') ? mb_convert_case($value, MB_CASE_TITLE) : ucwords($value);
// Convert to abbreviation if all case(s) are in upper
$out = u($out) === $out ? strtr($out, [' ' => ""]) : $out;
Expand Down

0 comments on commit e82bf8f

Please sign in to comment.