@md-plugins/quasar-app-extension-q-press 0.1.0-beta.12 → 0.1.0-beta.13
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/README.md +1 -1
- package/dist/templates/init/src/_q-press/components/MarkdownCodepen.vue +24 -2
- package/dist/templates/update/src/_q-press/components/MarkdownCodepen.vue +24 -2
- package/package.json +14 -14
- package/src/templates/init/src/_q-press/components/MarkdownCodepen.vue +24 -2
- package/src/templates/update/src/_q-press/components/MarkdownCodepen.vue +24 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ The Ultimate Markdown Solution for the Quasar Framework.
|
|
|
4
4
|
|
|
5
5
|
See the [documentation](https://md-plugins.netlify.app/quasar-app-extensions/qpress/overview) for more information.
|
|
6
6
|
|
|
7
|
-
> Current beta release: `0.1.0-beta.
|
|
7
|
+
> Current beta release: `0.1.0-beta.13`.
|
|
8
8
|
>
|
|
9
9
|
> Q-Press currently targets Quasar Vite projects using `@quasar/app-vite` `>=3.0.0-beta.30`. TypeScript processing is required.
|
|
10
10
|
|
|
@@ -41,6 +41,26 @@ const defaultJsResources = [
|
|
|
41
41
|
`https://cdn.jsdelivr.net/npm/quasar@${Quasar.version}/dist/quasar.umd.prod.js`,
|
|
42
42
|
]
|
|
43
43
|
|
|
44
|
+
function getAbsolutePublicUrl(path: string) {
|
|
45
|
+
const normalizedPath = path.startsWith('/') ? path : `/${path}`
|
|
46
|
+
|
|
47
|
+
return typeof location === 'undefined' ? normalizedPath : `${location.origin}${normalizedPath}`
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function rewriteRootRelativeUrls(content: string) {
|
|
51
|
+
return content
|
|
52
|
+
.replace(
|
|
53
|
+
/\b(src|href|poster)=("|')\/(?!\/)([^"']*)\2/g,
|
|
54
|
+
(_match: string, attr: string, quote: string, path: string) =>
|
|
55
|
+
`${attr}=${quote}${getAbsolutePublicUrl(path)}${quote}`,
|
|
56
|
+
)
|
|
57
|
+
.replace(
|
|
58
|
+
/url\(\s*(["']?)\/(?!\/)([^"')]+)\1\s*\)/g,
|
|
59
|
+
(_match: string, quote: string, path: string) =>
|
|
60
|
+
`url(${quote}${getAbsolutePublicUrl(path)}${quote})`,
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
44
64
|
function indent(code: string, spaces = 2) {
|
|
45
65
|
const padding = ' '.repeat(spaces)
|
|
46
66
|
return code
|
|
@@ -271,7 +291,7 @@ const jsResources = computed(() => {
|
|
|
271
291
|
})
|
|
272
292
|
|
|
273
293
|
const css = computed(() => {
|
|
274
|
-
return (def.parts.Style || '').replace(/(<style.*?>|<\/style>)/g, '').trim()
|
|
294
|
+
return rewriteRootRelativeUrls((def.parts.Style || '').replace(/(<style.*?>|<\/style>)/g, '').trim())
|
|
275
295
|
})
|
|
276
296
|
|
|
277
297
|
const cssPreprocessor = computed(() => {
|
|
@@ -297,7 +317,7 @@ const jsPreProcessor = computed(() => {
|
|
|
297
317
|
})
|
|
298
318
|
|
|
299
319
|
const html = computed(() => {
|
|
300
|
-
|
|
320
|
+
const content = (def.parts.Template || '')
|
|
301
321
|
.replace(/(<template>|<\/template>$)/g, '')
|
|
302
322
|
.replace(/\n/g, '\n ')
|
|
303
323
|
.replace(/([\w]+=")([^"]*?)(")/g, function (match, p1, p2, p3) {
|
|
@@ -331,6 +351,8 @@ const html = computed(() => {
|
|
|
331
351
|
.replace(/___TEMP_REPLACEMENT___/g, '>')
|
|
332
352
|
.replace(/^\s{2}/gm, '')
|
|
333
353
|
.trim()
|
|
354
|
+
|
|
355
|
+
return rewriteRootRelativeUrls(content)
|
|
334
356
|
})
|
|
335
357
|
|
|
336
358
|
const editors = computed(() => {
|
|
@@ -41,6 +41,26 @@ const defaultJsResources = [
|
|
|
41
41
|
`https://cdn.jsdelivr.net/npm/quasar@${Quasar.version}/dist/quasar.umd.prod.js`,
|
|
42
42
|
]
|
|
43
43
|
|
|
44
|
+
function getAbsolutePublicUrl(path: string) {
|
|
45
|
+
const normalizedPath = path.startsWith('/') ? path : `/${path}`
|
|
46
|
+
|
|
47
|
+
return typeof location === 'undefined' ? normalizedPath : `${location.origin}${normalizedPath}`
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function rewriteRootRelativeUrls(content: string) {
|
|
51
|
+
return content
|
|
52
|
+
.replace(
|
|
53
|
+
/\b(src|href|poster)=("|')\/(?!\/)([^"']*)\2/g,
|
|
54
|
+
(_match: string, attr: string, quote: string, path: string) =>
|
|
55
|
+
`${attr}=${quote}${getAbsolutePublicUrl(path)}${quote}`,
|
|
56
|
+
)
|
|
57
|
+
.replace(
|
|
58
|
+
/url\(\s*(["']?)\/(?!\/)([^"')]+)\1\s*\)/g,
|
|
59
|
+
(_match: string, quote: string, path: string) =>
|
|
60
|
+
`url(${quote}${getAbsolutePublicUrl(path)}${quote})`,
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
44
64
|
function indent(code: string, spaces = 2) {
|
|
45
65
|
const padding = ' '.repeat(spaces)
|
|
46
66
|
return code
|
|
@@ -271,7 +291,7 @@ const jsResources = computed(() => {
|
|
|
271
291
|
})
|
|
272
292
|
|
|
273
293
|
const css = computed(() => {
|
|
274
|
-
return (def.parts.Style || '').replace(/(<style.*?>|<\/style>)/g, '').trim()
|
|
294
|
+
return rewriteRootRelativeUrls((def.parts.Style || '').replace(/(<style.*?>|<\/style>)/g, '').trim())
|
|
275
295
|
})
|
|
276
296
|
|
|
277
297
|
const cssPreprocessor = computed(() => {
|
|
@@ -297,7 +317,7 @@ const jsPreProcessor = computed(() => {
|
|
|
297
317
|
})
|
|
298
318
|
|
|
299
319
|
const html = computed(() => {
|
|
300
|
-
|
|
320
|
+
const content = (def.parts.Template || '')
|
|
301
321
|
.replace(/(<template>|<\/template>$)/g, '')
|
|
302
322
|
.replace(/\n/g, '\n ')
|
|
303
323
|
.replace(/([\w]+=")([^"]*?)(")/g, function (match, p1, p2, p3) {
|
|
@@ -331,6 +351,8 @@ const html = computed(() => {
|
|
|
331
351
|
.replace(/___TEMP_REPLACEMENT___/g, '>')
|
|
332
352
|
.replace(/^\s{2}/gm, '')
|
|
333
353
|
.trim()
|
|
354
|
+
|
|
355
|
+
return rewriteRootRelativeUrls(content)
|
|
334
356
|
})
|
|
335
357
|
|
|
336
358
|
const editors = computed(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@md-plugins/quasar-app-extension-q-press",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.13",
|
|
4
4
|
"description": "QPress - The Ultimate Markdown Solution for Quasar Framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown",
|
|
@@ -30,19 +30,19 @@
|
|
|
30
30
|
"@types/markdown-it": "^14.1.2",
|
|
31
31
|
"fs-extra": "^11.3.5",
|
|
32
32
|
"markdown-it": "^14.2.0",
|
|
33
|
-
"@md-plugins/md-plugin-
|
|
34
|
-
"@md-plugins/md-plugin-
|
|
35
|
-
"@md-plugins/md-plugin-headers": "0.1.0-beta.
|
|
36
|
-
"@md-plugins/md-plugin-
|
|
37
|
-
"@md-plugins/md-plugin-image": "0.1.0-beta.
|
|
38
|
-
"@md-plugins/md-plugin-
|
|
39
|
-
"@md-plugins/md-plugin-
|
|
40
|
-
"@md-plugins/md-plugin-inlinecode": "0.1.0-beta.
|
|
41
|
-
"@md-plugins/md-plugin-link": "0.1.0-beta.
|
|
42
|
-
"@md-plugins/md-plugin-table": "0.1.0-beta.
|
|
43
|
-
"@md-plugins/md-plugin-title": "0.1.0-beta.
|
|
44
|
-
"@md-plugins/shared": "0.1.0-beta.
|
|
45
|
-
"@md-plugins/vite-md-plugin": "0.1.0-beta.
|
|
33
|
+
"@md-plugins/md-plugin-blockquote": "0.1.0-beta.13",
|
|
34
|
+
"@md-plugins/md-plugin-containers": "0.1.0-beta.13",
|
|
35
|
+
"@md-plugins/md-plugin-headers": "0.1.0-beta.13",
|
|
36
|
+
"@md-plugins/md-plugin-imports": "0.1.0-beta.13",
|
|
37
|
+
"@md-plugins/md-plugin-image": "0.1.0-beta.13",
|
|
38
|
+
"@md-plugins/md-plugin-codeblocks": "0.1.0-beta.13",
|
|
39
|
+
"@md-plugins/md-plugin-frontmatter": "0.1.0-beta.13",
|
|
40
|
+
"@md-plugins/md-plugin-inlinecode": "0.1.0-beta.13",
|
|
41
|
+
"@md-plugins/md-plugin-link": "0.1.0-beta.13",
|
|
42
|
+
"@md-plugins/md-plugin-table": "0.1.0-beta.13",
|
|
43
|
+
"@md-plugins/md-plugin-title": "0.1.0-beta.13",
|
|
44
|
+
"@md-plugins/shared": "0.1.0-beta.13",
|
|
45
|
+
"@md-plugins/vite-md-plugin": "0.1.0-beta.13"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@quasar/app-vite": "3.0.0-beta.30",
|
|
@@ -41,6 +41,26 @@ const defaultJsResources = [
|
|
|
41
41
|
`https://cdn.jsdelivr.net/npm/quasar@${Quasar.version}/dist/quasar.umd.prod.js`,
|
|
42
42
|
]
|
|
43
43
|
|
|
44
|
+
function getAbsolutePublicUrl(path: string) {
|
|
45
|
+
const normalizedPath = path.startsWith('/') ? path : `/${path}`
|
|
46
|
+
|
|
47
|
+
return typeof location === 'undefined' ? normalizedPath : `${location.origin}${normalizedPath}`
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function rewriteRootRelativeUrls(content: string) {
|
|
51
|
+
return content
|
|
52
|
+
.replace(
|
|
53
|
+
/\b(src|href|poster)=("|')\/(?!\/)([^"']*)\2/g,
|
|
54
|
+
(_match: string, attr: string, quote: string, path: string) =>
|
|
55
|
+
`${attr}=${quote}${getAbsolutePublicUrl(path)}${quote}`,
|
|
56
|
+
)
|
|
57
|
+
.replace(
|
|
58
|
+
/url\(\s*(["']?)\/(?!\/)([^"')]+)\1\s*\)/g,
|
|
59
|
+
(_match: string, quote: string, path: string) =>
|
|
60
|
+
`url(${quote}${getAbsolutePublicUrl(path)}${quote})`,
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
44
64
|
function indent(code: string, spaces = 2) {
|
|
45
65
|
const padding = ' '.repeat(spaces)
|
|
46
66
|
return code
|
|
@@ -271,7 +291,7 @@ const jsResources = computed(() => {
|
|
|
271
291
|
})
|
|
272
292
|
|
|
273
293
|
const css = computed(() => {
|
|
274
|
-
return (def.parts.Style || '').replace(/(<style.*?>|<\/style>)/g, '').trim()
|
|
294
|
+
return rewriteRootRelativeUrls((def.parts.Style || '').replace(/(<style.*?>|<\/style>)/g, '').trim())
|
|
275
295
|
})
|
|
276
296
|
|
|
277
297
|
const cssPreprocessor = computed(() => {
|
|
@@ -297,7 +317,7 @@ const jsPreProcessor = computed(() => {
|
|
|
297
317
|
})
|
|
298
318
|
|
|
299
319
|
const html = computed(() => {
|
|
300
|
-
|
|
320
|
+
const content = (def.parts.Template || '')
|
|
301
321
|
.replace(/(<template>|<\/template>$)/g, '')
|
|
302
322
|
.replace(/\n/g, '\n ')
|
|
303
323
|
.replace(/([\w]+=")([^"]*?)(")/g, function (match, p1, p2, p3) {
|
|
@@ -331,6 +351,8 @@ const html = computed(() => {
|
|
|
331
351
|
.replace(/___TEMP_REPLACEMENT___/g, '>')
|
|
332
352
|
.replace(/^\s{2}/gm, '')
|
|
333
353
|
.trim()
|
|
354
|
+
|
|
355
|
+
return rewriteRootRelativeUrls(content)
|
|
334
356
|
})
|
|
335
357
|
|
|
336
358
|
const editors = computed(() => {
|
|
@@ -41,6 +41,26 @@ const defaultJsResources = [
|
|
|
41
41
|
`https://cdn.jsdelivr.net/npm/quasar@${Quasar.version}/dist/quasar.umd.prod.js`,
|
|
42
42
|
]
|
|
43
43
|
|
|
44
|
+
function getAbsolutePublicUrl(path: string) {
|
|
45
|
+
const normalizedPath = path.startsWith('/') ? path : `/${path}`
|
|
46
|
+
|
|
47
|
+
return typeof location === 'undefined' ? normalizedPath : `${location.origin}${normalizedPath}`
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function rewriteRootRelativeUrls(content: string) {
|
|
51
|
+
return content
|
|
52
|
+
.replace(
|
|
53
|
+
/\b(src|href|poster)=("|')\/(?!\/)([^"']*)\2/g,
|
|
54
|
+
(_match: string, attr: string, quote: string, path: string) =>
|
|
55
|
+
`${attr}=${quote}${getAbsolutePublicUrl(path)}${quote}`,
|
|
56
|
+
)
|
|
57
|
+
.replace(
|
|
58
|
+
/url\(\s*(["']?)\/(?!\/)([^"')]+)\1\s*\)/g,
|
|
59
|
+
(_match: string, quote: string, path: string) =>
|
|
60
|
+
`url(${quote}${getAbsolutePublicUrl(path)}${quote})`,
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
44
64
|
function indent(code: string, spaces = 2) {
|
|
45
65
|
const padding = ' '.repeat(spaces)
|
|
46
66
|
return code
|
|
@@ -271,7 +291,7 @@ const jsResources = computed(() => {
|
|
|
271
291
|
})
|
|
272
292
|
|
|
273
293
|
const css = computed(() => {
|
|
274
|
-
return (def.parts.Style || '').replace(/(<style.*?>|<\/style>)/g, '').trim()
|
|
294
|
+
return rewriteRootRelativeUrls((def.parts.Style || '').replace(/(<style.*?>|<\/style>)/g, '').trim())
|
|
275
295
|
})
|
|
276
296
|
|
|
277
297
|
const cssPreprocessor = computed(() => {
|
|
@@ -297,7 +317,7 @@ const jsPreProcessor = computed(() => {
|
|
|
297
317
|
})
|
|
298
318
|
|
|
299
319
|
const html = computed(() => {
|
|
300
|
-
|
|
320
|
+
const content = (def.parts.Template || '')
|
|
301
321
|
.replace(/(<template>|<\/template>$)/g, '')
|
|
302
322
|
.replace(/\n/g, '\n ')
|
|
303
323
|
.replace(/([\w]+=")([^"]*?)(")/g, function (match, p1, p2, p3) {
|
|
@@ -331,6 +351,8 @@ const html = computed(() => {
|
|
|
331
351
|
.replace(/___TEMP_REPLACEMENT___/g, '>')
|
|
332
352
|
.replace(/^\s{2}/gm, '')
|
|
333
353
|
.trim()
|
|
354
|
+
|
|
355
|
+
return rewriteRootRelativeUrls(content)
|
|
334
356
|
})
|
|
335
357
|
|
|
336
358
|
const editors = computed(() => {
|