Skip to content

Commit

Permalink
Update lib.html and fix null tooltip handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
LambdAurora committed May 24, 2024
1 parent 3aa9daf commit abc34cf
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,8 @@
- Fixed inline HTML block element name from `InlineHTML` to `InlineHtml`.
- Fixed comments being badly inserted inside documents.
- Updated lib.html.

### 2.1.1

- Fixed null tooltip handling.
- Updated lib.html.
6 changes: 3 additions & 3 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion import_map.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"imports": {
"@lambdaurora/libhtml": "jsr:@lambdaurora/libhtml@^1.1.3",
"@lambdaurora/libhtml": "jsr:@lambdaurora/libhtml@^1.2.1",
"@std/assert": "jsr:@std/assert@^0.225.3",
"@std/fs": "jsr:@std/fs@^0.229.1",
"@oak/oak": "jsr:@oak/oak@^16.0.0",
Expand Down
6 changes: 5 additions & 1 deletion lib/tree/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,11 @@ export class Reference {
* @return `true` if this reference has a tooltip, or `false` otherwise.
*/
public has_tooltip(): boolean {
return this.tooltip !== undefined && this.tooltip !== "";
if (this.tooltip) {
return true;
} else {
return false;
}
}

public toString(): string {
Expand Down
18 changes: 12 additions & 6 deletions test/footnote.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,18 @@ Deno.test("Renderer > footnotes", () => {
</p>
<hr />
<ol class="footnotes">
<li id="fn:1">Simple text
<a class="footnote_src_link" href="#fn:1:src">↩</a></li>
<li id="fn:fancy-name">Fancy name footnote.
<a class="footnote_src_link" href="#fn:fancy-name:src">↩</a></li>
<li id="fn:3">Moar text
<a class="footnote_src_link" href="#fn:3:src">↩</a></li>
<li id="fn:1">
Simple text
<a class="footnote_src_link" href="#fn:1:src">↩</a>
</li>
<li id="fn:fancy-name">
Fancy name footnote.
<a class="footnote_src_link" href="#fn:fancy-name:src">↩</a>
</li>
<li id="fn:3">
Moar text
<a class="footnote_src_link" href="#fn:3:src">↩</a>
</li>
</ol>
</div>`);
});

0 comments on commit abc34cf

Please sign in to comment.