mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-28 06:52:35 +01:00
Merge pull request #1096 from ivandrofly/patch-1a
BUGFIXED + Optimization
This commit is contained in:
commit
9311167da4
@ -97,7 +97,7 @@ namespace Nikse.SubtitleEdit.Logic.Forms
|
||||
foreach (string line in lines)
|
||||
{
|
||||
int indexOfColon = line.IndexOf(':');
|
||||
if (indexOfColon > 0 && IsNotInsideBrackets(text, indexOfColon))
|
||||
if (indexOfColon > 0 && IsNotInsideBrackets(line, indexOfColon))
|
||||
{
|
||||
var pre = line.Substring(0, indexOfColon);
|
||||
var noTagPre = HtmlUtil.RemoveHtmlTags(pre, true);
|
||||
@ -338,9 +338,8 @@ namespace Nikse.SubtitleEdit.Logic.Forms
|
||||
private bool IsNotInsideBrackets(string text, int colonIdx)
|
||||
{
|
||||
// <i>♪ (THE CAPITOLS: "COOL JERK") ♪</i>
|
||||
var bIdx = text.IndexOfAny(new[] { '(', '[' });
|
||||
|
||||
if (bIdx >= 0 && bIdx < colonIdx)
|
||||
var bIdx = text.IndexOfAny(new[] { '(', '[' }, 0, colonIdx);
|
||||
if (bIdx >= 0)
|
||||
{
|
||||
char closeType = text[bIdx] == '(' ? ')' : ']';
|
||||
var nIdx = text.IndexOf(closeType, bIdx + 1);
|
||||
|
Loading…
Reference in New Issue
Block a user