Commit 539dc97 yggverse
committed
1 parent 441dc1e commit 539dc97 Copy full SHA for 539dc97
File tree 5 files changed +41
-10
lines changed
5 files changed +41
-10
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,17 @@ public function isInline(): bool
58
58
59
59
public function toString (): string
60
60
{
61
- return self ::TAG . $ this ->_alt . ($ this ->_inline ? self ::TAG : null );
61
+ return $ this ->_inline ? sprintf (
62
+ '%s%s%s ' ,
63
+ self ::TAG ,
64
+ $ this ->_alt ,
65
+ self ::TAG
66
+ ) : trim (
67
+ sprintf (
68
+ '%s %s ' ,
69
+ self ::TAG ,
70
+ $ this ->_alt
71
+ )
72
+ );
62
73
}
63
74
}
Original file line number Diff line number Diff line change @@ -65,9 +65,15 @@ public function getText(): ?string
65
65
66
66
public function toString (): string
67
67
{
68
- return str_repeat (
69
- self ::TAG ,
70
- $ this ->_level
71
- ) . $ this ->_text ;
68
+ return trim (
69
+ sprintf (
70
+ '%s %s ' ,
71
+ str_repeat (
72
+ self ::TAG ,
73
+ $ this ->_level
74
+ ),
75
+ $ this ->_text
76
+ )
77
+ );
72
78
}
73
79
}
Original file line number Diff line number Diff line change @@ -116,9 +116,11 @@ public function toString(): string
116
116
$ parts [] = $ alt ;
117
117
}
118
118
119
- return implode (
120
- ' ' ,
121
- $ parts
119
+ return trim (
120
+ implode (
121
+ ' ' ,
122
+ $ parts
123
+ )
122
124
);
123
125
}
124
126
}
Original file line number Diff line number Diff line change @@ -39,6 +39,12 @@ public function Item(): ?string
39
39
40
40
public function toString (): string
41
41
{
42
- return self ::TAG . ' ' . $ this ->_item ;
42
+ return trim (
43
+ sprintf (
44
+ '%s %s ' ,
45
+ self ::TAG ,
46
+ $ this ->_item
47
+ )
48
+ );
43
49
}
44
50
}
Original file line number Diff line number Diff line change @@ -39,6 +39,12 @@ public function getText(): ?string
39
39
40
40
public function toString (): string
41
41
{
42
- return self ::TAG . ' ' . $ this ->_text ;
42
+ return trim (
43
+ sprintf (
44
+ '%s %s ' ,
45
+ self ::TAG ,
46
+ $ this ->_text
47
+ )
48
+ );
43
49
}
44
50
}
You can’t perform that action at this time.
0 commit comments