Skip to content

reference between deck #243

Answered by yhatt
chenxizhang asked this question in Q&A
Dec 21, 2021 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

For to respect exact intent of the document author, Marp has no implicit replaces for hyperlink URLs when converted Markdown to HTML. Thus, .md extension in URL within converted HTML still will become .md.

If you have expected slides as published as a bunch of HTML, is there a reason why not set URL as ending with .html instead of .md?


If you really need, Marp CLI can define a custom plugin through engine.js.

// engine.js
module.exports = ({ marp }) => marp.use((md) => {
  const { normalizeLink } = md

  md.normalizeLink = (...args) => {
    const originalResult = normalizeLink(...args)

    // Replace URL: ".md" -> ".html"
    return originalResult.replace(/\.md$/, '.html')
  }
})
npx m…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@chenxizhang
Comment options

Answer selected by chenxizhang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants