dependabot[bot]
2025-09-28 3ff7ca4155f5e9f03e2304b33a89de4b0a6aaa2c
quartz/plugins/transformers/oxhugofm.ts
@@ -47,16 +47,14 @@
 * markdown to make it compatible with quartz but the list of changes applied it
 * is not exhaustive.
 * */
export const OxHugoFlavouredMarkdown: QuartzTransformerPlugin<Partial<Options> | undefined> = (
  userOpts,
) => {
export const OxHugoFlavouredMarkdown: QuartzTransformerPlugin<Partial<Options>> = (userOpts) => {
  const opts = { ...defaultOptions, ...userOpts }
  return {
    name: "OxHugoFlavouredMarkdown",
    textTransform(_ctx, src) {
      if (opts.wikilinks) {
        src = src.toString()
        src = src.replaceAll(relrefRegex, (value, ...capture) => {
        src = src.replaceAll(relrefRegex, (_value, ...capture) => {
          const [text, link] = capture
          return `[${text}](${link})`
        })
@@ -64,7 +62,7 @@
      if (opts.removePredefinedAnchor) {
        src = src.toString()
        src = src.replaceAll(predefinedHeadingIdRegex, (value, ...capture) => {
        src = src.replaceAll(predefinedHeadingIdRegex, (_value, ...capture) => {
          const [headingText] = capture
          return headingText
        })
@@ -72,7 +70,7 @@
      if (opts.removeHugoShortcode) {
        src = src.toString()
        src = src.replaceAll(hugoShortcodeRegex, (value, ...capture) => {
        src = src.replaceAll(hugoShortcodeRegex, (_value, ...capture) => {
          const [scContent] = capture
          return scContent
        })
@@ -80,7 +78,7 @@
      if (opts.replaceFigureWithMdImg) {
        src = src.toString()
        src = src.replaceAll(figureTagRegex, (value, ...capture) => {
        src = src.replaceAll(figureTagRegex, (_value, ...capture) => {
          const [src] = capture
          return `![](${src})`
        })
@@ -88,11 +86,11 @@
      if (opts.replaceOrgLatex) {
        src = src.toString()
        src = src.replaceAll(inlineLatexRegex, (value, ...capture) => {
        src = src.replaceAll(inlineLatexRegex, (_value, ...capture) => {
          const [eqn] = capture
          return `$${eqn}$`
        })
        src = src.replaceAll(blockLatexRegex, (value, ...capture) => {
        src = src.replaceAll(blockLatexRegex, (_value, ...capture) => {
          const [eqn] = capture
          return `$$${eqn}$$`
        })