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

Render JSDoc examples as typescript code #234143

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function getTagBodyText(
if (/^\s*[~`]{3}/m.test(text)) {
return text;
}
return '```\n' + text + '\n```';
return '```tsx\n' + text + '\n```';
}

let text = convertLinkTags(tag.text, filePathConverter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ suite('typescript.previewer', () => {
text: 'code();'
}
], noopToResource),
'*@example* \n```\ncode();\n```'
'*@example* \n```tsx\ncode();\n```'
);
});

Expand All @@ -101,7 +101,7 @@ suite('typescript.previewer', () => {
text: 'Not code\n```\ncode();\n```'
}
], noopToResource),
'*@example* \nNot code\n```\ncode();\n```'
'*@example* \nNot code\n```tsx\ncode();\n```'
);
});

Expand All @@ -113,7 +113,7 @@ suite('typescript.previewer', () => {
text: '<caption>Not code</caption>\ncode();'
}
], noopToResource),
'*@example* \nNot code\n```\ncode();\n```'
'*@example* \nNot code\n```tsx\ncode();\n```'
);
});

Expand All @@ -125,7 +125,7 @@ suite('typescript.previewer', () => {
text: '<caption>Not code</caption>\n```\ncode();\n```'
}
], noopToResource),
'*@example* \nNot code\n```\ncode();\n```'
'*@example* \nNot code\n```tsx\ncode();\n```'
);
});

Expand Down Expand Up @@ -154,7 +154,7 @@ suite('typescript.previewer', () => {
]
}
], noopToResource),
'*@example* \n```\n1 + 1 {@link foo}\n```');
'*@example* \n```tsx\n1 + 1 {@link foo}\n```');
});

test('Should render @linkcode symbol name as code', () => {
Expand Down