fix trimmed text
This commit is contained in:
@@ -15,7 +15,6 @@ export type ChordMode = 'show' | 'hide' | 'onlyFirst';
|
|||||||
templateUrl: './song-text.component.html',
|
templateUrl: './song-text.component.html',
|
||||||
styleUrls: ['./song-text.component.less'],
|
styleUrls: ['./song-text.component.less'],
|
||||||
animations: [songSwitch],
|
animations: [songSwitch],
|
||||||
standalone: false,
|
|
||||||
})
|
})
|
||||||
export class SongTextComponent implements OnInit {
|
export class SongTextComponent implements OnInit {
|
||||||
public sections: Section[] = [];
|
public sections: Section[] = [];
|
||||||
@@ -100,6 +99,15 @@ export class SongTextComponent implements OnInit {
|
|||||||
return this.index !== -1 && this.index !== i;
|
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() {
|
private render() {
|
||||||
this.offset = 0;
|
this.offset = 0;
|
||||||
this.sections = [];
|
this.sections = [];
|
||||||
@@ -124,13 +132,4 @@ export class SongTextComponent implements OnInit {
|
|||||||
return 'show';
|
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