Skip to content

Commit

Permalink
Fix coded colon loop
Browse files Browse the repository at this point in the history
  • Loading branch information
cth-inni committed Oct 15, 2021
1 parent 084f79f commit 7a9f6b9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/ChatBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ function __construct($newObj=null)
'narrator','profilecard',
'#','##','###','####','#####','######'
];
$this->colonList = ['_CODEDCOLON_'];
$this->colonList = ['', ':'];
$this->codedColon = ['_CODEDCOLON_'];
$this->narratorList = ['Narrator','narrator','系统','旁白'];
// default setting
$oriObj = [
Expand All @@ -49,7 +50,7 @@ function __construct($newObj=null)
}
public function feed($rawData='')
{
$rawData = str_replace(['', ':'], $this->colonList, $rawData); // mass replace
$rawData = str_replace($this->colonList, $this->codedColon, $rawData); // mass replace
$this->rawData = $rawData;
$chat['casts'] = [];
$chat['lines'] = [];
Expand Down Expand Up @@ -82,7 +83,7 @@ public function feed($rawData='')
if($lineVal != $this->SettingBreakPoint)
{
$tempLine = [];
foreach($this->colonList as $colon)
foreach($this->codedColon as $colon)
{
$tempArray = explode($colon,$lineVal);
if(
Expand Down Expand Up @@ -114,7 +115,7 @@ public function feed($rawData='')
if($lineVal != $this->SettingBreakPoint)
{
$tempLine = [];
foreach($this->colonList as $colon)
foreach($this->codedColon as $colon)
{
$tempArray = explode($colon,$lineVal);
if(isset($tempArray) && count($tempArray) > 1)
Expand Down

0 comments on commit 7a9f6b9

Please sign in to comment.