mirror of
https://github.com/quartz-community/utils.git
synced 2026-07-22 02:50:27 +00:00
build: rebuild dist with transformInternalLink folder-path fix
This commit is contained in:
parent
6721918708
commit
7a43501ac1
4 changed files with 8 additions and 6 deletions
5
dist/index.js
vendored
5
dist/index.js
vendored
|
|
@ -161,11 +161,12 @@ function slugTag(tag) {
|
|||
}
|
||||
function transformInternalLink(link) {
|
||||
const [fplike, anchor] = splitAnchor(decodeURI(link));
|
||||
const folderPath = isFolderPath(fplike);
|
||||
const segments = fplike.split("/").filter((x) => x.length > 0);
|
||||
const prefix = segments.filter(_isRelativeSegment).join("/");
|
||||
const fp = segments.filter((seg) => !_isRelativeSegment(seg) && seg !== "").join("/");
|
||||
const simpleSlug = simplifySlug(slugifyFilePath(fp));
|
||||
const slugged = slugifyFilePath(fp);
|
||||
const simpleSlug = simplifySlug(slugged);
|
||||
const folderPath = isFolderPath(fplike) || isFolderPath(slugged);
|
||||
const joined = joinSegments(stripSlashes(prefix), stripSlashes(simpleSlug));
|
||||
const trail = folderPath ? "/" : "";
|
||||
const res = _addRelativeToStart(joined) + trail + anchor;
|
||||
|
|
|
|||
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
5
dist/path.js
vendored
5
dist/path.js
vendored
|
|
@ -158,11 +158,12 @@ function slugTag(tag) {
|
|||
}
|
||||
function transformInternalLink(link) {
|
||||
const [fplike, anchor] = splitAnchor(decodeURI(link));
|
||||
const folderPath = isFolderPath(fplike);
|
||||
const segments = fplike.split("/").filter((x) => x.length > 0);
|
||||
const prefix = segments.filter(_isRelativeSegment).join("/");
|
||||
const fp = segments.filter((seg) => !_isRelativeSegment(seg) && seg !== "").join("/");
|
||||
const simpleSlug = simplifySlug(slugifyFilePath(fp));
|
||||
const slugged = slugifyFilePath(fp);
|
||||
const simpleSlug = simplifySlug(slugged);
|
||||
const folderPath = isFolderPath(fplike) || isFolderPath(slugged);
|
||||
const joined = joinSegments(stripSlashes(prefix), stripSlashes(simpleSlug));
|
||||
const trail = folderPath ? "/" : "";
|
||||
const res = _addRelativeToStart(joined) + trail + anchor;
|
||||
|
|
|
|||
2
dist/path.js.map
vendored
2
dist/path.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue