bunki 0.19.1 → 0.19.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js
CHANGED
|
@@ -33021,6 +33021,7 @@ var SAME_DIR_LINK_REGEX = /^\.\/([a-zA-Z0-9_-]+?)(?:\.md)?(?:\/)?(#[^#]*)?$/;
|
|
|
33021
33021
|
var IMAGE_PATH_REGEX = /^\.\.\/\.\.\/assets\/(\d{4})\/([^/]+)\/(.+)$/;
|
|
33022
33022
|
var IMAGE_PATH_ASSETS_DIR = /^\.\.\/\_assets\/(.+)$/;
|
|
33023
33023
|
var IMAGE_PATH_ASSETS_SAME_DIR = /^\.\/\_assets\/(.+)$/;
|
|
33024
|
+
var IMAGE_PATH_CROSS_YEAR_ASSETS = /^\.\.\/(\d{4})\/_assets\/(.+)$/;
|
|
33024
33025
|
var YOUTUBE_EMBED_REGEX = /<a href="(https?:\/\/(www\.)?(youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)[^"]*)"[^>]*>(.*?)<\/a>/g;
|
|
33025
33026
|
var EXTERNAL_LINK_REGEX = /<a href="(https?:\/\/|\/\/)([^"]+)"/g;
|
|
33026
33027
|
var SCHEMA_ORG_PLACE_TYPES = new Set([
|
|
@@ -33098,6 +33099,12 @@ function transformImagePath(relativePath, config) {
|
|
|
33098
33099
|
const path5 = config.pathPattern.replace("{year}", config.postYear).replace("{slug}", "").replace("{filename}", filename).replace(/\/+/g, "/").replace(/^\//, "");
|
|
33099
33100
|
return `${config.baseUrl}/${path5}`;
|
|
33100
33101
|
}
|
|
33102
|
+
const crossYearMatch = relativePath.match(IMAGE_PATH_CROSS_YEAR_ASSETS);
|
|
33103
|
+
if (crossYearMatch) {
|
|
33104
|
+
const [, year, filename] = crossYearMatch;
|
|
33105
|
+
const path5 = config.pathPattern.replace("{year}", year).replace("{slug}", "").replace("{filename}", filename).replace(/\/+/g, "/").replace(/^\//, "");
|
|
33106
|
+
return `${config.baseUrl}/${path5}`;
|
|
33107
|
+
}
|
|
33101
33108
|
return null;
|
|
33102
33109
|
}
|
|
33103
33110
|
function createMarked(cdnConfig) {
|
|
@@ -33143,7 +33150,7 @@ function createMarked(cdnConfig) {
|
|
|
33143
33150
|
}
|
|
33144
33151
|
if (token.type === "image" && cdnConfig?.enabled) {
|
|
33145
33152
|
const href = token.href || "";
|
|
33146
|
-
if (href.startsWith("../../assets/") || href.startsWith("../_assets/") || href.startsWith("./_assets/")) {
|
|
33153
|
+
if (href.startsWith("../../assets/") || href.startsWith("../_assets/") || href.startsWith("./_assets/") || IMAGE_PATH_CROSS_YEAR_ASSETS.test(href)) {
|
|
33147
33154
|
const transformed = transformImagePath(href, cdnConfig);
|
|
33148
33155
|
if (transformed) {
|
|
33149
33156
|
token.href = transformed;
|
|
@@ -7,6 +7,7 @@ export declare const SAME_DIR_LINK_REGEX: RegExp;
|
|
|
7
7
|
export declare const IMAGE_PATH_REGEX: RegExp;
|
|
8
8
|
export declare const IMAGE_PATH_ASSETS_DIR: RegExp;
|
|
9
9
|
export declare const IMAGE_PATH_ASSETS_SAME_DIR: RegExp;
|
|
10
|
+
export declare const IMAGE_PATH_CROSS_YEAR_ASSETS: RegExp;
|
|
10
11
|
export declare const YOUTUBE_EMBED_REGEX: RegExp;
|
|
11
12
|
export declare const EXTERNAL_LINK_REGEX: RegExp;
|
|
12
13
|
export declare const SCHEMA_ORG_PLACE_TYPES: Set<string>;
|
package/package.json
CHANGED