Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vendeeglobe committed Jun 3, 2022
1 parent dd8736a commit 35b8ad0
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 20 deletions.
30 changes: 15 additions & 15 deletions src/formatter/class/paragrafica.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@

class Paragrafica
{
public $ignore = '/(<!--notypo-->.*?<!--\/notypo-->)/usi'; // regex to be ignored
public string $ignore = '/(<!--notypo-->.*?<!--\/notypo-->)/usi'; // regex to be ignored
// paragpaph is a chicken-feed like this: <t->text, text, just text<-t>
public $wacko;
public $t0 = [ // terminators like <-t>$1<t->
public array $toc;
public array $t0 = [ // terminators like <-t>$1<t->
'/(<br[^>]*>)(\s*<br[^>]*>)+/usi',
'/(<hr[^>]*>)/usi',
];
public $t1 = [ // terminators like <-t>$1
public array $t1 = [ // terminators like <-t>$1
[
// rightinators
'!(<(o|u)l)!si',
Expand Down Expand Up @@ -54,7 +55,7 @@ class Paragrafica
'!(</li>)!si',
],
];
public $t2 = [ // terminators like $1<t->
public array $t2 = [ // terminators like $1<t->
[
// rightinators
'!(</(o|u)l>)!si',
Expand Down Expand Up @@ -93,20 +94,20 @@ class Paragrafica
],
];

public $mark_prefix = '{:typo:markup:1:}';
public $mark1 = '{:typo:markup:1:}<:-t>'; // <-t>
public $mark2 = '{:typo:markup:1:}<:t->'; // <t->
public $mark3 = '{:typo:markup:1:}<:::>'; // (*) wronginator mark:
public string $mark_prefix = '{:typo:markup:1:}';
public string $mark1 = '{:typo:markup:1:}<:-t>'; // <-t>
public string $mark2 = '{:typo:markup:1:}<:t->'; // <t->
public string $mark3 = '{:typo:markup:1:}<:::>'; // (*) wronginator mark:

// within constructions like <t->(*).....<-t>
// & vice versa -- paragraphs should be placed
// but within <t->(*)....(*)<-t> -- shouldn't
public $mark4 = '{:typo:markup:1:}<:-:>'; // (!) ultimate wronginator mark:
public string $mark4 = '{:typo:markup:1:}<:-:>'; // (!) ultimate wronginator mark:
// paragraphs shouldn't be placed regardless to <t->(!).....<-t>

public $prefix1 = '<p id="p';
public $prefix2 = '" class="auto">';
public $postfix = '</p>';
public string $prefix1 = '<p id="p';
public string $prefix2 = '" class="auto">';
public string $postfix = '</p>';

function __construct(&$wacko)
{
Expand Down Expand Up @@ -288,7 +289,8 @@ function correct($what)
// * right here we have done "#p1249-1"
// 1. get all ^^ of this
$this->toc = [];
$what = preg_replace_callback( '!' .

return preg_replace_callback( '!' .
// [2] = depth,
// [3] = h-id,
// [4] = name
Expand All @@ -302,8 +304,6 @@ function correct($what)
"<\!--action:begin-->include\s+.*?page=\"([^\ ]+)\".*?(\s+notoc=\"?[^0]\"?)?.*?<\!--action:end-->" .
// {{include page="tag" notoc=1}}
"!ui", [&$this, 'add_toc_entry'], $what);

return $what;
}

// for further TOC creation routines
Expand Down
2 changes: 2 additions & 0 deletions src/formatter/class/post_wacko.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
class PostWacko
{
public $object;
private array $action;
private $options;

function __construct(&$object, &$options)
{
Expand Down
1 change: 1 addition & 0 deletions src/formatter/class/pre_wacko.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
class PreFormatter
{
public $object;
public string $PREREGEXP;

function __construct(&$object)
{
Expand Down
15 changes: 10 additions & 5 deletions src/formatter/class/wackoformatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,24 @@ class WackoFormatter
public $old_indent_level = 0;
public $indent_closers = [];
public $tdold_indent_level = 0;
public $auto_fn = [];
public $tdindent_closers = [];
public array $auto_fn = [];
public array $tdindent_closers = [];
public $br = 1;
public $intable = 0;
public $intablebr = 0;
public $cols = 0;
public $colors = [
public string $LONGREGEXP;
public string $MOREREGEXP;
public string $NOTLONGREGEXP;
private $tdold_indent_type;
private $old_indent_type;
public array $colors = [
'blue',
'green',
'red',
'yellow',
];
public $x11_colors = [
public array $x11_colors = [
'aliceblue',
'antiquewhite',
'aqua',
Expand Down Expand Up @@ -290,7 +295,7 @@ function __construct( &$object )
")/usm";
}

function indent_close()
function indent_close(): string
{
$result = '';

Expand Down

0 comments on commit 35b8ad0

Please sign in to comment.