Skip to content

Commit

Permalink
Merge pull request #4 from ls1intum/link-styling
Browse files Browse the repository at this point in the history
Style links in bold and white
  • Loading branch information
ninori9 authored Oct 29, 2024
2 parents 4e6b3fb + a617949 commit e4009fb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
7 changes: 0 additions & 7 deletions src/app/chat/chat.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,6 @@ $logo-size: 40px;
color: white;
align-self: flex-start;
border-top-left-radius: 0;

a {
color: white; // Set link text to white
font-weight: bold; // Make the link bold
text-decoration: underline; // Ensure underline
cursor: pointer; // Pointer cursor on hover
}
}

&.user {
Expand Down
4 changes: 2 additions & 2 deletions src/app/chat/chat.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export class ChatComponent implements OnInit, AfterViewChecked {
formatResponseText(text: string): string {
const withLineBreaks = text.replace(/(\d+\.\s*\*\*.*?\*\*)/g, '<br>$1');
const boldFormatted = withLineBreaks.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>');
const linkFormatted = boldFormatted.replace(/\[(.*?)\]\((.*?)\)/g, '<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>');
const linkFormatted = boldFormatted.replace(/\[(.*?)\]\((.*?)\)/g, '<a href="$2" target="_blank" rel="noopener noreferrer" class="system-link">$1</a>');
return linkFormatted;
}

Expand Down Expand Up @@ -206,7 +206,7 @@ export class ChatComponent implements OnInit, AfterViewChecked {
lastMessageElement.nativeElement.scrollIntoView({ behavior: 'smooth', block: 'end' });

setTimeout(() => {
this.chatBody!.nativeElement.scrollTop += 8;
this.chatBody!.nativeElement.scrollTop += 12;
}, 500);
}
}, 0);
Expand Down
9 changes: 8 additions & 1 deletion src/styles.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
/* You can add global styles to this file, and also import other style files */
@import "../node_modules/@ng-select/ng-select/themes/default.theme.css";
@import "../node_modules/@ng-select/ng-select/themes/default.theme.css";

.system-link {
color: white;
font-weight: bold;
text-decoration: underline;
cursor: pointer;
}

0 comments on commit e4009fb

Please sign in to comment.