Skip to content

Commit 2161521

Browse files
authored
�Add <r><rt></rt></r> tag style.
Now `<r><rt></rt></r> ` style works, as well as `<ruby><rt></rt></ruby> `.
1 parent e1fddd6 commit 2161521

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

Assets/RubyTextMeshPro/Source/RubyTextMeshProDefinitions.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ public enum RubyShowType
1414
}
1515

1616
// ruby tag
17-
public static readonly Regex RUBY_REGEX = new Regex(
18-
@"<r(uby)?=""?(?<ruby>[\s\S]*?)""?>(?<val>[\s\S]*?)<\/r(uby)?>|<ruby>(?<base>[\s\S]*?)<rt>(?<rubyText>[\s\S]*?)<\/rt><\/ruby>"
19-
);
17+
public static readonly Regex RUBY_REGEX = new(@"<r(uby)?=""?(?<ruby>[\s\S]*?)""?>(?<val>[\s\S]*?)<\/r(uby)?>|<ruby>(?<base>[\s\S]*?)<rt>(?<rubyText>[\s\S]*?)<\/rt><\/ruby>|<r>(?<base>[\s\S]*?)<rt>(?<rubyText>[\s\S]*?)<\/rt><\/r>");
2018

2119
private static Lazy<StringBuilder> stringBuilder = new Lazy<StringBuilder>();
2220

@@ -191,4 +189,4 @@ public static string CreateRubyAfterBaseText(
191189
return $"<nobr><space={-compensationOffset}>{baseText}<space={rubyTextOffset}><voffset={targetRubyText.rubyVerticalOffset}><size={targetRubyText.rubyScale * 100f}%>{rubyText}</size></voffset><space={compensationOffset}></nobr>";
192190
}
193191
}
194-
}
192+
}

0 commit comments

Comments
 (0)