@raystack/chronicle 0.1.0-canary.c5d277e → 0.1.0-canary.cb102e9

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.
@@ -0,0 +1,14 @@
1
+ import path from 'path'
2
+
3
+ /**
4
+ * Resolve a URL path within a base directory, preventing path traversal.
5
+ * Returns null if the resolved path escapes the base directory.
6
+ */
7
+ export function safePath(baseDir: string, urlPath: string): string | null {
8
+ const decoded = decodeURIComponent(urlPath.split('?')[0])
9
+ const resolved = path.resolve(baseDir, '.' + decoded)
10
+ if (!resolved.startsWith(path.resolve(baseDir) + path.sep) && resolved !== path.resolve(baseDir)) {
11
+ return null
12
+ }
13
+ return resolved
14
+ }
@@ -41,7 +41,7 @@ export async function createViteConfig(options: ViteConfigOptions): Promise<Inli
41
41
  remarkDirective,
42
42
  ],
43
43
  rehypePlugins: [
44
- [rehypeShiki, { themes: { light: 'github-light', dark: 'github-dark' } }],
44
+ [rehypeShiki, { themes: { light: 'github-light', dark: 'github-dark' }, defaultColor: false }],
45
45
  ],
46
46
  mdExtensions: ['.md'],
47
47
  mdxExtensions: ['.mdx'],
@@ -38,18 +38,22 @@
38
38
  margin-bottom: var(--rs-space-3);
39
39
  }
40
40
 
41
- .content :global(pre code span) {
42
- color: var(--shiki-light);
41
+ .content :global(pre) {
42
+ background-color: var(--shiki-light-bg, #fff);
43
43
  }
44
44
 
45
- :global([data-theme="dark"]) .content :global(pre code span) {
46
- color: var(--shiki-dark);
45
+ .content :global(pre code span) {
46
+ color: var(--shiki-light);
47
47
  }
48
48
 
49
49
  :global([data-theme="dark"]) .content :global(pre) {
50
50
  background-color: var(--shiki-dark-bg, #24292e);
51
51
  }
52
52
 
53
+ :global([data-theme="dark"]) .content :global(pre code span) {
54
+ color: var(--shiki-dark);
55
+ }
56
+
53
57
  .content img {
54
58
  max-width: 100%;
55
59
  height: auto;