marked-base-url 1.0.8 → 1.1.0

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/lib/index.cjs CHANGED
@@ -21,6 +21,11 @@ function baseUrl(base) {
21
21
  return;
22
22
  }
23
23
 
24
+ if (token.href.startsWith('#')) {
25
+ // the URL is a local reference
26
+ return;
27
+ }
28
+
24
29
  if (isBaseAbsolute) {
25
30
  try {
26
31
  token.href = new URL(token.href, base).href;
package/lib/index.umd.js CHANGED
@@ -25,6 +25,11 @@
25
25
  return;
26
26
  }
27
27
 
28
+ if (token.href.startsWith('#')) {
29
+ // the URL is a local reference
30
+ return;
31
+ }
32
+
28
33
  if (isBaseAbsolute) {
29
34
  try {
30
35
  token.href = new URL(token.href, base).href;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marked-base-url",
3
- "version": "1.0.8",
3
+ "version": "1.1.0",
4
4
  "description": "marked base url",
5
5
  "main": "./lib/index.cjs",
6
6
  "module": "./src/index.js",
@@ -44,23 +44,23 @@
44
44
  "marked": ">= 4 < 10"
45
45
  },
46
46
  "devDependencies": {
47
- "@babel/core": "^7.22.15",
47
+ "@babel/core": "^7.22.17",
48
48
  "@babel/preset-env": "^7.22.15",
49
49
  "@semantic-release/changelog": "^6.0.3",
50
50
  "@semantic-release/commit-analyzer": "^10.0.4",
51
51
  "@semantic-release/git": "^10.0.1",
52
- "@semantic-release/github": "^9.0.4",
52
+ "@semantic-release/github": "^9.0.5",
53
53
  "@semantic-release/npm": "^10.0.5",
54
54
  "@semantic-release/release-notes-generator": "^11.0.7",
55
55
  "babel-jest": "^29.6.4",
56
- "eslint": "^8.48.0",
56
+ "eslint": "^8.49.0",
57
57
  "eslint-config-standard": "^17.1.0",
58
58
  "eslint-plugin-import": "^2.28.1",
59
- "eslint-plugin-n": "^16.0.2",
59
+ "eslint-plugin-n": "^16.1.0",
60
60
  "eslint-plugin-promise": "^6.1.1",
61
61
  "jest-cli": "^29.6.4",
62
62
  "marked": "^9.0.0",
63
- "rollup": "^3.28.1",
63
+ "rollup": "^3.29.1",
64
64
  "semantic-release": "^21.1.1",
65
65
  "tsd": "^0.29.0"
66
66
  },
package/src/index.js CHANGED
@@ -19,6 +19,11 @@ export function baseUrl(base) {
19
19
  return;
20
20
  }
21
21
 
22
+ if (token.href.startsWith('#')) {
23
+ // the URL is a local reference
24
+ return;
25
+ }
26
+
22
27
  if (isBaseAbsolute) {
23
28
  try {
24
29
  token.href = new URL(token.href, base).href;