Skip to content

Commit

Permalink
feat: add figure & figcaption support and centering (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
crowlKats authored Sep 22, 2022
1 parent 35308c3 commit 4bdbf20
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions example/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,8 @@ function Counter() {

export const config: PageConfig = { runtimeJS: true };
```

<figure>
<img src="https://deno.land/logo.svg" />
<figcaption><b>Figure 1.</b> The deno mascot dinosaur standing in the rain.</figcaption>
</figure>
2 changes: 2 additions & 0 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ export function render(markdown: string, opts: RenderOptions = {}): string {
"video",
"svg",
"path",
"figure",
"figcaption",
]);
if (opts.allowIframes) {
allowedTags.push("iframe");
Expand Down
2 changes: 1 addition & 1 deletion style.js

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion style/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
.anchor>.octicon {
display: inline;
}

figcaption {
padding-top: 2px;
text-align: center;
}
}

.markdown-body .highlight .token, .gfm-highlight .token {
Expand Down Expand Up @@ -86,4 +91,4 @@
color: var(--color-prettylights-syntax-markup-inserted-text);
background-color: var(--color-prettylights-syntax-markup-inserted-bg);
}
}
}

0 comments on commit 4bdbf20

Please sign in to comment.