Skip to content

Commit

Permalink
chore: String conversion on formatText
Browse files Browse the repository at this point in the history
  • Loading branch information
lajbel committed Oct 24, 2024
1 parent e92e977 commit b688ccc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gfx/formatText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ function applyCharTransform(fchar: FormattedChar, tr: CharTransform) {
if (tr.opacity != null) fchar.opacity *= tr.opacity;
}

export function compileStyledText(text: string): {
export function compileStyledText(txt: string): {
charStyleMap: Record<number, string[]>;
text: string;
} {
const charStyleMap = {} as Record<number, string[]>;
let renderText = "";
let styleStack: string[] = [];
let text = String(txt);

const emit = (ch: string) => {
if (styleStack.length > 0)
Expand Down

0 comments on commit b688ccc

Please sign in to comment.