Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(markdown): relative href links in md and minor styling #2194

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion libs/angular/dialogs/src/dialog.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
}

::ng-deep button {
text-transform: uppercase;
margin-left: 8px;

[dir='rtl'] & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class ResizableDraggableDialog {
rightLeft = horizontalAlignment.right;

const icon: HTMLElement = this._renderer2.createElement('i');
this._renderer2.addClass(icon, 'material-icons');
this._renderer2.addClass(icon, 'material-icons-outlined');
this._renderer2.appendChild(
icon,
this._renderer2.createText('filter_list')
Expand Down
7 changes: 4 additions & 3 deletions libs/markdown/src/lib/markdown.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,14 @@ function normalizeHtmlHrefs(html: string, currentHref: string): string {
const hrefWithoutHash: string = removeTrailingHash(
link.getAttribute('href')
);

url.href = generateHref(currentHref, hrefWithoutHash);
// since this might be a relative path, don't assign it to url.href
// relative path won't be a valid href to assign to URL
const newHref = generateHref(currentHref, hrefWithoutHash);

if (originalHash) {
url.hash = genHeadingId(originalHash);
}
link.href = url.href;
link.href = newHref;
}
link.target = '_blank';
} else {
Expand Down
Loading