-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f1f29e
commit 700b143
Showing
12 changed files
with
86 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,47 @@ | ||
name: ci | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- "*" | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@master | ||
- uses: denoland/setup-deno@main | ||
with: | ||
deno-version: "1.x" | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: denoland/setup-deno@v1 | ||
|
||
- name: Run fmt | ||
run: | | ||
deno fmt --check | ||
- name: Run lint | ||
run: | | ||
deno lint | ||
- name: Check project | ||
run: | | ||
deno task check:types | ||
- name: Install Chromium | ||
run: deno run -A --unstable https://deno.land/x/[email protected]/install.ts | ||
env: | ||
PUPPETEER_PRODUCT: chrome | ||
|
||
- name: Run tests | ||
run: | | ||
deno task test | ||
- name: Publish package (tag only) | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: deno publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
cov_profile | ||
deno.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ CSS, syntax highlighting, and HTML sanitization. | |
## Usage | ||
|
||
```js | ||
import { CSS, render } from "https://deno.land/x/gfm/mod.ts"; | ||
import { CSS, render } from "jsr:@deno/gfm@0.6"; | ||
|
||
const markdown = ` | ||
# Hello, world! | ||
|
@@ -83,12 +83,12 @@ By default syntax highlighting for JavaScript, Markdown, and HTML is included. | |
You can include more languages importing them: | ||
|
||
```js | ||
import { CSS, render } from "https://deno.land/x/gfm/mod.ts"; | ||
import { CSS, render } from "jsr:@deno/gfm@0.6"; | ||
|
||
// Add support for TypeScript, Bash, and Rust. | ||
import "https://esm.sh/[email protected]/components/prism-typescript?no-check"; | ||
import "https://esm.sh/[email protected]/components/prism-bash?no-check"; | ||
import "https://esm.sh/[email protected]/components/prism-rust?no-check"; | ||
import "npm:[email protected]/components/prism-typescript.js"; | ||
import "npm:[email protected]/components/prism-bash.js"; | ||
import "npm:[email protected]/components/prism-rust.js"; | ||
``` | ||
|
||
A full list of supported languages is available here: | ||
|
@@ -100,7 +100,7 @@ By default, all rendering is in blocks. There are cases where one would like to | |
render some inline markdown, and this is achievable using the `inline` setting: | ||
|
||
```ts | ||
import { render } from "https://deno.land/x/gfm/mod.ts"; | ||
import { render } from "jsr:@deno/gfm@0.6"; | ||
|
||
const markdown = "My [Deno](https://deno.land) Blog"; | ||
const header = render(markdown, { inline: true }); | ||
|
@@ -113,7 +113,7 @@ By default math rendering is disabled. To enable it, you must include the | |
additional CSS and enable the `allowMath` setting: | ||
|
||
```ts | ||
import { CSS, KATEX_CSS, render } from "https://deno.land/x/gfm/mod.ts"; | ||
import { CSS, KATEX_CSS, render } from "jsr:@deno/gfm@0.6"; | ||
|
||
const markdown = ` | ||
Block math: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,23 @@ | ||
{ | ||
"name": "@deno/gfm", | ||
"version": "0.6.2", | ||
"exports": "./mod.ts", | ||
"imports": { | ||
"emoji": "jsr:@denosaurs/[email protected]", | ||
"marked": "npm:marked@^11.1", | ||
"github-slugger": "npm:github-slugger@^2.0", | ||
"marked-alert": "npm:marked-alert@^2.0", | ||
"marked-footnote": "npm:marked-footnote@^1.2", | ||
"marked-gfm-heading-id": "npm:marked-gfm-heading-id@^3.1", | ||
"prismjs": "npm:prismjs@^1.29", | ||
"sanitize-html": "npm:sanitize-html@^2.11", | ||
"he": "npm:he@^1.2", | ||
"katex": "npm:katex@^0.16", | ||
"@std/assert": "jsr:@std/assert@^0.214" | ||
}, | ||
"compilerOptions": { | ||
"lib": ["dom", "dom.iterable", "dom.asynciterable", "deno.ns"] | ||
}, | ||
"tasks": { | ||
"build": "deno run --allow-read --allow-write --allow-net --allow-run --allow-env ./style/patch.ts && deno fmt", | ||
"check:types": "deno check **/*.ts", | ||
|
@@ -11,6 +30,5 @@ | |
}, | ||
"fmt": { | ||
"exclude": ["./test/fixtures/alerts.md", "./test/fixtures/lineBreaks.md"] | ||
}, | ||
"lock": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { assertEquals, assertStringIncludes, DOMParser } from "./test_deps.ts"; | ||
import { assertEquals, assertStringIncludes } from "@std/assert"; | ||
import { DOMParser } from "https://deno.land/x/[email protected]/deno-dom-wasm.ts"; | ||
import { render, Renderer } from "../mod.ts"; | ||
|
||
Deno.test("Basic markdown", async () => { | ||
|
@@ -242,7 +243,7 @@ Deno.test( | |
|
||
Deno.test("image title and no alt", () => { | ||
const markdown = `![](image.jpg "best title")`; | ||
const expected = `<p><img src="image.jpg" title="best title" /></p>\n`; | ||
const expected = `<p><img src="image.jpg" alt="" title="best title" /></p>\n`; | ||
|
||
const html = render(markdown); | ||
assertEquals(html, expected); | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
import { Page, puppeteer } from "./test_deps.ts"; | ||
import { | ||
default as puppeteer, | ||
Page, | ||
} from "https://deno.land/x/[email protected]/mod.ts"; | ||
import { CSS, render, RenderOptions } from "../mod.ts"; | ||
|
||
type TestCase = { | ||
|