Skip to content

Commit 6a676af

Browse files
authored
Bug: remove new lines from multitext (#1766)
* Prevent newlines in multi-text values * Log recording sample rate
1 parent bf0a847 commit 6a676af

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

src/angular-app/bellows/shared/audio-recorder/audio-recorder.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,12 @@ export class AudioRecorderController implements angular.IController {
8888
//Stopping the media stream tracks releases the red recording indicator from browser tabs
8989
this.mediaRecorder.addEventListener("stop",
9090
() => {
91-
stream.getTracks().forEach(function(track) {
92-
track.stop();
91+
stream.getTracks().forEach(function (track) {
92+
try {
93+
console.log('Sample rate', track.getSettings().sampleRate);
94+
} finally {
95+
track.stop();
96+
}
9397
});
9498
}
9599
);

src/angular-app/languageforge/lexicon/editor/field/dc-text.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class FieldTextController implements angular.IController {
2929
fteMultiline: boolean;
3030
fteDir: string;
3131
fteFieldName: string;
32-
32+
3333
fte: any = {};
3434
textFieldValue: string = '';
3535
autocapitalize: string
@@ -72,7 +72,11 @@ export class FieldTextController implements angular.IController {
7272
}
7373

7474
inputChanged(): void {
75-
this.fteModel = FieldTextController.escapeHTML(this.textFieldValue);
75+
this.fteModel = FieldTextController
76+
.escapeHTML(this.textFieldValue);
77+
if (!this.fteMultiline) {
78+
this.fteModel = this.fteModel.replace(/\n/g, ' ');
79+
}
7680
}
7781

7882
private static unescapeHTML(str: string): string {

0 commit comments

Comments
 (0)