@vuepress/markdown
Advanced tools
Comparing version 2.0.0-beta.61 to 2.0.0-beta.62
@@ -31,5 +31,12 @@ var __defProp = Object.defineProperty; | ||
import { decode } from "mdurl"; | ||
var resolveLink = (link, relativePathPrefix, env) => { | ||
var resolveLink = (link, relativePathPrefix, env, strict = false) => { | ||
let resolvedLink = decode(link); | ||
if (/^\.{1,2}\//.test(link) && env.filePathRelative) { | ||
const isRelativePath = strict ? ( | ||
// in strict mode, only link that starts with `./` or `../` is considered as relative path | ||
/^\.{1,2}\//.test(link) | ||
) : ( | ||
// in non-strict mode, link that does not start with `/` and does not have protocol is considered as relative path | ||
!link.startsWith("/") && !/[A-z]+:\/\//.test(link) | ||
); | ||
if (isRelativePath && env.filePathRelative) { | ||
resolvedLink = `${relativePathPrefix}/${path.join( | ||
@@ -60,3 +67,4 @@ path.dirname(env.filePathRelative), | ||
relativePathPrefix, | ||
env | ||
env, | ||
true | ||
)}${quote}` | ||
@@ -71,3 +79,4 @@ ).replace( | ||
relativePathPrefix, | ||
env | ||
env, | ||
true | ||
)}${descriptor.replace(/[ \n]+/g, " ").trimEnd()}` | ||
@@ -364,4 +373,4 @@ ) | ||
if (importFilePath) { | ||
const importedFiles = env.importedFiles || (env.importedFiles = []); | ||
importedFiles.push(importFilePath); | ||
; | ||
(env.importedFiles ?? (env.importedFiles = [])).push(importFilePath); | ||
} | ||
@@ -452,4 +461,3 @@ return md.renderer.rules.fence(tokens, idx, options2, env, slf); | ||
hrefAttr[1] = `${normalizedPath}${rawHash}`; | ||
const links = env.links || (env.links = []); | ||
links.push({ | ||
(env.links ?? (env.links = [])).push({ | ||
raw: hrefLink, | ||
@@ -456,0 +464,0 @@ relative: relativePath, |
@@ -31,5 +31,12 @@ var __defProp = Object.defineProperty; | ||
import { decode } from "mdurl"; | ||
var resolveLink = (link, relativePathPrefix, env) => { | ||
var resolveLink = (link, relativePathPrefix, env, strict = false) => { | ||
let resolvedLink = decode(link); | ||
if (/^\.{1,2}\//.test(link) && env.filePathRelative) { | ||
const isRelativePath = strict ? ( | ||
// in strict mode, only link that starts with `./` or `../` is considered as relative path | ||
/^\.{1,2}\//.test(link) | ||
) : ( | ||
// in non-strict mode, link that does not start with `/` and does not have protocol is considered as relative path | ||
!link.startsWith("/") && !/[A-z]+:\/\//.test(link) | ||
); | ||
if (isRelativePath && env.filePathRelative) { | ||
resolvedLink = `${relativePathPrefix}/${path.join( | ||
@@ -60,3 +67,4 @@ path.dirname(env.filePathRelative), | ||
relativePathPrefix, | ||
env | ||
env, | ||
true | ||
)}${quote}` | ||
@@ -71,3 +79,4 @@ ).replace( | ||
relativePathPrefix, | ||
env | ||
env, | ||
true | ||
)}${descriptor.replace(/[ \n]+/g, " ").trimEnd()}` | ||
@@ -364,4 +373,4 @@ ) | ||
if (importFilePath) { | ||
const importedFiles = env.importedFiles || (env.importedFiles = []); | ||
importedFiles.push(importFilePath); | ||
; | ||
(env.importedFiles ?? (env.importedFiles = [])).push(importFilePath); | ||
} | ||
@@ -452,4 +461,3 @@ return md.renderer.rules.fence(tokens, idx, options2, env, slf); | ||
hrefAttr[1] = `${normalizedPath}${rawHash}`; | ||
const links = env.links || (env.links = []); | ||
links.push({ | ||
(env.links ?? (env.links = [])).push({ | ||
raw: hrefLink, | ||
@@ -456,0 +464,0 @@ relative: relativePath, |
{ | ||
"name": "@vuepress/markdown", | ||
"version": "2.0.0-beta.61", | ||
"version": "2.0.0-beta.62", | ||
"description": "Markdown package of VuePress", | ||
@@ -44,4 +44,4 @@ "keywords": [ | ||
"mdurl": "^1.0.1", | ||
"@vuepress/shared": "2.0.0-beta.61", | ||
"@vuepress/utils": "2.0.0-beta.61" | ||
"@vuepress/shared": "2.0.0-beta.62", | ||
"@vuepress/utils": "2.0.0-beta.62" | ||
}, | ||
@@ -48,0 +48,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41531
1287
+ Added@vuepress/shared@2.0.0-beta.62(transitive)
+ Added@vuepress/utils@2.0.0-beta.62(transitive)
- Removed@vuepress/shared@2.0.0-beta.61(transitive)
- Removed@vuepress/utils@2.0.0-beta.61(transitive)