Fix support for apostrophe + s after tagging someone

This commit is contained in:
SondreB 2023-02-18 10:58:12 +01:00
parent 6bc8c0899f
commit 0391a5abcd
No known key found for this signature in database
GPG Key ID: D6CC44C75005FDBF
2 changed files with 5 additions and 3 deletions

View File

@ -68,9 +68,9 @@
<span class="event-content clickable" [ngClass]="{ 'event-content-big': content && content.length < 7 }">
<ng-container *ngFor="let token of dynamicText">
<ng-template [ngIf]="isString(token)"> {{ token }} </ng-template>
<ng-template [ngIf]="isString(token)">{{ token }}</ng-template>
<ng-template [ngIf]="!isString(token)" [ngSwitch]="token.token">
<ng-container *ngSwitchCase="'username'"><a class="reply-link" [routerLink]="['/p', token.word]">@{{ getDisplayName(token.word) }}</a> </ng-container>
<ng-container *ngSwitchCase="'username'"><a class="reply-link" [routerLink]="['/p', token.word]">@{{ getDisplayName(token.word) }}</a></ng-container>
<ng-container *ngSwitchCase="'linebreak'"><br /></ng-container>
</ng-template>

View File

@ -287,7 +287,9 @@ export class ContentComponent {
for (let index = 0; index < lines.length; index++) {
const line = lines[index];
let lineTokens = line.split(/\s+/);
//let lineTokens = line.split(/\s+/);
let lineTokens = line.split(/(\s|'s)/g);
lineTokens = lineTokens.filter((entry) => entry != '');
lineTokens.push('<br>');
tokens.push(...lineTokens);