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

chore: bump deps #94

Merged
merged 1 commit into from
Jan 30, 2024
Merged
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
8 changes: 4 additions & 4 deletions _showcase/import_map.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"imports": {
"$fresh/": "https://deno.land/x/[email protected].1/",
"preact": "https://esm.sh/[email protected].2",
"preact/": "https://esm.sh/[email protected].2/",
"$fresh/": "https://deno.land/x/[email protected].3/",
"preact": "https://esm.sh/[email protected].3",
"preact/": "https://esm.sh/[email protected].3/",
"preact-render-to-string": "https://esm.sh/*[email protected]",
"@preact/signals": "https://esm.sh/*@preact/[email protected]",
"@preact/signals-core": "https://esm.sh/*@preact/[email protected]",
"twind": "https://esm.sh/[email protected]",
"twind/": "https://esm.sh/[email protected]/",
"apiland/types": "https://deno.land/x/apiland@1.0.0/types.d.ts",
"apiland/types": "https://deno.land/x/apiland@1.7.2/types.d.ts",
"deno_doc/types": "https://deno.land/x/[email protected]/lib/types.d.ts",
"@doc_components/": "../"
}
Expand Down
2 changes: 2 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"importMap": "./_showcase/import_map.json",
"tasks": {
"check": "deno check _showcase/main.ts",
"check:types": "deno check **/*.ts && deno check **/*.tsx",
"ok": "deno fmt --check && deno lint && deno task check:types && deno task test",
"showcase": "cd _showcase && deno task start",
"test": "deno test"
}
Expand Down
8 changes: 4 additions & 4 deletions deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ export type {
TsTypeParamDef,
TsTypeTupleDef,
TsTypeUnionDef,
} from "https://deno.land/x/deno_doc@0.56.0/lib/types.d.ts";
} from "https://deno.land/x/deno_doc@0.99.0/types.d.ts";

export { toHtml } from "https://esm.sh/hast-util-to-html@8.0.3";
export * as htmlEntities from "https://esm.sh/html-entities@2.3.3";
export { lowlight } from "https://esm.sh/lowlight@2.7.0";
export { toHtml } from "https://esm.sh/hast-util-to-html@9.0.0";
export * as htmlEntities from "https://esm.sh/html-entities@2.4.0";
export { all, createLowlight } from "https://esm.sh/lowlight@3.1.0";
export {
apply,
type Configuration,
Expand Down
2 changes: 1 addition & 1 deletion deps_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
/// <reference lib="dom.asynciterable" />
/// <reference lib="deno.ns" />

export { assertEquals } from "https://deno.land/std@0.167.0/testing/asserts.ts";
export { assertEquals } from "https://deno.land/std@0.213.0/assert/assert_equals.ts";
14 changes: 13 additions & 1 deletion doc/markdown.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
// Copyright 2021-2023 the Deno authors. All rights reserved. MIT license.

import { comrak, htmlEntities, lowlight, toHtml, tw } from "../deps.ts";
import {
all,
comrak,
createLowlight,
htmlEntities,
toHtml,
tw,
} from "../deps.ts";
import { services } from "../services.ts";
import { style, type StyleKey } from "../styles.ts";
import { assert, type Child, splitMarkdownTitle, take } from "./utils.ts";
Expand All @@ -23,6 +30,8 @@ const MARKDOWN_OPTIONS: comrak.ComrakOptions = {
},
};

let lowlight: ReturnType<typeof createLowlight>;

function syntaxHighlight(html: string): string {
let match;
while ((match = CODE_BLOCK_RE.exec(html))) {
Expand Down Expand Up @@ -101,6 +110,9 @@ function parseLinks(markdown: string, url: URL, namespace?: string): string {
}

export function mdToHtml(markdown: string): string {
if (!lowlight) {
lowlight = createLowlight(all);
}
return syntaxHighlight(comrak.markdownToHTML(markdown, MARKDOWN_OPTIONS));
}

Expand Down
Loading