From a16100895ce28850c8e77a56167ac66c76d9f820 Mon Sep 17 00:00:00 2001 From: Eloc <42568538+elocremarc@users.noreply.github.com> Date: Sat, 12 Aug 2023 14:20:50 -0700 Subject: [PATCH 01/14] preview-markdown init --- src/media.rs | 5 +++-- src/subcommand/server.rs | 35 ++++++++++++++++++++++++++++++++- src/templates/preview.rs | 5 +++++ static/preview-markdown.js | 15 ++++++++++++++ templates/preview-markdown.html | 10 ++++++++++ 5 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 static/preview-markdown.js create mode 100644 templates/preview-markdown.html diff --git a/src/media.rs b/src/media.rs index 7f4647b8a3..7af1c66e8d 100644 --- a/src/media.rs +++ b/src/media.rs @@ -11,6 +11,7 @@ pub(crate) enum Media { Image, Model, Pdf, + Markdown, Text, Unknown, Video, @@ -40,8 +41,8 @@ impl Media { ("text/html", Media::Iframe, &[]), ("text/html;charset=utf-8", Media::Iframe, &["html"]), ("text/javascript", Media::Text, &["js"]), - ("text/markdown", Media::Text, &[]), - ("text/markdown;charset=utf-8", Media::Text, &["md"]), + ("text/markdown", Media::Markdown, &[]), + ("text/markdown;charset=utf-8", Media::Markdown, &["md"]), ("text/plain", Media::Text, &[]), ("text/plain;charset=utf-8", Media::Text, &["txt"]), ("video/mp4", Media::Video, &["mp4"]), diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs index 7ca59b7714..49cae5417c 100644 --- a/src/subcommand/server.rs +++ b/src/subcommand/server.rs @@ -10,7 +10,7 @@ use { crate::templates::{ BlockHtml, ClockSvg, HomeHtml, InputHtml, InscriptionHtml, InscriptionJson, InscriptionsBlockHtml, InscriptionsHtml, InscriptionsJson, OutputHtml, OutputJson, PageContent, - PageHtml, PreviewAudioHtml, PreviewImageHtml, PreviewModelHtml, PreviewPdfHtml, + PageHtml, PreviewAudioHtml, PreviewImageHtml, PreviewModelHtml, PreviewPdfHtml, PreviewMarkdownHtml, PreviewTextHtml, PreviewUnknownHtml, PreviewVideoHtml, RangeHtml, RareTxt, SatHtml, SatJson, TransactionHtml, }, @@ -963,6 +963,16 @@ impl Server { ) .into_response(), ), + Media::Markdown => Ok( + ( + [( + header::CONTENT_SECURITY_POLICY, + "default-src 'self' https://cdn.jsdelivr.net", + )], + PreviewMarkdownHtml { inscription_id }, + ) + .into_response(), + ), Media::Text => { let content = inscription .body() @@ -2558,6 +2568,29 @@ mod tests { ); } + #[test] + fn markdown_preview() { + let server = TestServer::new_with_regtest(); + server.mine_blocks(1); + + let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { + inputs: &[(1, 0, 0)], + witness: inscription("text/markdown", "hello").to_witness(), + ..Default::default() + }); + let inscription_id = InscriptionId::from(txid); + + server.mine_blocks(1); + + server.assert_response_regex( + format!("/preview/{inscription_id}"), + StatusCode::OK, + format!(r".*
.*"), + ); + } + + + #[test] fn image_preview() { let server = TestServer::new_with_regtest(); diff --git a/src/templates/preview.rs b/src/templates/preview.rs index 74cb0261dd..93e07246cf 100644 --- a/src/templates/preview.rs +++ b/src/templates/preview.rs @@ -20,6 +20,11 @@ pub(crate) struct PreviewPdfHtml { pub(crate) inscription_id: InscriptionId, } +#[derive(boilerplate::Boilerplate)] +pub(crate) struct PreviewMarkdownHtml { + pub(crate) inscription_id: InscriptionId, +} + #[derive(boilerplate::Boilerplate)] pub(crate) struct PreviewTextHtml<'a> { pub(crate) text: &'a str, diff --git a/static/preview-markdown.js b/static/preview-markdown.js new file mode 100644 index 0000000000..f5e886f14d --- /dev/null +++ b/static/preview-markdown.js @@ -0,0 +1,15 @@ +import marked from 'https://cdn.jsdelivr.net/npm/marked/marked.min.js'; + +async function renderMarkdown() { + const contentDiv = document.getElementById('content'); + + const inscriptionId = contentDiv.dataset.inscription; + const response = await fetch(`/content/${inscriptionId}`); + const markdownContent = await response.text(); + + const htmlContent = marked.parse(markdownContent); + + contentDiv.innerHTML = htmlContent; +} + +window.addEventListener('DOMContentLoaded', renderMarkdown); diff --git a/templates/preview-markdown.html b/templates/preview-markdown.html new file mode 100644 index 0000000000..e26d4e908b --- /dev/null +++ b/templates/preview-markdown.html @@ -0,0 +1,10 @@ + + + + + + + +
+ + From bf353b86faf670c74ea91e2d22db7efe95aa5b9a Mon Sep 17 00:00:00 2001 From: Eloc <42568538+elocremarc@users.noreply.github.com> Date: Sun, 3 Sep 2023 21:29:34 -0700 Subject: [PATCH 02/14] Fixed build, added Dompurify, Marked working --- src/subcommand/server.rs | 6 +++--- src/templates.rs | 2 +- static/preview-markdown.css | 4 ++++ static/preview-markdown.js | 11 ++++++----- templates/preview-markdown.html | 3 ++- 5 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 static/preview-markdown.css diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs index 49cae5417c..555517880f 100644 --- a/src/subcommand/server.rs +++ b/src/subcommand/server.rs @@ -966,9 +966,9 @@ impl Server { Media::Markdown => Ok( ( [( - header::CONTENT_SECURITY_POLICY, - "default-src 'self' https://cdn.jsdelivr.net", - )], + header::CONTENT_SECURITY_POLICY, + "script-src-elem 'self' https://cdn.jsdelivr.net", + )], PreviewMarkdownHtml { inscription_id }, ) .into_response(), diff --git a/src/templates.rs b/src/templates.rs index 7df7f4442a..11f3fdc9e9 100644 --- a/src/templates.rs +++ b/src/templates.rs @@ -12,7 +12,7 @@ pub(crate) use { output::{OutputHtml, OutputJson}, page_config::PageConfig, preview::{ - PreviewAudioHtml, PreviewImageHtml, PreviewModelHtml, PreviewPdfHtml, PreviewTextHtml, + PreviewAudioHtml, PreviewImageHtml, PreviewModelHtml, PreviewPdfHtml, PreviewMarkdownHtml, PreviewTextHtml, PreviewUnknownHtml, PreviewVideoHtml, }, range::RangeHtml, diff --git a/static/preview-markdown.css b/static/preview-markdown.css new file mode 100644 index 0000000000..ed33c23dec --- /dev/null +++ b/static/preview-markdown.css @@ -0,0 +1,4 @@ + html { + color: #98a3ad; + background-color: #131516; +} diff --git a/static/preview-markdown.js b/static/preview-markdown.js index f5e886f14d..3db35bc680 100644 --- a/static/preview-markdown.js +++ b/static/preview-markdown.js @@ -1,15 +1,16 @@ -import marked from 'https://cdn.jsdelivr.net/npm/marked/marked.min.js'; +import { marked } from 'https://cdn.jsdelivr.net/npm/marked@8.0.0/+esm' +import DOMPurify from 'https://cdn.jsdelivr.net/npm/dompurify@3.0.5/+esm' async function renderMarkdown() { const contentDiv = document.getElementById('content'); const inscriptionId = contentDiv.dataset.inscription; const response = await fetch(`/content/${inscriptionId}`); - const markdownContent = await response.text(); + const rawMarkdown = await response.text(); - const htmlContent = marked.parse(markdownContent); - - contentDiv.innerHTML = htmlContent; + const html = DOMPurify.sanitize(marked.parse(rawMarkdown)); + + contentDiv.innerHTML = html; } window.addEventListener('DOMContentLoaded', renderMarkdown); diff --git a/templates/preview-markdown.html b/templates/preview-markdown.html index e26d4e908b..9d608a77c9 100644 --- a/templates/preview-markdown.html +++ b/templates/preview-markdown.html @@ -2,9 +2,10 @@ - +
+ From 5c75775e6d0c2a01b6d1850432f7205689e94635 Mon Sep 17 00:00:00 2001 From: Eloc <42568538+elocremarc@users.noreply.github.com> Date: Sun, 3 Sep 2023 23:03:17 -0700 Subject: [PATCH 03/14] Fix lint issue --- src/subcommand/server.rs | 38 ++++++++++++++++----------------- src/templates.rs | 4 ++-- static/preview-markdown.js | 3 ++- templates/preview-markdown.html | 10 ++++----- 4 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs index 555517880f..9e2a1b82eb 100644 --- a/src/subcommand/server.rs +++ b/src/subcommand/server.rs @@ -10,9 +10,9 @@ use { crate::templates::{ BlockHtml, ClockSvg, HomeHtml, InputHtml, InscriptionHtml, InscriptionJson, InscriptionsBlockHtml, InscriptionsHtml, InscriptionsJson, OutputHtml, OutputJson, PageContent, - PageHtml, PreviewAudioHtml, PreviewImageHtml, PreviewModelHtml, PreviewPdfHtml, PreviewMarkdownHtml, - PreviewTextHtml, PreviewUnknownHtml, PreviewVideoHtml, RangeHtml, RareTxt, SatHtml, SatJson, - TransactionHtml, + PageHtml, PreviewAudioHtml, PreviewImageHtml, PreviewMarkdownHtml, PreviewModelHtml, + PreviewPdfHtml, PreviewTextHtml, PreviewUnknownHtml, PreviewVideoHtml, RangeHtml, RareTxt, + SatHtml, SatJson, TransactionHtml, }, axum::{ body, @@ -966,9 +966,9 @@ impl Server { Media::Markdown => Ok( ( [( - header::CONTENT_SECURITY_POLICY, - "script-src-elem 'self' https://cdn.jsdelivr.net", - )], + header::CONTENT_SECURITY_POLICY, + "script-src-elem 'self' https://cdn.jsdelivr.net", + )], PreviewMarkdownHtml { inscription_id }, ) .into_response(), @@ -2572,24 +2572,22 @@ mod tests { fn markdown_preview() { let server = TestServer::new_with_regtest(); server.mine_blocks(1); - + let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { - inputs: &[(1, 0, 0)], - witness: inscription("text/markdown", "hello").to_witness(), - ..Default::default() - }); - let inscription_id = InscriptionId::from(txid); - + inputs: &[(1, 0, 0)], + witness: inscription("text/markdown", "hello").to_witness(), + ..Default::default() + }); + let inscription_id = InscriptionId { txid, index: 0 }; + server.mine_blocks(1); - + server.assert_response_regex( - format!("/preview/{inscription_id}"), - StatusCode::OK, - format!(r".*
.*"), - ); + format!("/preview/{inscription_id}"), + StatusCode::OK, + format!(r".*
.*"), + ); } - - #[test] fn image_preview() { diff --git a/src/templates.rs b/src/templates.rs index 11f3fdc9e9..7967b7dffa 100644 --- a/src/templates.rs +++ b/src/templates.rs @@ -12,8 +12,8 @@ pub(crate) use { output::{OutputHtml, OutputJson}, page_config::PageConfig, preview::{ - PreviewAudioHtml, PreviewImageHtml, PreviewModelHtml, PreviewPdfHtml, PreviewMarkdownHtml, PreviewTextHtml, - PreviewUnknownHtml, PreviewVideoHtml, + PreviewAudioHtml, PreviewImageHtml, PreviewMarkdownHtml, PreviewModelHtml, PreviewPdfHtml, + PreviewTextHtml, PreviewUnknownHtml, PreviewVideoHtml, }, range::RangeHtml, rare::RareTxt, diff --git a/static/preview-markdown.js b/static/preview-markdown.js index 3db35bc680..10f38d91b8 100644 --- a/static/preview-markdown.js +++ b/static/preview-markdown.js @@ -2,7 +2,8 @@ import { marked } from 'https://cdn.jsdelivr.net/npm/marked@8.0.0/+esm' import DOMPurify from 'https://cdn.jsdelivr.net/npm/dompurify@3.0.5/+esm' async function renderMarkdown() { - const contentDiv = document.getElementById('content'); + const divElements = document.getElementsByTagName('div'); + const contentDiv = divElements[0]; const inscriptionId = contentDiv.dataset.inscription; const response = await fetch(`/content/${inscriptionId}`); diff --git a/templates/preview-markdown.html b/templates/preview-markdown.html index 9d608a77c9..77d9051917 100644 --- a/templates/preview-markdown.html +++ b/templates/preview-markdown.html @@ -1,11 +1,11 @@ - + - - + + -
- +
+ From 5382ab61f96130843dc50dd3bb27fab4289395a7 Mon Sep 17 00:00:00 2001 From: Eloc <42568538+elocremarc@users.noreply.github.com> Date: Mon, 4 Sep 2023 00:33:32 -0700 Subject: [PATCH 04/14] update recursion.md for markdown --- docs/src/inscriptions/recursion.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/src/inscriptions/recursion.md b/docs/src/inscriptions/recursion.md index d11e1bef99..f80f013824 100644 --- a/docs/src/inscriptions/recursion.md +++ b/docs/src/inscriptions/recursion.md @@ -20,6 +20,10 @@ This has a number of interesting use-cases: inscribed as individual images, or in a shared texture atlas, and then combined, collage-style, in unique combinations in multiple inscriptions. +- Markdown documents that reference other inscriptions + - Images: `![alt text](/content/)` + - Links: `[link text](/content/)` + A few other endpoints that inscriptions may access are the following: - `/blockheight`: latest block height. From 914ea28d2af90547d462be93b8a59733a46ea5e0 Mon Sep 17 00:00:00 2001 From: Eloc <42568538+elocremarc@users.noreply.github.com> Date: Mon, 4 Sep 2023 17:40:31 -0700 Subject: [PATCH 05/14] fix lint/test from PR (#2353) --- src/subcommand/server.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs index 9e2a1b82eb..bb4aea94b9 100644 --- a/src/subcommand/server.rs +++ b/src/subcommand/server.rs @@ -2574,8 +2574,7 @@ mod tests { server.mine_blocks(1); let txid = server.bitcoin_rpc_server.broadcast_tx(TransactionTemplate { - inputs: &[(1, 0, 0)], - witness: inscription("text/markdown", "hello").to_witness(), + inputs: &[(1, 0, 0, inscription("text/markdown", "hello").to_witness())], ..Default::default() }); let inscription_id = InscriptionId { txid, index: 0 }; From 405c6908745e0a3dfced65c661c10cd335a49600 Mon Sep 17 00:00:00 2001 From: Eloc <42568538+elocremarc@users.noreply.github.com> Date: Wed, 6 Sep 2023 01:13:20 -0700 Subject: [PATCH 06/14] style tweaks --- static/preview-markdown.css | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/static/preview-markdown.css b/static/preview-markdown.css index ed33c23dec..8e4f519577 100644 --- a/static/preview-markdown.css +++ b/static/preview-markdown.css @@ -1,4 +1,16 @@ html { color: #98a3ad; background-color: #131516; + max-width: 900px; + margin: 0 auto; + font-family: + system-ui, + -apple-system, /* Firefox supports this but not yet `system-ui` */ + 'Segoe UI', + Roboto, + Helvetica, + Arial, + sans-serif, + 'Apple Color Emoji', + 'Segoe UI Emoji'; /* 2 */ } From 61141d1e3f7c643eeab53db506d487ef4dfbef9f Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 19 Sep 2023 11:05:47 -0700 Subject: [PATCH 07/14] Remove mention in recursion.md --- docs/src/inscriptions/recursion.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/src/inscriptions/recursion.md b/docs/src/inscriptions/recursion.md index f80f013824..d11e1bef99 100644 --- a/docs/src/inscriptions/recursion.md +++ b/docs/src/inscriptions/recursion.md @@ -20,10 +20,6 @@ This has a number of interesting use-cases: inscribed as individual images, or in a shared texture atlas, and then combined, collage-style, in unique combinations in multiple inscriptions. -- Markdown documents that reference other inscriptions - - Images: `![alt text](/content/)` - - Links: `[link text](/content/)` - A few other endpoints that inscriptions may access are the following: - `/blockheight`: latest block height. From 0f4c5ae7f09b3f9ec72369f03187ec8493e73ef1 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 19 Sep 2023 11:13:44 -0700 Subject: [PATCH 08/14] Simplify font-family --- static/preview-markdown.css | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/static/preview-markdown.css b/static/preview-markdown.css index 8e4f519577..f7676f18ba 100644 --- a/static/preview-markdown.css +++ b/static/preview-markdown.css @@ -3,14 +3,5 @@ background-color: #131516; max-width: 900px; margin: 0 auto; - font-family: - system-ui, - -apple-system, /* Firefox supports this but not yet `system-ui` */ - 'Segoe UI', - Roboto, - Helvetica, - Arial, - sans-serif, - 'Apple Color Emoji', - 'Segoe UI Emoji'; /* 2 */ + font-family: system-ui, sans-serif; } From 884a64c2102ff0512689fde079dae1ff9c7d0ca7 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 19 Sep 2023 11:13:55 -0700 Subject: [PATCH 09/14] Simplify JS --- static/preview-markdown.js | 19 ++++--------------- templates/preview-markdown.html | 5 ++--- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/static/preview-markdown.js b/static/preview-markdown.js index 10f38d91b8..472b20cd8a 100644 --- a/static/preview-markdown.js +++ b/static/preview-markdown.js @@ -1,17 +1,6 @@ import { marked } from 'https://cdn.jsdelivr.net/npm/marked@8.0.0/+esm' -import DOMPurify from 'https://cdn.jsdelivr.net/npm/dompurify@3.0.5/+esm' -async function renderMarkdown() { - const divElements = document.getElementsByTagName('div'); - const contentDiv = divElements[0]; - - const inscriptionId = contentDiv.dataset.inscription; - const response = await fetch(`/content/${inscriptionId}`); - const rawMarkdown = await response.text(); - - const html = DOMPurify.sanitize(marked.parse(rawMarkdown)); - - contentDiv.innerHTML = html; -} - -window.addEventListener('DOMContentLoaded', renderMarkdown); +const inscription = document.documentElement.dataset.inscription; +const response = await fetch(`/content/${inscription}`); +const markdown = await response.text(); +document.body.innerHTML = marked.parse(markdown); diff --git a/templates/preview-markdown.html b/templates/preview-markdown.html index 77d9051917..718c9ca7ed 100644 --- a/templates/preview-markdown.html +++ b/templates/preview-markdown.html @@ -1,11 +1,10 @@ - + + -
- From 3c52ade70249b505f6a1f308825eaa019b14d2e4 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 19 Sep 2023 11:14:36 -0700 Subject: [PATCH 10/14] Sort --- src/media.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/media.rs b/src/media.rs index 4e4106e524..9aaf75bd1f 100644 --- a/src/media.rs +++ b/src/media.rs @@ -9,9 +9,9 @@ pub(crate) enum Media { Audio, Iframe, Image, + Markdown, Model, Pdf, - Markdown, Text, Unknown, Video, From 95d7dfdca3540f0109cf99a0f9a1b064edc42856 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 19 Sep 2023 11:15:29 -0700 Subject: [PATCH 11/14] Sort --- src/subcommand/server.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs index 74c5a9d20e..fd18374be2 100644 --- a/src/subcommand/server.rs +++ b/src/subcommand/server.rs @@ -915,33 +915,33 @@ impl Server { ) .into_response(), ), - Media::Model => Ok( + Media::Markdown => Ok( ( [( header::CONTENT_SECURITY_POLICY, - "script-src-elem 'self' https://ajax.googleapis.com", + "script-src-elem 'self' https://cdn.jsdelivr.net", )], - PreviewModelHtml { inscription_id }, + PreviewMarkdownHtml { inscription_id }, ) .into_response(), ), - Media::Pdf => Ok( + Media::Model => Ok( ( [( header::CONTENT_SECURITY_POLICY, - "script-src-elem 'self' https://cdn.jsdelivr.net", + "script-src-elem 'self' https://ajax.googleapis.com", )], - PreviewPdfHtml { inscription_id }, + PreviewModelHtml { inscription_id }, ) .into_response(), ), - Media::Markdown => Ok( + Media::Pdf => Ok( ( [( header::CONTENT_SECURITY_POLICY, "script-src-elem 'self' https://cdn.jsdelivr.net", )], - PreviewMarkdownHtml { inscription_id }, + PreviewPdfHtml { inscription_id }, ) .into_response(), ), From d5101c8826f64e8332bd6da424957d76d718d0a6 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 19 Sep 2023 11:16:42 -0700 Subject: [PATCH 12/14] Fix test --- src/subcommand/server.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs index fd18374be2..006c0df54f 100644 --- a/src/subcommand/server.rs +++ b/src/subcommand/server.rs @@ -2540,7 +2540,7 @@ mod tests { server.assert_response_regex( format!("/preview/{inscription_id}"), StatusCode::OK, - format!(r".*
.*"), + format!(r".*.*"), ); } From e9f49679ae386ee4a02d51bd4f1c1dee58fbb0ae Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 19 Sep 2023 11:17:09 -0700 Subject: [PATCH 13/14] tweak --- src/templates/preview.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/templates/preview.rs b/src/templates/preview.rs index 93e07246cf..bd72443708 100644 --- a/src/templates/preview.rs +++ b/src/templates/preview.rs @@ -11,17 +11,17 @@ pub(crate) struct PreviewImageHtml { } #[derive(boilerplate::Boilerplate)] -pub(crate) struct PreviewModelHtml { +pub(crate) struct PreviewMarkdownHtml { pub(crate) inscription_id: InscriptionId, } #[derive(boilerplate::Boilerplate)] -pub(crate) struct PreviewPdfHtml { +pub(crate) struct PreviewModelHtml { pub(crate) inscription_id: InscriptionId, } #[derive(boilerplate::Boilerplate)] -pub(crate) struct PreviewMarkdownHtml { +pub(crate) struct PreviewPdfHtml { pub(crate) inscription_id: InscriptionId, } From b43d9325ae00ffd55c555dd7fa0b4413dc3bffb2 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 19 Sep 2023 11:25:21 -0700 Subject: [PATCH 14/14] Use latest minor --- static/preview-markdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/preview-markdown.js b/static/preview-markdown.js index 472b20cd8a..1c3b770cbd 100644 --- a/static/preview-markdown.js +++ b/static/preview-markdown.js @@ -1,4 +1,4 @@ -import { marked } from 'https://cdn.jsdelivr.net/npm/marked@8.0.0/+esm' +import { marked } from 'https://cdn.jsdelivr.net/npm/marked@9/+esm' const inscription = document.documentElement.dataset.inscription; const response = await fetch(`/content/${inscription}`);