From 4e2aea8a5a414b3bcfac0168bea4f6afd032e8f5 Mon Sep 17 00:00:00 2001
From: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 26 Aug 2024 21:12:45 +0000
Subject: [PATCH] chore(deps): bump @napi-rs/simple-git from 0.1.17 to 0.1.19 (#1376)
---
quartz/plugins/transformers/ofm.ts | 17 ++++++-----------
1 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts
index c4dd4d8..0dea893 100644
--- a/quartz/plugins/transformers/ofm.ts
+++ b/quartz/plugins/transformers/ofm.ts
@@ -2,7 +2,6 @@
import { Root, Html, BlockContent, DefinitionContent, Paragraph, Code } from "mdast"
import { Element, Literal, Root as HtmlRoot } from "hast"
import { ReplaceFunction, findAndReplace as mdastFindReplace } from "mdast-util-find-and-replace"
-import { slug as slugAnchor } from "github-slugger"
import rehypeRaw from "rehype-raw"
import { SKIP, visit } from "unist-util-visit"
import path from "path"
@@ -137,9 +136,7 @@
/^(?<alt>(?!^\d*x?\d*$).*?)?(\|?\s*?(?<width>\d+)(x(?<height>\d+))?)?$/,
)
-export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options> | undefined> = (
- userOpts,
-) => {
+export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>> = (userOpts) => {
const opts = { ...defaultOptions, ...userOpts }
const mdastToHtml = (ast: PhrasingContent | Paragraph) => {
@@ -196,7 +193,7 @@
const [rawFp, rawHeader, rawAlias]: (string | undefined)[] = capture
const [fp, anchor] = splitAnchor(`${rawFp ?? ""}${rawHeader ?? ""}`)
- const blockRef = Boolean(anchor?.startsWith("^")) ? "^" : ""
+ const blockRef = Boolean(rawHeader?.match(/^#?\^/)) ? "^" : ""
const displayAnchor = anchor ? `#${blockRef}${anchor.trim().replace(/^#+/, "")}` : ""
const displayAlias = rawAlias ?? rawHeader?.replace("#", "|") ?? ""
const embedDisplay = value.startsWith("!") ? "!" : ""
@@ -264,14 +261,14 @@
} else if ([".pdf"].includes(ext)) {
return {
type: "html",
- value: `<iframe src="${url}"></iframe>`,
+ value: `<iframe src="${url}" class="pdf"></iframe>`,
}
} else {
const block = anchor
return {
type: "html",
data: { hProperties: { transclude: true } },
- value: `<blockquote class="transclude" data-url="${url}" data-block="${block}"><a href="${
+ value: `<blockquote class="transclude" data-url="${url}" data-block="${block}" data-embed-alias="${alias}"><a href="${
url + anchor
}" class="transclude-inner">Transclude of ${url}${block}</a></blockquote>`,
}
@@ -617,11 +614,10 @@
// YouTube video (with optional playlist)
node.tagName = "iframe"
node.properties = {
- class: "external-embed",
+ class: "external-embed youtube",
allow: "fullscreen",
frameborder: 0,
width: "600px",
- height: "350px",
src: playlistId
? `https://www.youtube.com/embed/${videoId}?list=${playlistId}`
: `https://www.youtube.com/embed/${videoId}`,
@@ -630,11 +626,10 @@
// YouTube playlist only.
node.tagName = "iframe"
node.properties = {
- class: "external-embed",
+ class: "external-embed youtube",
allow: "fullscreen",
frameborder: 0,
width: "600px",
- height: "350px",
src: `https://www.youtube.com/embed/videoseries?list=${playlistId}`,
}
}
--
Gitblit v1.10.0