mirror of
https://tildegit.org/sbgodin/HtmGem.git
synced 2023-08-25 13:53:12 +02:00
Adds strict_types=1
This commit is contained in:
parent
f4e71cb2b6
commit
26ad4f7d98
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
require_once "lib-htmgem.inc.php";
|
||||
require_once "lib-html.inc.php";
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace htmgem;
|
||||
|
||||
@ -33,10 +33,10 @@ function gemtextParser($fileContents) {
|
||||
yield array("mode" => "^^^");
|
||||
} elseif ("#" == $line1) {
|
||||
preg_match("/^(#{1,3})\s*(.+)?/", $line, $matches);
|
||||
yield array("mode" => $matches[1], "title" => trim(@$matches[2]));
|
||||
yield array("mode" => $matches[1], "title" => trim($matches[2]??""));
|
||||
} elseif ("=>" == $line2) {
|
||||
preg_match("/^=>\s*([^\s]+)(?:\s+(.*))?$/", $line, $matches);
|
||||
yield array("mode" => "=>", "link" => trim(@$matches[1]), "text" => trim(@$matches[2]));
|
||||
yield array("mode" => "=>", "link" => trim($matches[1]??""), "text" => trim($matches[2]??""));
|
||||
} elseif ("```" == $line3) {
|
||||
preg_match("/^```\s*(.*)$/", $line, $matches);
|
||||
$current = array("mode" => "```", "alt" => trim($matches[1]), "texts" => array());
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace htmgem\html;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user