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: issue 2074 - tables are rendered differently in a list #2082

Merged
merged 1 commit into from
Dec 18, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@

export type IReplacerFunc<T> = (
componentRef: ComponentRef<T>,
...args: any[]

Check warning on line 135 in libs/markdown-flavored/src/lib/flavored-markdown.component.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
) => void;

@Component({
Expand Down Expand Up @@ -392,7 +392,7 @@
replacerFunc: IReplacerFunc<T>
): string {
let componentIndex = 0;
return markdown.replace(regExp, (...args: any[]) => {

Check warning on line 395 in libs/markdown-flavored/src/lib/flavored-markdown.component.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
const componentFactory: ComponentFactory<T> =
this._componentFactoryResolver.resolveComponentFactory(type);
const componentRef: ComponentRef<T> = componentFactory.create(
Expand Down Expand Up @@ -492,6 +492,7 @@
}

private _replaceTables(markdown: string): string {
markdown = markdown.replaceAll(' |', '');
const tableRgx =
/^ {0,3}\|?.+\|.+\n[ \t]{0,3}\|?[ \t]*:?[ \t]*(?:-|=){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:-|=){2,}[\s\S]+?(?:\n\n|~0)/gm;
return this._replaceComponent(
Expand Down Expand Up @@ -522,7 +523,7 @@
return s.trim();
});

const data: any[] = [];

Check warning on line 526 in libs/markdown-flavored/src/lib/flavored-markdown.component.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
for (let i = 2; i < dataTableLines.length; i++) {
const rowSplit: string[] = dataTableLines[i]
.split('|')
Expand All @@ -532,7 +533,7 @@
.map((s: string) => {
return s.trim();
});
const row: any = {};

Check warning on line 536 in libs/markdown-flavored/src/lib/flavored-markdown.component.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
columns.forEach((col: string, index: number) => {
const rowSplitCell: string = rowSplit[index];
if (rowSplitCell) {
Expand Down
Loading