Disable fuzzy links to prevent unintended linkage when referring to files or version numbers that may appear like domains or IP addresses (#4311)

This commit is contained in:
Prospector
2025-09-01 11:18:46 -07:00
committed by GitHub
parent 8b2a89d4e0
commit c43d359561

View File

@@ -140,6 +140,11 @@ export const md = (options = {}) => {
return self.renderToken(tokens, idx, options) return self.renderToken(tokens, idx, options)
} }
md.linkify.set({
fuzzyLink: false,
fuzzyIP: false,
})
md.renderer.rules.link_open = function (tokens, idx, options, env, self) { md.renderer.rules.link_open = function (tokens, idx, options, env, self) {
const token = tokens[idx] const token = tokens[idx]
const index = token.attrIndex('href') const index = token.attrIndex('href')