fix trimmed text
This commit is contained in:
@@ -15,7 +15,6 @@ export type ChordMode = 'show' | 'hide' | 'onlyFirst';
|
||||
templateUrl: './song-text.component.html',
|
||||
styleUrls: ['./song-text.component.less'],
|
||||
animations: [songSwitch],
|
||||
standalone: false,
|
||||
})
|
||||
export class SongTextComponent implements OnInit {
|
||||
public sections: Section[] = [];
|
||||
@@ -100,6 +99,15 @@ export class SongTextComponent implements OnInit {
|
||||
return this.index !== -1 && this.index !== i;
|
||||
}
|
||||
|
||||
public transform(text: string): string {
|
||||
if (this.isComment(text)) text = text.slice(1);
|
||||
return text;
|
||||
}
|
||||
|
||||
public isComment(text: string) {
|
||||
return text.startsWith('#');
|
||||
}
|
||||
|
||||
private render() {
|
||||
this.offset = 0;
|
||||
this.sections = [];
|
||||
@@ -124,13 +132,4 @@ export class SongTextComponent implements OnInit {
|
||||
return 'show';
|
||||
}
|
||||
}
|
||||
|
||||
public transform(text: string): string {
|
||||
if (this.isComment(text)) text = text.slice(1);
|
||||
return text.trim();
|
||||
}
|
||||
|
||||
public isComment(text: string) {
|
||||
return text.startsWith('#');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user