Skip to content

Commit

Permalink
Some cleanup from 0.24.0
Browse files Browse the repository at this point in the history
Resolves #2222
Resolves #2223
  • Loading branch information
Gerrit0 committed Apr 9, 2023
1 parent a6e6544 commit 0e3a892
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Unreleased

### Bug Fixes

- Improve detection for legacy JSDoc `@example` tags, #2222.
- The page footer will now appear at the bottom of the page even if the page is short, #2223.

# v0.24.0 (2023-04-08)

### Breaking Changes
Expand Down
6 changes: 5 additions & 1 deletion src/lib/converter/comments/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,11 @@ function exampleBlockContent(
const end = lexer.done() || lexer.peek();
lexer.release();

if (content.some((part) => part.kind === "code")) {
if (
content.some(
(part) => part.kind === "code" && part.text.startsWith("```")
)
) {
return blockContent(comment, lexer, config, warning);
}

Expand Down
10 changes: 1 addition & 9 deletions src/test/converter/inheritance/specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -527,17 +527,9 @@
{
"tag": "@example",
"content": [
{
"kind": "text",
"text": "This function inherited commentary from the "
},
{
"kind": "code",
"text": "`functionSource`"
},
{
"kind": "text",
"text": " function"
"text": "```ts\nThis function inherited commentary from the `functionSource` function\n```"
}
]
},
Expand Down
5 changes: 5 additions & 0 deletions src/test/converter2/issues/gh2222.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/**
* @example
* let x = `str`
*/
export const example = 1;
11 changes: 11 additions & 0 deletions src/test/issues.c2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1039,4 +1039,15 @@ describe("Issue Tests", () => {
equal(param.type?.type, "query");
equal(param.type.queryType.reflection?.name, "TypeEmitter");
});

it("#2222", () => {
const project = convert();
const example = query(project, "example");
equal(
Comment.combineDisplayParts(
example.comment?.getTag("@example")?.content
),
"```ts\nlet x = `str`\n```"
);
});
});
2 changes: 2 additions & 0 deletions static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ dd {

.container-main {
margin: 0 auto;
/* toolbar, footer, margin */
min-height: calc(100vh - 41px - 56px - 4rem);
}

@keyframes fade-in {
Expand Down

0 comments on commit 0e3a892

Please sign in to comment.