fix(single): align article code blocks with the reference theme
The article body ran two highlighting pipelines at once: the runtime EnlighterJS pass (same one the comment area uses) plus a bespoke precode.js enhancer, and a hand-rolled .code-block skin. The two disagreed, so rendered blocks carried a dark #282c34 card with 15px padding, 14px text, a border and a second copy button stacked on top of the EnlighterJS toolbar. Drop the parallel path and let one pipeline own code blocks: - delete precode.js, single-post/code-blocks.css and the unused assets/js/enlighter copy that only precode.js referenced - drop the now-dead has_code requirement (PHP scan + feature enqueue) - render pre exactly as the reference does: bootstrap's pre box (9.5px padding / 13px / radius 4) plus main.css's muted background, with the EnlighterJS theme supplying the skin Also scope the inline-code skin to :not(pre code) so it stops painting the block background pink, and remap the toolbar copy glyph: \f0ea is the clipboard in FA4 but "paste" in FA5; the clipboard is \f328. Verified against the reference at 1440px both themes: pre 13px/18.57, 9.5px padding, radius 4, muted background; EnlighterJS block heights 151.31 / 60.38 match exactly.
This commit is contained in:
1 parent
ba32e0ef9c
commit
8ad5ef9aff
19 files changed
+112
-430
No files matched your search
+17
-17
@@ -673,28 +673,28 @@ h6 { font-size: 14px; }
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
/* ===== 代码块 — 对齐 legacy ===== */
|
||||
.wp-posts-content pre,
|
||||
/* 代码块容器版式由 bootstrap 的 pre 与 main.css 的 .wp-posts-content 规则提供,
|
||||
* 高亮皮肤由 EnlighterJS 自带主题负责,此处不再叠加二次容器。
|
||||
* 静态页用 .entry-content 包装,这里镜像同一组 pre 规则保持两边一致。 */
|
||||
.entry-content pre,
|
||||
.prose pre {
|
||||
position: relative;
|
||||
background: #282c34;
|
||||
color: #abb2bf;
|
||||
padding: 15px;
|
||||
border-radius: var(--main-radius, 8px);
|
||||
overflow-x: auto;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
margin: 0 0 20px;
|
||||
background: var(--muted-border-color);
|
||||
color: var(--main-color);
|
||||
}
|
||||
|
||||
.wp-posts-content pre code,
|
||||
.entry-content pre code,
|
||||
.prose pre code {
|
||||
color: inherit;
|
||||
background: none;
|
||||
.entry-content pre:not(.wp-block-code),
|
||||
.prose pre:not(.wp-block-code) {
|
||||
border: none;
|
||||
background: 0 0;
|
||||
padding: 0;
|
||||
font-size: inherit;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.entry-content .wp-block-code code,
|
||||
.prose .wp-block-code code {
|
||||
color: inherit;
|
||||
background-color: unset;
|
||||
margin: unset;
|
||||
}
|
||||
|
||||
/* ===== 表格 — 对齐 legacy line 8897 ===== */
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
:root{--color-primary: #f04494;--color-primary-hover: #e0307e;--color-primary-active: #c9206d;--color-primary-soft: rgba(240, 68, 148, .1);--color-primary-softer: rgba(240, 68, 148, .05);--color-on-primary: #FFFFFF;--color-ink: #333333;--color-ink-2: #4e5358;--color-ink-3: #777777;--color-ink-4: #999999;--surface-page: #f5f6f7;--surface-1: #FFFFFF;--surface-2: #eeeeee;--surface-3: #e9ecef;--surface-4: #f8f8f8;--color-line: rgba(50, 50, 50, .06);--color-line-soft: rgba(0, 0, 0, .03);--color-line-stronger: rgba(50, 50, 50, .12);--color-success: #10B981;--color-warning: #F59E0B;--color-error: #EF4444;--color-info: #3B82F6;--color-accent: #18a058;--color-accent-soft: rgba(24, 160, 88, .12);--color-accent-shadow: rgba(24, 160, 88, .28);--font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;--font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;--font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;--font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;--text-xs: .75rem;--text-sm: .875rem;--text-base: .875rem;--text-md: 1.125rem;--text-lg: 1.25rem;--text-xl: 1.5rem;--text-2xl: 1.875rem;--text-3xl: 2.25rem;--text-4xl: 3rem;--text-5xl: 3.75rem;--leading-tight: 1.2;--leading-snug: 1.4;--leading-normal: 1.6;--leading-relaxed: 1.6;--space-1: 4px;--space-2: 8px;--space-3: 12px;--space-4: 16px;--space-5: 20px;--space-6: 24px;--space-7: 32px;--space-8: 40px;--space-9: 48px;--space-10: 64px;--space-11: 80px;--space-12: 96px;--radius-xs: 3px;--radius-sm: 4px;--radius: 8px;--radius-lg: 8px;--radius-xl: 12px;--radius-2xl: 16px;--radius-pill: 100px;--radius-avatar: 50%;--shadow-xs: 0 1px 2px rgba(0, 0, 0, .03);--shadow-sm: 0 0 10px rgba(116, 116, 116, .08);--shadow: 0 0 10px rgba(116, 116, 116, .12);--shadow-lg: 0 12px 32px rgba(18, 18, 18, .1);--shadow-drawer: 0 18px 60px rgba(0, 0, 0, .2);--nav-height: 60px;--container: 1200px;--container-wide: 1440px;--container-read: 760px;--container-page: 880px;--sidebar-width: 311px;--content-gap: 24px;--section-gap: 24px;--sidebar-bp: 992px;--ease: cubic-bezier(.4, 0, .2, 1);--ease-out: cubic-bezier(.16, 1, .3, 1);--ease-spring: cubic-bezier(.34, 1.56, .64, 1);--dur-fast: .15s;--dur: .25s;--dur-slow: .4s;--focus-ring: 0 0 2px 3px rgba(253, 83, 161, .4);--z-dropdown: 100;--z-sticky: 200;--z-fixed: 300;--z-overlay: 400;--z-modal: 500;--z-popover: 600;--z-toast: 700;--z-tooltip: 800;--radius-btn: 4px;--btn-sm-h: 28px;--btn-md-h: 34px;--btn-lg-h: 44px;--card-padding: 15px;--card-padding-sm: 10px;--card-gap: 16px;--card-gap-lg: 20px;--color-primary-light: var(--color-primary-soft);--color-surface: var(--surface-1);--color-line-strong: var(--color-line);--color-bg-hover: var(--surface-2);--color-border-light: var(--color-line-soft);--color-fill: var(--surface-2);--color-warning-bg: #fffbe6;--color-warning-text: #ad6800;--text-secondary: var(--color-ink-3);--text-tertiary: var(--color-ink-4);--surface-active: var(--surface-2);--surface-card: var(--surface-1);--surface-hover: var(--surface-2);--surface-secondary: var(--surface-2);--radius-code: var(--radius);--radius-full: 100px;--shadow-xl: 0 0 10px rgba(116, 116, 116, .12);--space-16: 64px;--z-floating: 900;--transition-fast: .15s ease;--transition-base: .25s ease;--header-bg: var(--blur-bg);--header-color: var(--color-ink-2);--footer-bg: var(--surface-1);--footer-color: var(--color-ink-4);--blur-bg: rgba(255, 255, 255, .8);--float-btn-bg: rgba(200, 200, 200, .4);--font-heading: var(--font-ui);--radius-card: var(--radius);--radius-md: var(--radius);--color-primary-50: var(--color-primary-soft);--color-primary-dark: var(--color-primary-active);--shadow-md: var(--shadow);--mini-radius: calc(var(--radius) / 1.4);--jio-avatar-size-xs: 24px;--jio-avatar-size-sm: 32px;--jio-avatar-size: 40px;--jio-avatar-size-lg: 56px;--jio-avatar-size-xl: 80px;--jio-card-thumb-scale: 56.25%;--jio-rose: #f43f5e;--jio-rose-soft: rgba(244, 63, 94, .12);--jio-blue: #3b82f6;--jio-blue-soft: rgba(59, 130, 246, .12);--jio-green: #10b981;--jio-green-soft: rgba(16, 185, 129, .12);--jio-orange: #f97316;--jio-orange-soft:rgba(249, 115, 22, .12);--jio-purple: #8b5cf6;--jio-purple-soft:rgba(139, 92, 246, .12);--jio-cyan: #06b6d4;--jio-cyan-soft: rgba(6, 182, 212, .12);--jio-yellow: #eab308;--jio-yellow-soft:rgba(234, 179, 8, .12);--jio-red: #ef4444;--jio-red-soft: rgba(239, 68, 68, .12);--jio-teal: #14b8a6;--jio-teal-soft: rgba(20, 184, 166, .12);--jio-indigo: #6366f1;--jio-indigo-soft:rgba(99, 102, 241, .12);--jio-pink: #ec4899;--jio-pink-soft: rgba(236, 72, 153, .12);--jio-vip-gold-1: #f6d365;--jio-vip-gold-2: #fda085;--jio-grad-sunset-1: #f093fb;--jio-grad-sunset-2: #f5576c;--jio-grad-ocean-1: #4facfe;--jio-grad-ocean-2: #00f2fe;--jio-grad-forest-1Line truncated
|
||||
:root{--color-primary: #f04494;--color-primary-hover: #e0307e;--color-primary-active: #c9206d;--color-primary-soft: rgba(240, 68, 148, .1);--color-primary-softer: rgba(240, 68, 148, .05);--color-on-primary: #FFFFFF;--color-ink: #333333;--color-ink-2: #4e5358;--color-ink-3: #777777;--color-ink-4: #999999;--surface-page: #f5f6f7;--surface-1: #FFFFFF;--surface-2: #eeeeee;--surface-3: #e9ecef;--surface-4: #f8f8f8;--color-line: rgba(50, 50, 50, .06);--color-line-soft: rgba(0, 0, 0, .03);--color-line-stronger: rgba(50, 50, 50, .12);--color-success: #10B981;--color-warning: #F59E0B;--color-error: #EF4444;--color-info: #3B82F6;--color-accent: #18a058;--color-accent-soft: rgba(24, 160, 88, .12);--color-accent-shadow: rgba(24, 160, 88, .28);--font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;--font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;--font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;--font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;--text-xs: .75rem;--text-sm: .875rem;--text-base: .875rem;--text-md: 1.125rem;--text-lg: 1.25rem;--text-xl: 1.5rem;--text-2xl: 1.875rem;--text-3xl: 2.25rem;--text-4xl: 3rem;--text-5xl: 3.75rem;--leading-tight: 1.2;--leading-snug: 1.4;--leading-normal: 1.6;--leading-relaxed: 1.6;--space-1: 4px;--space-2: 8px;--space-3: 12px;--space-4: 16px;--space-5: 20px;--space-6: 24px;--space-7: 32px;--space-8: 40px;--space-9: 48px;--space-10: 64px;--space-11: 80px;--space-12: 96px;--radius-xs: 3px;--radius-sm: 4px;--radius: 8px;--radius-lg: 8px;--radius-xl: 12px;--radius-2xl: 16px;--radius-pill: 100px;--radius-avatar: 50%;--shadow-xs: 0 1px 2px rgba(0, 0, 0, .03);--shadow-sm: 0 0 10px rgba(116, 116, 116, .08);--shadow: 0 0 10px rgba(116, 116, 116, .12);--shadow-lg: 0 12px 32px rgba(18, 18, 18, .1);--shadow-drawer: 0 18px 60px rgba(0, 0, 0, .2);--nav-height: 60px;--container: 1200px;--container-wide: 1440px;--container-read: 760px;--container-page: 880px;--sidebar-width: 311px;--content-gap: 24px;--section-gap: 24px;--sidebar-bp: 992px;--ease: cubic-bezier(.4, 0, .2, 1);--ease-out: cubic-bezier(.16, 1, .3, 1);--ease-spring: cubic-bezier(.34, 1.56, .64, 1);--dur-fast: .15s;--dur: .25s;--dur-slow: .4s;--focus-ring: 0 0 2px 3px rgba(253, 83, 161, .4);--z-dropdown: 100;--z-sticky: 200;--z-fixed: 300;--z-overlay: 400;--z-modal: 500;--z-popover: 600;--z-toast: 700;--z-tooltip: 800;--radius-btn: 4px;--btn-sm-h: 28px;--btn-md-h: 34px;--btn-lg-h: 44px;--card-padding: 15px;--card-padding-sm: 10px;--card-gap: 16px;--card-gap-lg: 20px;--color-primary-light: var(--color-primary-soft);--color-surface: var(--surface-1);--color-line-strong: var(--color-line);--color-bg-hover: var(--surface-2);--color-border-light: var(--color-line-soft);--color-fill: var(--surface-2);--color-warning-bg: #fffbe6;--color-warning-text: #ad6800;--text-secondary: var(--color-ink-3);--text-tertiary: var(--color-ink-4);--surface-active: var(--surface-2);--surface-card: var(--surface-1);--surface-hover: var(--surface-2);--surface-secondary: var(--surface-2);--radius-code: var(--radius);--radius-full: 100px;--shadow-xl: 0 0 10px rgba(116, 116, 116, .12);--space-16: 64px;--z-floating: 900;--transition-fast: .15s ease;--transition-base: .25s ease;--header-bg: var(--blur-bg);--header-color: var(--color-ink-2);--footer-bg: var(--surface-1);--footer-color: var(--color-ink-4);--blur-bg: rgba(255, 255, 255, .8);--float-btn-bg: rgba(200, 200, 200, .4);--font-heading: var(--font-ui);--radius-card: var(--radius);--radius-md: var(--radius);--color-primary-50: var(--color-primary-soft);--color-primary-dark: var(--color-primary-active);--shadow-md: var(--shadow);--mini-radius: calc(var(--radius) / 1.4);--jio-avatar-size-xs: 24px;--jio-avatar-size-sm: 32px;--jio-avatar-size: 40px;--jio-avatar-size-lg: 56px;--jio-avatar-size-xl: 80px;--jio-card-thumb-scale: 56.25%;--jio-rose: #f43f5e;--jio-rose-soft: rgba(244, 63, 94, .12);--jio-blue: #3b82f6;--jio-blue-soft: rgba(59, 130, 246, .12);--jio-green: #10b981;--jio-green-soft: rgba(16, 185, 129, .12);--jio-orange: #f97316;--jio-orange-soft:rgba(249, 115, 22, .12);--jio-purple: #8b5cf6;--jio-purple-soft:rgba(139, 92, 246, .12);--jio-cyan: #06b6d4;--jio-cyan-soft: rgba(6, 182, 212, .12);--jio-yellow: #eab308;--jio-yellow-soft:rgba(234, 179, 8, .12);--jio-red: #ef4444;--jio-red-soft: rgba(239, 68, 68, .12);--jio-teal: #14b8a6;--jio-teal-soft: rgba(20, 184, 166, .12);--jio-indigo: #6366f1;--jio-indigo-soft:rgba(99, 102, 241, .12);--jio-pink: #ec4899;--jio-pink-soft: rgba(236, 72, 153, .12);--jio-vip-gold-1: #f6d365;--jio-vip-gold-2: #fda085;--jio-grad-sunset-1: #f093fb;--jio-grad-sunset-2: #f5576c;--jio-grad-ocean-1: #4facfe;--jio-grad-ocean-2: #00f2fe;--jio-grad-forest-1Line truncated
|
||||
@@ -543,8 +543,10 @@ article.article.box-body,
|
||||
margin: 1.5em 0;
|
||||
}
|
||||
|
||||
/* 行内代码 — 对齐 legacy: 粉色文字 + 粉色背景 */
|
||||
:is(.entry-content, .wp-posts-content) code {
|
||||
/* 行内代码 — 对齐 legacy: 粉色文字 + 粉色背景。
|
||||
* 必须排除 pre code:代码块底色/字号由 bootstrap 的 pre 与 EnlighterJS
|
||||
* 主题决定,行内皮肤套到块内会把整块代码染成粉底。 */
|
||||
:is(.entry-content, .wp-posts-content) code:not(pre code) {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.9em;
|
||||
color: #ff3c98;
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
.relative{position:relative}.flex{display:flex}.flex.ac,.ac{align-items:center}.flex.jc,.jc{justify-content:center}.flex.jsb,.jsb{justify-content:space-between}.flex.at,.at{align-items:flex-start}.flex.ae,.ae{align-items:flex-end}.flex0{flex:0 0 auto}.flex1{flex:1 1 auto;min-width:0}.flex.column{flex-direction:column}.flex.wrap{flex-wrap:wrap}.flex.flex-row,.flex-row{flex-direction:row}.flex.jse,.jse{justify-content:space-evenly}.flex.jsa,.jsa{justify-content:space-around}.flex>.flex1,.flex .flex1{flex:1;overflow:hidden;min-width:0}.relative-h{position:relative;height:100%}.padding-10{padding:10px}.font-bold{font-weight:700}.mt6{margin-top:6px}.gutters-5{margin:-5px}.gutters-5>*{padding:5px}@media(max-width:767px){.flex.flex-row.flex-col-sm-2{flex-wrap:wrap}.flex.flex-row.flex-col-sm-2>*{flex-basis:50%}}.clearfix:before,.clearfix:after{content:"";display:table}.clearfix:after{clear:both}.abs-right{position:absolute;right:0;top:0}.abs-center{position:absolute;left:0;width:100%;top:50%;right:.7em;transform:translateY(-50%);z-index:1}.abs-center.left-top,.abs-center.right-top{transform:unset;top:0}.abs-center.right-top{left:auto;width:auto;text-align:right}.abs-center.left-top{text-align:left}.abs-center.conter-bottom,.abs-center.conter-conter{text-align:center}.abs-center.right-top,.abs-center.right-bottom,.abs-center.right-conter{text-align:right}.abs-center.conter-bottom,.abs-center.right-bottom,.abs-center.left-bottom{top:auto;transform:unset;bottom:0}.abs-center.left-bottom{left:0;right:auto;text-align:left}.abs-center.right-bottom,.abs-center.right-conter{left:auto;right:0;text-align:right}.graphic,.page-cover{text-shadow:0 0 5px rgba(0,0,0,.2);--main-color: #fff;color:#fff;position:relative;overflow:hidden;box-shadow:0 0 10px var(--main-shadow, rgba(116, 116, 116, .08));padding:0 0 70%;border-radius:var(--main-radius, var(--radius, 8px))}.graphic>.fit-cover,.graphic>img.fit-cover{position:absolute;width:100%;height:100%;object-fit:cover;inset:0}.fit-cover{object-fit:cover;max-width:100%}.title-h-left{position:relative;padding-bottom:8px}.title-h-left:before{transition:.4s;transform-origin:left;position:absolute;content:"";width:40px;height:3px;background:var(--theme-color, var(--focus-color, #f04494));left:0;bottom:3px;border-radius:5px;box-shadow:1px 1px 3px -1px var(--theme-color, var(--focus-color, #f04494))}.line-form-line,.line-form-line:before{position:absolute;bottom:0;left:0;height:1px;width:100%;transition:.8s;background:var(--main-border-color, rgba(50, 50, 50, .06))}.line-form-line:before{content:"";width:0;background:var(--focus-color, #f04494)}.avatar-img{position:relative;display:inline-block;flex-shrink:0;--this-size: 38px;width:var(--this-size);height:var(--this-size)}.avatar-img .avatar,.avatar-img img{width:100%;height:100%;border-radius:50%;object-fit:cover}.avatar-lg{--this-size: 80px}.avatar-md{--this-size: 55px}.avatar-mini{--this-size: 20px}.shrink0{flex-shrink:0}.opacity8{opacity:.8}.muted-color{color:var(--muted-color, var(--color-ink-3))}.muted-2-color{color:var(--muted-2-color, var(--color-ink-4))}.muted-3-color{color:var(--muted-3-color, #b1b1b1)}.muted-4-color{color:var(--muted-4-color, #d2d2d2)}.text-center{text-align:center}.em09{font-size:.9em}.em12{font-size:1.2em}.ml3{margin-left:3px}.ml6{margin-left:6px}.ml10{margin-left:10px}.mr3{margin-right:3px}.mr6{margin-right:6px}.mt10{margin-top:10px}.mt20{margin-top:20px}.mb10{margin-bottom:10px}.mb20{margin-bottom:20px}.text-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.text-ellipsis-2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}.main-bg{background-color:var(--main-bg-color, var(--surface-1))}.separator{position:relative;letter-spacing:.08em}.icon-circle+.icon-circle:before{content:"·";display:inline-block;margin:0 .45em;opacity:.55}.article-avatar name,.article-avatar .name,.user-name{display:inline-flex;align-items:center;gap:4px;min-width:0;max-width:100%}.pull-right{float:right}.pull-left{float:left}body.single main.container .content-layout{display:block;min-width:0}body.single main.container .content-layout>*{min-width:0;max-width:100%}body.single main.container .content-layout>.breadcrumb,body.single main.container .content-layout>ul.breadcrumb,body.single main.container .content-layout>.breadcrumb-nav,body.single main.container .content-layout>.breadcrumbs-wrap{position:relative;z-index:1;margin-top:0;margin-bottom:12px;padding-top:2px}body.single .sidebar .jio-panel,body.single .sidebar .widget{margin-bottom:15px}body.single main.container{box-sizing:border-box}.article,article.article.box-body,.article.main-bg.box-body{padding:0 30px;overflow:hidden}@media(max-width:767px){.article,article.article.box-body,.article.main-bg.box-body{padding:0 15px}.article-header .article-title{font-size:18px}}.entry-header,.article-header{margin-bottom:10px;padding-bottom:0;border-bottom:none;background:transparent;box-shadow:none;boLine truncated
|
||||
.relative{position:relative}.flex{display:flex}.flex.ac,.ac{align-items:center}.flex.jc,.jc{justify-content:center}.flex.jsb,.jsb{justify-content:space-between}.flex.at,.at{align-items:flex-start}.flex.ae,.ae{align-items:flex-end}.flex0{flex:0 0 auto}.flex1{flex:1 1 auto;min-width:0}.flex.column{flex-direction:column}.flex.wrap{flex-wrap:wrap}.flex.flex-row,.flex-row{flex-direction:row}.flex.jse,.jse{justify-content:space-evenly}.flex.jsa,.jsa{justify-content:space-around}.flex>.flex1,.flex .flex1{flex:1;overflow:hidden;min-width:0}.relative-h{position:relative;height:100%}.padding-10{padding:10px}.font-bold{font-weight:700}.mt6{margin-top:6px}.gutters-5{margin:-5px}.gutters-5>*{padding:5px}@media(max-width:767px){.flex.flex-row.flex-col-sm-2{flex-wrap:wrap}.flex.flex-row.flex-col-sm-2>*{flex-basis:50%}}.clearfix:before,.clearfix:after{content:"";display:table}.clearfix:after{clear:both}.abs-right{position:absolute;right:0;top:0}.abs-center{position:absolute;left:0;width:100%;top:50%;right:.7em;transform:translateY(-50%);z-index:1}.abs-center.left-top,.abs-center.right-top{transform:unset;top:0}.abs-center.right-top{left:auto;width:auto;text-align:right}.abs-center.left-top{text-align:left}.abs-center.conter-bottom,.abs-center.conter-conter{text-align:center}.abs-center.right-top,.abs-center.right-bottom,.abs-center.right-conter{text-align:right}.abs-center.conter-bottom,.abs-center.right-bottom,.abs-center.left-bottom{top:auto;transform:unset;bottom:0}.abs-center.left-bottom{left:0;right:auto;text-align:left}.abs-center.right-bottom,.abs-center.right-conter{left:auto;right:0;text-align:right}.graphic,.page-cover{text-shadow:0 0 5px rgba(0,0,0,.2);--main-color: #fff;color:#fff;position:relative;overflow:hidden;box-shadow:0 0 10px var(--main-shadow, rgba(116, 116, 116, .08));padding:0 0 70%;border-radius:var(--main-radius, var(--radius, 8px))}.graphic>.fit-cover,.graphic>img.fit-cover{position:absolute;width:100%;height:100%;object-fit:cover;inset:0}.fit-cover{object-fit:cover;max-width:100%}.title-h-left{position:relative;padding-bottom:8px}.title-h-left:before{transition:.4s;transform-origin:left;position:absolute;content:"";width:40px;height:3px;background:var(--theme-color, var(--focus-color, #f04494));left:0;bottom:3px;border-radius:5px;box-shadow:1px 1px 3px -1px var(--theme-color, var(--focus-color, #f04494))}.line-form-line,.line-form-line:before{position:absolute;bottom:0;left:0;height:1px;width:100%;transition:.8s;background:var(--main-border-color, rgba(50, 50, 50, .06))}.line-form-line:before{content:"";width:0;background:var(--focus-color, #f04494)}.avatar-img{position:relative;display:inline-block;flex-shrink:0;--this-size: 38px;width:var(--this-size);height:var(--this-size)}.avatar-img .avatar,.avatar-img img{width:100%;height:100%;border-radius:50%;object-fit:cover}.avatar-lg{--this-size: 80px}.avatar-md{--this-size: 55px}.avatar-mini{--this-size: 20px}.shrink0{flex-shrink:0}.opacity8{opacity:.8}.muted-color{color:var(--muted-color, var(--color-ink-3))}.muted-2-color{color:var(--muted-2-color, var(--color-ink-4))}.muted-3-color{color:var(--muted-3-color, #b1b1b1)}.muted-4-color{color:var(--muted-4-color, #d2d2d2)}.text-center{text-align:center}.em09{font-size:.9em}.em12{font-size:1.2em}.ml3{margin-left:3px}.ml6{margin-left:6px}.ml10{margin-left:10px}.mr3{margin-right:3px}.mr6{margin-right:6px}.mt10{margin-top:10px}.mt20{margin-top:20px}.mb10{margin-bottom:10px}.mb20{margin-bottom:20px}.text-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.text-ellipsis-2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}.main-bg{background-color:var(--main-bg-color, var(--surface-1))}.separator{position:relative;letter-spacing:.08em}.icon-circle+.icon-circle:before{content:"·";display:inline-block;margin:0 .45em;opacity:.55}.article-avatar name,.article-avatar .name,.user-name{display:inline-flex;align-items:center;gap:4px;min-width:0;max-width:100%}.pull-right{float:right}.pull-left{float:left}body.single main.container .content-layout{display:block;min-width:0}body.single main.container .content-layout>*{min-width:0;max-width:100%}body.single main.container .content-layout>.breadcrumb,body.single main.container .content-layout>ul.breadcrumb,body.single main.container .content-layout>.breadcrumb-nav,body.single main.container .content-layout>.breadcrumbs-wrap{position:relative;z-index:1;margin-top:0;margin-bottom:12px;padding-top:2px}body.single .sidebar .jio-panel,body.single .sidebar .widget{margin-bottom:15px}body.single main.container{box-sizing:border-box}.article,article.article.box-body,.article.main-bg.box-body{padding:0 30px;overflow:hidden}@media(max-width:767px){.article,article.article.box-body,.article.main-bg.box-body{padding:0 15px}.article-header .article-title{font-size:18px}}.entry-header,.article-header{margin-bottom:10px;padding-bottom:0;border-bottom:none;background:transparent;box-shadow:none;boLine truncated
|
||||
@@ -107,28 +107,28 @@ h6 { font-size: 14px; }
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
/* ===== 代码块 — 对齐 legacy ===== */
|
||||
.wp-posts-content pre,
|
||||
/* 代码块容器版式由 bootstrap 的 pre 与 main.css 的 .wp-posts-content 规则提供,
|
||||
* 高亮皮肤由 EnlighterJS 自带主题负责,此处不再叠加二次容器。
|
||||
* 静态页用 .entry-content 包装,这里镜像同一组 pre 规则保持两边一致。 */
|
||||
.entry-content pre,
|
||||
.prose pre {
|
||||
position: relative;
|
||||
background: #282c34;
|
||||
color: #abb2bf;
|
||||
padding: 15px;
|
||||
border-radius: var(--main-radius, 8px);
|
||||
overflow-x: auto;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
margin: 0 0 20px;
|
||||
background: var(--muted-border-color);
|
||||
color: var(--main-color);
|
||||
}
|
||||
|
||||
.wp-posts-content pre code,
|
||||
.entry-content pre code,
|
||||
.prose pre code {
|
||||
color: inherit;
|
||||
background: none;
|
||||
.entry-content pre:not(.wp-block-code),
|
||||
.prose pre:not(.wp-block-code) {
|
||||
border: none;
|
||||
background: 0 0;
|
||||
padding: 0;
|
||||
font-size: inherit;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.entry-content .wp-block-code code,
|
||||
.prose .wp-block-code code {
|
||||
color: inherit;
|
||||
background-color: unset;
|
||||
margin: unset;
|
||||
}
|
||||
|
||||
/* ===== 表格 — 对齐 legacy line 8897 ===== */
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
@import url("legacy-utilities.css");
|
||||
@import url("single-post/shell.css");
|
||||
@import url("single-post/content.css");
|
||||
@import url("single-post/code-blocks.css");
|
||||
@import url("single-post/navigation.css");
|
||||
/* single-post/cover.css 不经 @import 引入:@import 无版本号,浏览器会拿
|
||||
* 旧缓存(含已删除的 .single-cover padding 规则)把封面高度链挤成 0。
|
||||
|
||||
@@ -1,128 +0,0 @@
|
||||
/* ========== 代码块:GitHub 风格 ========== */
|
||||
.code-block {
|
||||
border-radius: var(--radius-code);
|
||||
border: 1px solid var(--color-line);
|
||||
overflow: hidden;
|
||||
margin: 1.5em 0;
|
||||
background: var(--surface-3);
|
||||
}
|
||||
|
||||
.code-block__head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 36px;
|
||||
padding: 0 12px;
|
||||
background: var(--surface-3);
|
||||
border-bottom: 1px solid var(--color-line);
|
||||
font-size: 12px;
|
||||
color: var(--color-ink-3);
|
||||
}
|
||||
|
||||
.code-block__copy {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 6px 12px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--color-line);
|
||||
background: var(--surface-page);
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
color: var(--color-ink-3);
|
||||
}
|
||||
|
||||
.code-block__copy:hover {
|
||||
border-color: var(--color-primary);
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.code-block__body {
|
||||
overflow-x: auto;
|
||||
padding: 16px 20px;
|
||||
font-family: var(--font-mono);
|
||||
font-size: 13.5px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.code-block__body {
|
||||
font-size: 12px;
|
||||
padding: 12px 14px;
|
||||
}
|
||||
}
|
||||
|
||||
:is(.entry-content, .wp-posts-content) pre.wp-block-code,
|
||||
:is(.entry-content, .wp-posts-content) pre:not(.wp-block-preformatted) {
|
||||
border-radius: var(--radius-code);
|
||||
border: 1px solid var(--color-line);
|
||||
background: var(--surface-3);
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
:is(.entry-content, .wp-posts-content) pre code {
|
||||
display: block;
|
||||
padding: 16px 20px;
|
||||
overflow-x: auto;
|
||||
background: transparent;
|
||||
font-size: 13.5px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
/* Syntax highlight utilities (plugin or wrapped markup) */
|
||||
.gh-keyword {
|
||||
color: #cf222e;
|
||||
}
|
||||
|
||||
html.dark .gh-keyword,
|
||||
html.dark .gh-keyword {
|
||||
color: #ff7b72;
|
||||
}
|
||||
|
||||
.gh-string {
|
||||
color: #0a3069;
|
||||
}
|
||||
|
||||
html.dark .gh-string,
|
||||
html.dark .gh-string {
|
||||
color: #a5d6ff;
|
||||
}
|
||||
|
||||
.gh-comment {
|
||||
color: #6e7781;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
html.dark .gh-comment,
|
||||
html.dark .gh-comment {
|
||||
color: #8b949e;
|
||||
}
|
||||
|
||||
.gh-function {
|
||||
color: #8250df;
|
||||
}
|
||||
|
||||
html.dark .gh-function,
|
||||
html.dark .gh-function {
|
||||
color: #d2a8ff;
|
||||
}
|
||||
|
||||
.gh-var {
|
||||
color: #0550ae;
|
||||
}
|
||||
|
||||
html.dark .gh-var,
|
||||
html.dark .gh-var {
|
||||
color: #79c0ff;
|
||||
}
|
||||
|
||||
.gh-op {
|
||||
color: #24292f;
|
||||
}
|
||||
|
||||
html.dark .gh-op,
|
||||
html.dark .gh-op {
|
||||
color: #c9d1d9;
|
||||
}
|
||||
|
||||
@@ -205,8 +205,10 @@ article.article.box-body,
|
||||
margin: 1.5em 0;
|
||||
}
|
||||
|
||||
/* 行内代码 — 对齐 legacy: 粉色文字 + 粉色背景 */
|
||||
:is(.entry-content, .wp-posts-content) code {
|
||||
/* 行内代码 — 对齐 legacy: 粉色文字 + 粉色背景。
|
||||
* 必须排除 pre code:代码块底色/字号由 bootstrap 的 pre 与 EnlighterJS
|
||||
* 主题决定,行内皮肤套到块内会把整块代码染成粉底。 */
|
||||
:is(.entry-content, .wp-posts-content) code:not(pre code) {
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.9em;
|
||||
color: #ff3c98;
|
||||
|
||||
@@ -120,11 +120,6 @@
|
||||
}
|
||||
|
||||
function syncCodeHighlightTheme(isDark) {
|
||||
if (typeof window.JioPrecodeApplyTheme === "function") {
|
||||
window.JioPrecodeApplyTheme(isDark);
|
||||
return;
|
||||
}
|
||||
|
||||
var settings = (window.jioData && window.jioData.codeHighlight) || {};
|
||||
var theme = isDark ? (settings.darkTheme || "monokai") : (settings.lightTheme || "enlighter");
|
||||
document.querySelectorAll(".enlighter-default").forEach(function (el) {
|
||||
|
||||
-1
@@ -1 +0,0 @@
|
||||
/*! EnlighterJS Syntax Highlighter 3.0.0 | Mozilla Public License 2.0 | https://enlighterjs.org */.enlighter-tooltip{z-index:100}.enlighter-default{font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:13px;line-height:1.4;overflow:hidden;white-space:pre-wrap;word-wrap:break-word;margin:0 0 20px 0;padding:0;position:relative;text-align:left;direction:ltr;border-radius:8px}.enlighter-default .enlighter-special:hover{background-color:#f4f8fc}.enlighter-default .enlighter-raw{display:none;white-space:pre-wrap;word-wrap:break-word;box-shadow:none;padding:0 17px!important;color:inherit}.enlighter-toolbar{opacity:0;position:absolute;right:10px;top:8px;z-index:10;transition:.2s}.enlighter-default:hover .enlighter-toolbar{opacity:1}.enlighter-default .enlighter-btn{font:normal normal 900 14px/1 "Font Awesome 5 Free";border-radius:4px;display:inline-block;transition:.15s;padding:.3em .6em;background:rgba(235,237,239,.8);color:#666;font-size:14px;margin-left:6px;cursor:pointer}.enlighter-default .enlighter-btn:hover{color:#157ff9}.enlighter-t-atomic .enlighter-btn,.enlighter-t-dracula .enlighter-btn,.enlighter-t-monokai .enlighter-btn{background:rgba(57,60,66,.87)}.enlighter-default .enlighter-toolbar .enlighter-btn-raw::after{content:"\f121"}.enlighter-default .enlighter-toolbar .enlighter-btn-copy::after{content:"\f0ea"}.enlighter-default .enlighter-toolbar .enlighter-btn-window::after{content:"\f1b2"}.enlighter-origin{display:none!important}.enlighter-clipboard{position:absolute;left:0;bottom:0;width:1px;height:1px;overflow:hidden}.enlighter-v-inline{display:inline-block;overflow:inherit;margin:0}.enlighter-v-standard{display:block}.enlighter-v-codegroup{display:block}.enlighter-v-codegroup .enlighter-codegroup-wrapper{position:relative}div.enlighter{width:100%;border-collapse:collapse;border-spacing:0;padding:12px 0;empty-cells:show;min-width:100%;font-size:10px;margin:0;text-indent:0;-webkit-overflow-scrolling:touch;counter-reset:enlighter 0}div.enlighter>div{margin:0;border:solid 0 #fff;list-style:none;font-size:inherit;line-height:1.4;min-height:14px}div.enlighter>div>div{display:table-cell;width:100%;padding-left:10px}div.enlighter>div>div::before{content:" "}span.enlighter{display:inline-block;padding:3px 5px 1px 5px;margin:0 2px 0 2px}.enlighter span{margin:0;padding:0;line-height:inherit;font-size:13px;font-family:inherit}.enlighter-linenumbers div.enlighter>div::before{white-space:nowrap;display:block;display:table-cell;width:45px;min-width:45px;counter-increment:enlighter;content:counter(enlighter,decimal) ".";text-align:right;padding-right:8px}.enlighter-overflow-scroll.enlighter-v-standard .enlighter{overflow-x:auto;word-wrap:normal!important}.enlighter-overflow-scroll.enlighter-v-codegroup .enlighter-codegroup-wrapper{overflow-x:auto;word-wrap:normal!important}.enlighter-overflow-scroll.enlighter-v-codegroup .enlighter>div>div,.enlighter-overflow-scroll.enlighter-v-standard .enlighter>div>div{white-space:pre!important}.enlighter-overflow-scroll.enlighter-v-codegroup .enlighter-raw,.enlighter-overflow-scroll.enlighter-v-standard .enlighter-raw{white-space:pre!important}.enlighter-show-rawcode .enlighter-raw{padding:12px 16px!important;display:block}.enlighter-show-rawcode .enlighter{display:none!important}.enlighter-t-enlighter{color:#555;background:#f8f9fa}.enlighter-t-enlighter.enlighter-hover div.enlighter>div:hover{color:#444;background-color:#fffcd3}.enlighter-t-enlighter div.enlighter>div{color:#aaa}.enlighter-t-enlighter div.enlighter>div.enlighter-special{background-color:#fdf5f0}.enlighter-t-enlighter.enlighter-linenumbers div.enlighter>div::before{border-right:solid 1px #e8e8e8}.enlighter-t-enlighter .enlighter-text{color:#555}.enlighter-t-enlighter .enlighter-c0{color:#99a}.enlighter-t-enlighter .enlighter-c1{color:#99a}.enlighter-t-enlighter .enlighter-c2{color:#99a}.enlighter-t-enlighter .enlighter-c9{color:#9baa8f}.enlighter-t-enlighter .enlighter-k0{color:#286491;font-weight:700}.enlighter-t-enlighter .enlighter-k1{color:#4573f7;font-weight:700}.enlighter-t-enlighter .enlighter-k2{color:#458;font-weight:700}.enlighter-t-enlighter .enlighter-k3{color:#4da0d2;background-color:#f0f0f0}.enlighter-t-enlighter .enlighter-k4{color:#4a9141;font-weight:700}.enlighter-t-enlighter .enlighter-k5{color:#286491;font-weight:700}.enlighter-t-enlighter .enlighter-k6{color:#286491;font-style:italic}.enlighter-t-enlighter .enlighter-k7{color:#286491;font-weight:700}.enlighter-t-enlighter .enlighter-k8{color:#4da0d2}.enlighter-t-enlighter .enlighter-k9{color:#990073;font-weight:700}.enlighter-t-enlighter .enlighter-k10{color:#4a9141;font-style:italic}.enlighter-t-enlighter .enlighter-e0{color:#34068a;font-weight:700}.enlighter-t-enlighter .enlighter-e1{color:#34068a;font-weight:700}.enlighter-t-enlighter .enlighter-e2{color:#009926}.enlighter-t-enlighter .enlighter-e3{color:#286491}.enlighter-t-enlighter .enlighter-e4{color:#ff8c00;font-style:italic}.enlighter-t-enlighter .enlighter-s0{color:Line truncated
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
var EnlighterJS=function(e){"use strict";function t(e,t,r,n,s){return{text:e,type:t,index:n||0,end:e.length+n,filter:r||null,priority:s||0}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t,r){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,t);if(void 0===n){var i=Object.getPrototypeOf(e);return null===i?void 0:s(i,t,r)}if("value"in n)return n.value;var o=n.get;return void 0!==o?o.call(r):void 0}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(){r(this,a),this.rules=[],this.setupLanguage()}function g(){return r(this,g),o(this,(g.__proto__||Object.getPrototypeOf(g)).apply(this,arguments))}function l(){return r(this,l),o(this,(l.__proto__||Object.getPrototypeOf(l)).apply(this,arguments))}function p(){return r(this,p),o(this,(p.__proto__||Object.getPrototypeOf(p)).apply(this,arguments))}function u(){return r(this,u),o(this,(u.__proto__||Object.getPrototypeOf(u)).apply(this,arguments))}function c(e,r,n){for(var s=[],i=0,o=void 0;null!=(o=r.exec(e.text));){i<o.index&&s.push(t(e.text.substring(i,o.index),e.type,null,i));for(var a=n(o,e.type)||[],g=0;g<a.length;g++)s.push(a[g]);i=o.index+o[0].length,r.lastIndex=i}return 0==s.length?[e]:(i<e.text.length&&s.push(t(e.text.substring(i),e.type,null,i)),s)}function y(){return r(this,y),o(this,(y.__proto__||Object.getPrototypeOf(y)).apply(this,arguments))}function b(){return r(this,b),o(this,(b.__proto__||Object.getPrototypeOf(b)).apply(this,arguments))}function f(){return r(this,f),o(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}function h(){return r(this,h),o(this,(h.__proto__||Object.getPrototypeOf(h)).apply(this,arguments))}function d(){return r(this,d),o(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}function x(){return r(this,x),o(this,(x.__proto__||Object.getPrototypeOf(x)).apply(this,arguments))}function m(){return r(this,m),o(this,(m.__proto__||Object.getPrototypeOf(m)).apply(this,arguments))}function k(){return r(this,k),o(this,(k.__proto__||Object.getPrototypeOf(k)).apply(this,arguments))}function _(){return r(this,_),o(this,(_.__proto__||Object.getPrototypeOf(_)).apply(this,arguments))}function w(){return r(this,w),o(this,(w.__proto__||Object.getPrototypeOf(w)).apply(this,arguments))}function v(){return r(this,v),o(this,(v.__proto__||Object.getPrototypeOf(v)).apply(this,arguments))}function C(){return r(this,C),o(this,(C.__proto__||Object.getPrototypeOf(C)).apply(this,arguments))}function O(){return r(this,O),o(this,(O.__proto__||Object.getPrototypeOf(O)).apply(this,arguments))}function S(){return r(this,S),o(this,(S.__proto__||Object.getPrototypeOf(S)).apply(this,arguments))}function A(){return r(this,A),o(this,(A.__proto__||Object.getPrototypeOf(A)).apply(this,arguments))}function L(){return r(this,L),o(this,(L.__proto__||Object.getPrototypeOf(L)).apply(this,arguments))}function j(){return r(this,j),o(this,(j.__proto__||Object.getPrototypeOf(j)).apply(this,arguments))}function q(){return r(this,q),o(this,(q.__proto__||Object.getPrototypeOf(q)).apply(this,arguments))}function E(){return r(this,E),o(this,(E.__proto__||Object.getPrototypeOf(E)).apply(this,arguments))}function P(){return r(this,P),o(this,(P.__proto__||Object.getPrototypeOf(P)).apply(this,arguments))}function W(){return r(this,W),o(this,(W.__proto__||Object.getPrototypeOf(W)).apply(this,arguments))}function $(){return r(this,$),o(this,($.__proto__||Object.getPrototypeOf($)).apply(this,arguments))}function I(){return r(this,I),o(this,(I.__proto__||Object.getPrototypeOf(I)).apply(this,arguments))}function N(){return r(this,N),o(this,(N.__proto__||Object.getPrototypeOf(N)).apply(this,arguments))}function F(){return r(this,F),o(this,(F.__proto__||Object.getPrototypeOf(F)).apply(this,arguments))}function D(){return r(this,D),o(this,(D.__proto__||Object.getPrototypeOf(D)).apply(this,arguments))}function T(){return r(this,T),o(this,(T.__proto__||Object.getPrototypeOf(T)).apply(this,arguments))}function R(){return r(this,R),o(this,(R.__proto__||Object.getPrototypeOf(R)).apply(this,arguments))}function Z(){return r(this,Z),o(this,(Z.__proto__||Object.getPrototypeOf(Z)).apply(this,arguments))}function z(){return r(this,z),o(this,(z.__proto__||Object.getPrototypeOf(z)).apply(this,arguments))}function B(){return r(this,B),o(this,(B.__proto__||Object.getPrototypeOf(B)).apply(this,argumentLine truncated
|
||||
regex:/\b(Data|Do|DynamicParam|Exit|Filter|From|Function|In|InlineScript|Hidden|Parallel|Param|Process|Return|Sequence|Trap|Workflow)\b/gi,type:"k0"},{regex:/\b([A-Z]\w+(?:-\w+)+)\b/g,type:"m0"},{regex:/<#[\S\s]+?#>/gi,type:"c1"},ve.poundComments,{regex:/\$[A-Z_][\w]*/gim,type:"k7"},ve.mCalls,ve.fCalls,ve.int,ve.floats,ve.brackets]}}]),W),Xe=(i($,Se),Ce($,[{key:"setupLanguage",value:function(){this.rules=[{regex:/(%.*)$/gm,type:"c0"},ve.blockComments,ve.dqStrings,ve.sqStrings,{regex:/^(\w+)(?:\(.*?\))?\s*(?::-|\.)/gm,type:"k9"},{regex:/\b(true|false|Yes|No|not|fail)\b/gi,type:"e0"},{regex:/\b(catch|throw|repeat)\b/g,type:"k1"},{regex:/^(\?-)/g,type:"k9"},{regex:/\b(is)\b/g,type:"k3"},{regex:/[A-Z_][\w]*/g,type:"k7"},ve.brackets,ve.floats,ve.int,ve.fCalls]}}]),$),Ke=(i(I,Se),Ce(I,[{key:"setupLanguage",value:function(){this.rules=[ve.dqStrings,ve.prop,{regex:/\b([A-Z]\w+)\b/g,type:"k5"},{regex:/^(import)(\s+[\w.]+)/gm,type:["k0","k5"]},{regex:/\b(bool|char|double|float|int|long|short|void|string)\b/g,type:"k5"},ve.mCalls,ve.null,ve.boolean,ve.slashComments,ve.blockComments,ve.int,ve.floats,ve.brackets]}}]),I),et=(i(N,Se),Ce(N,[{key:"setupLanguage",value:function(){this.rules=[{regex:/^(.*?)$/g,type:"text"}]}}]),N),tt=(i(F,Se),Ce(F,[{key:"setupLanguage",value:function(){function e(e){return e.text.match(/^%r/)?e.type="e2":e.text.match(/^%x/)&&(e.type="e4"),[e]}this.rules=[ve.dqStrings,ve.sqStrings,ve.heredoc,{regex:/(`(?:[^`\\]|\\.)*`)/g,type:"e4"},ve.boolean,{regex:/\b(nil)\b/gi,type:"e1"},ve.fCalls,ve.prop,{regex:/@{1,2}[A-Za-z_]\w*\W/g,type:"k7"},{regex:/[^:](:[\w]+)\b/g,type:"k6"},{regex:/(\$[a-z0-9_-]+|\$.)\W/gi,type:"k9"},{regex:/\b(begin|break|case|do|else|elsif|end|ensure|for|if|in|next|redo|rescue|retry|then|unless|until|when|while)\b/gi,type:"k1"},{regex:/\b((?:__)?[A-Z][A-Z0-9_]+)\b/g,type:"e3"},{regex:/\b(alias|class|defined\?|undef|def|module|return|self|super|yield)\W/gi,type:"k0"},{regex:/\b(and|not|or)\b/gi,type:"k3"},ve.poundComments,{regex:/^=begin[\S\s]*?^=end/gim,type:"c2"},{regex:/(%[iqrswx](\W)(?:[^\2\n\\]|\\.)*\2[iomx]*)/gim,type:"s2",filter:e},{regex:/(%[iqrswx]?(\{(?:[^}\\]|\\.)*}|\[(?:[^}\\]|\\.)*]|\((?:[^)\\]|\\.)*\))[iomx]*)/gim,type:"s2",filter:e},{regex:/\W(\/(?:[^/\\]|\\.)*\/\w*)\W/g,type:"e2"},{regex:/\W\?(?:\w|\\M|\\C)(?:-\w|-\\M|-\\C)*\b/g,type:"n1"},{regex:/[\b\W](-?\d[\d_]+?)(?!\.)\b/g,type:"n1"},{regex:/[\b\W](-?0x[A-F0-9][A-F0-9_]+)\b/gi,type:"n2"},{regex:/[\b\W](-?0b[01][01_]+)\b/gi,type:"n3"},{regex:/[\b\W](-?[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?[ji]?)\b/gi,type:"n0"},ve.brackets]}}]),F),rt=(i(D,Se),Ce(D,[{key:"setupLanguage",value:function(){this.rules=[ve.char,{regex:/r((#+)".*?"\2)/gm,type:"s0"},{regex:/("(?:\\.|\\\s*\n|\\s*\r\n|[^\\"])*")/g,type:"s0"},{regex:/^\s*#.*$/gm,type:"k4"},{regex:/fn\s+([\w]+)\s*(<\w+\s*>)?\(/gm,type:"k0"},{regex:/\b\.?([\w]+)\s*(\(|::)/gm,type:"k1"},{regex:/\b([\w]+)!/gm,type:"k9"},{regex:/\bself\b/gi,type:"k9"},ve.boolean,{regex:/\b(while|loop|in|for|if|else|do|continue|break)\b/g,type:"k1"},{regex:/\b(type|struct|let|enum)\b/g,type:"k2"},{regex:/\b(const)\b/g,type:"k8"},{regex:/\b(yield|where|virtual|use|unsized|unsafe|trait|super|static|return|ref|pure|pub|proc|priv|override|offsetof|mut|move|mod|match|macro|impl|fn|final|extern|crate|box|become|as|alignof|abstract)\b/g,type:"k0"},{regex:/\b(sizeof|typeof)\b/g,type:"k3"},{regex:/\b([0-9_]+\.?[0-9_]+?(e\+[0-9_]+)?)(?:f32|f64)?\b/gim,type:"n0"},{regex:/\b([0-9_]+|0o[0-9_]+|0x[A-F0-9_]+|0b[0-1_]+)(?:u8|i8|u16|i16|u32|i32|u64|i64|isize|usize)?\b/gim,type:"n1"},ve.slashComments,ve.blockComments,{regex:/(?:^|[^\\])\/\/[/!].*$/gm,type:"c2"},{regex:/\/\*[*!][\s\S]*?\*\//gm,type:"c2"},ve.brackets,{regex:/\W(&)\w/g,type:"k3"}]}}]),D),nt=(i(T,Se),Ce(T,[{key:"setupLanguage",value:function(){this.rules=[ve.dqStrings,ve.char,{regex:/s"(?:[^"\\]|\\.)*"/g,type:"s2"},{regex:/`(?:[^`\\]|\\.)*`/g,type:"k7"},{regex:/@[\W\w_][\w]+/g,type:"s9"},{regex:/\b([A-Z]\w*)\b/g,type:"k5"},{regex:/\b(while|try|catch|else|throw|break|if|do|goto|switch|for|match)\b/g,type:"k1"},{regex:/(package|import)(\s+[\w.]+)/gm,type:["k0","k10"]},{regex:/[\b\w\s)](_|:|@|#|<-|←|<:|<%|=|=>|⇒|>:)[\b\w\s]/g,type:"k3"},{regex:/\b(abstract|class|case|extends|final|finally|forSome|implicit|lazy|object|override|private|protected|return|sealed|trait|with|yield)\b/g,type:"k0"},{regex:/\b(def)\s+(\w+)\b/gm,type:["k2","m0"]},{regex:/\b(type)\s+(\w+)\b/gm,type:["k2","k5"]},{regex:/\b(val)\s+(\w+)\b/gm,type:["k2","k7"]},{regex:/\b(var)\s+(\w+)\b/gm,type:["k2","k7"]},{regex:/\b(this|super)\b/g,type:"k9"},{regex:/\b(new)\b/g,type:"k3"},ve.mCalls,ve.fCalls,ve.null,ve.boolean,ve.slashComments,ve.blockComments,ve.docComments,ve.int,ve.floats,ve.bin,ve.brackets]}}]),T),st=(i(R,Pe),Ce(R,[{key:"setupLanguage",value:function(){s(R.prototype.__proto__||Object.getPrototypeOf(R.prototype),"setupLanguage",this).call(this);var e=[ve.slashComments,{regex:/\b([\w-]+)\s*\(/gm,type:"m0"},{regex:/\$[\w-]+\b/g,type:"k7"},{regex:/@[\w-]+\b/g,type:"k9"},{regex:/&/gi,Line truncated
|
||||
@@ -1,222 +0,0 @@
|
||||
/**
|
||||
* Jio Code Block Enhancements
|
||||
*
|
||||
* Integrates EnlighterJS for syntax highlighting and adds
|
||||
* copy-to-clipboard buttons and language labels to code blocks.
|
||||
* No jQuery dependency — pure vanilla JS.
|
||||
*
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var BASE_URI = (window.jioData && window.jioData.themeUri) || '';
|
||||
var STYLE_ID = 'jio-enlighter-css';
|
||||
var ENLIGHTER_LOADED = false;
|
||||
|
||||
function getHighlightSettings() {
|
||||
return (window.jioData && window.jioData.codeHighlight) || {};
|
||||
}
|
||||
|
||||
function isDarkTheme(value) {
|
||||
if (typeof value === 'boolean') return value;
|
||||
return document.documentElement.classList.contains('dark') ||
|
||||
document.documentElement.getAttribute('data-theme') === 'dark';
|
||||
}
|
||||
|
||||
function getThemeName(isDark) {
|
||||
var settings = getHighlightSettings();
|
||||
return isDarkTheme(isDark) ? (settings.darkTheme || 'monokai') : (settings.lightTheme || 'enlighter');
|
||||
}
|
||||
|
||||
function applyEnlighterTheme(isDark) {
|
||||
var settings = getHighlightSettings();
|
||||
if (settings.enabled === false) return;
|
||||
|
||||
var theme = getThemeName(isDark);
|
||||
document.querySelectorAll('.enlighter-default').forEach(function (el) {
|
||||
el.className = el.className.replace(/\benlighter-t-[\w-]+\b/g, '').replace(/\s+/g, ' ').trim();
|
||||
el.classList.add('enlighter-t-' + theme);
|
||||
});
|
||||
}
|
||||
|
||||
window.JioPrecodeApplyTheme = applyEnlighterTheme;
|
||||
|
||||
// ── Copy Button Styles ──
|
||||
|
||||
var COPY_STYLE_ID = 'jio-precode-style';
|
||||
|
||||
function injectCopyStyle() {
|
||||
if (document.getElementById(COPY_STYLE_ID)) return;
|
||||
var style = document.createElement('style');
|
||||
style.id = COPY_STYLE_ID;
|
||||
style.textContent =
|
||||
'.jio-code-copy{position:absolute;top:6px;right:8px;border:none;background:rgba(255,255,255,0.08);color:#a6adc8;cursor:pointer;padding:3px 10px;border-radius:6px;font-size:12px;z-index:10;transition:all 0.2s;backdrop-filter:blur(4px);}' +
|
||||
'.jio-code-copy:hover{background:rgba(255,255,255,0.15);color:#cdd6f4;}' +
|
||||
'.jio-code-copy.is-copied{color:#a6e3a1;}' +
|
||||
'.enlighter-default{position:relative;}' +
|
||||
'.enlighter-default .jio-code-copy{top:4px;right:4px;}' +
|
||||
'pre{position:relative;}' +
|
||||
'pre .jio-code-copy{top:8px;right:8px;}';
|
||||
document.head.appendChild(style);
|
||||
}
|
||||
|
||||
// ── EnlighterJS CSS Injection ──
|
||||
|
||||
function injectEnlighterCSS() {
|
||||
if (document.getElementById(STYLE_ID)) return;
|
||||
var link = document.createElement('link');
|
||||
link.id = STYLE_ID;
|
||||
link.rel = 'stylesheet';
|
||||
link.href = BASE_URI + '/assets/js/enlighter/enlighterjs.min.css';
|
||||
document.head.appendChild(link);
|
||||
}
|
||||
|
||||
// ── EnlighterJS Loader ──
|
||||
|
||||
function loadEnlighterJS(callback) {
|
||||
if (ENLIGHTER_LOADED && window.EnlighterJS) {
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
|
||||
injectEnlighterCSS();
|
||||
|
||||
var script = document.createElement('script');
|
||||
script.src = BASE_URI + '/assets/js/enlighter/enlighterjs.min.js';
|
||||
script.onload = function () {
|
||||
ENLIGHTER_LOADED = true;
|
||||
callback();
|
||||
};
|
||||
script.onerror = function () {
|
||||
// Fallback: just add copy buttons without highlighting
|
||||
addCopyButtonsPlain();
|
||||
};
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
|
||||
// ── Copy to Clipboard ──
|
||||
|
||||
function copyToClipboard(text, btn) {
|
||||
if (navigator.clipboard && navigator.clipboard.writeText) {
|
||||
navigator.clipboard.writeText(text).then(function () {
|
||||
showCopied(btn);
|
||||
});
|
||||
} else {
|
||||
var ta = document.createElement('textarea');
|
||||
ta.value = text;
|
||||
ta.style.cssText = 'position:fixed;left:-9999px;';
|
||||
document.body.appendChild(ta);
|
||||
ta.select();
|
||||
try { document.execCommand('copy'); showCopied(btn); } catch (e) { /* ignore */ }
|
||||
document.body.removeChild(ta);
|
||||
}
|
||||
}
|
||||
|
||||
function showCopied(btn) {
|
||||
btn.textContent = '已复制';
|
||||
btn.classList.add('is-copied');
|
||||
setTimeout(function () {
|
||||
btn.textContent = '复制';
|
||||
btn.classList.remove('is-copied');
|
||||
}, 1500);
|
||||
}
|
||||
|
||||
function createCopyButton(text) {
|
||||
var btn = document.createElement('button');
|
||||
btn.className = 'jio-code-copy';
|
||||
btn.textContent = '复制';
|
||||
btn.type = 'button';
|
||||
btn.addEventListener('click', function () {
|
||||
copyToClipboard(text, btn);
|
||||
});
|
||||
return btn;
|
||||
}
|
||||
|
||||
// ── EnlighterJS Integration ──
|
||||
|
||||
function initEnlighter() {
|
||||
if (!window.EnlighterJS) return;
|
||||
|
||||
// Get settings from jioData or use defaults
|
||||
var settings = getHighlightSettings();
|
||||
if (settings.enabled === false) return; // 后台关闭代码高亮
|
||||
|
||||
var lineNumbers = settings.lineNumbers === true;
|
||||
var showButtons = settings.showButtons !== false;
|
||||
var maxHeight = settings.maxHeight || 400;
|
||||
|
||||
var currentTheme = getThemeName();
|
||||
|
||||
// Find all code blocks that haven't been processed
|
||||
var blocks = document.querySelectorAll('pre > code:not(.enlighter-origin)');
|
||||
if (blocks.length === 0) return;
|
||||
|
||||
// Process each block
|
||||
blocks.forEach(function (code) {
|
||||
var pre = code.parentElement;
|
||||
if (!pre || pre.dataset.jioEnhanced) return;
|
||||
|
||||
// Get raw text before EnlighterJS processes it
|
||||
var rawText = code.textContent;
|
||||
|
||||
// Apply EnlighterJS
|
||||
try {
|
||||
EnlighterJS.enlight(code, {
|
||||
theme: currentTheme,
|
||||
linenumbers: lineNumbers,
|
||||
indent: 2,
|
||||
textOverflow: 'scroll',
|
||||
rawcodeDbclick: true,
|
||||
rawButton: showButtons,
|
||||
infoButton: showButtons,
|
||||
windowButton: showButtons
|
||||
});
|
||||
} catch (e) {
|
||||
// If EnlighterJS fails, keep the plain block
|
||||
}
|
||||
|
||||
// Add copy button after EnlighterJS processing
|
||||
var container = pre.querySelector('.enlighter-default') || pre;
|
||||
container.appendChild(createCopyButton(rawText));
|
||||
pre.dataset.jioEnhanced = '1';
|
||||
|
||||
// Apply max-height
|
||||
if (maxHeight > 0) {
|
||||
pre.style.maxHeight = maxHeight + 'px';
|
||||
pre.style.overflow = 'auto';
|
||||
}
|
||||
});
|
||||
|
||||
applyEnlighterTheme();
|
||||
}
|
||||
|
||||
// ── Fallback: Plain code blocks with copy buttons ──
|
||||
|
||||
function addCopyButtonsPlain() {
|
||||
var blocks = document.querySelectorAll('pre > code');
|
||||
blocks.forEach(function (code) {
|
||||
var pre = code.parentElement;
|
||||
if (!pre || pre.dataset.jioEnhanced) return;
|
||||
pre.style.position = 'relative';
|
||||
pre.appendChild(createCopyButton(code.textContent));
|
||||
pre.dataset.jioEnhanced = '1';
|
||||
});
|
||||
}
|
||||
|
||||
// ── Main Init ──
|
||||
|
||||
function init() {
|
||||
injectCopyStyle();
|
||||
|
||||
// Check if there are any code blocks on the page
|
||||
var blocks = document.querySelectorAll('pre > code');
|
||||
if (blocks.length === 0) return;
|
||||
|
||||
// Load EnlighterJS and initialize
|
||||
loadEnlighterJS(initEnlighter);
|
||||
}
|
||||
|
||||
jQuery(document).off('auto_fun.jio-precode').on('auto_fun.jio-precode', function () { init(document); });
|
||||
})();
|
||||
@@ -67,12 +67,14 @@
|
||||
background: rgba(57, 60, 66, 0.87)
|
||||
}
|
||||
|
||||
/* 字形码位随 FA5 重新映射:旧版 \f0ea 在 FA4 是剪贴板,FA5 里同码位变成
|
||||
* 粘贴,剪贴板移到 \f328。其余两个码位在 FA5 中保持同名。 */
|
||||
.enlighter-default .enlighter-toolbar .enlighter-btn-raw::after {
|
||||
content: "\f121"
|
||||
}
|
||||
|
||||
.enlighter-default .enlighter-toolbar .enlighter-btn-copy::after {
|
||||
content: "\f0ea"
|
||||
content: "\f328"
|
||||
}
|
||||
|
||||
.enlighter-default .enlighter-toolbar .enlighter-btn-window::after {
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
/*! EnlighterJS Syntax Highlighter 3.0.0 | Mozilla Public License 2.0 | https://enlighterjs.org */.enlighter-tooltip{z-index:100}.enlighter-default{font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:13px;line-height:1.4;overflow:hidden;white-space:pre-wrap;word-wrap:break-word;margin:0 0 20px 0;padding:0;position:relative;text-align:left;direction:ltr;border-radius:8px}.enlighter-default .enlighter-special:hover{background-color:#f4f8fc}.enlighter-default .enlighter-raw{display:none;white-space:pre-wrap;word-wrap:break-word;box-shadow:none;padding:0 17px!important;color:inherit}.enlighter-toolbar{opacity:0;position:absolute;right:10px;top:8px;z-index:10;transition:.2s}.enlighter-default:hover .enlighter-toolbar{opacity:1}.enlighter-default .enlighter-btn{font: normal normal 900 14px/1 "Font Awesome 5 Free";border-radius:4px;display:inline-block;transition:.15s;padding:.3em .6em;background:rgba(235,237,239,.8);color:#666;font-size:14px;margin-left:6px;cursor:pointer}.enlighter-default .enlighter-btn:hover{color:#157ff9}.enlighter-t-atomic .enlighter-btn,.enlighter-t-dracula .enlighter-btn,.enlighter-t-monokai .enlighter-btn{background:rgba(57,60,66,.87)}.enlighter-default .enlighter-toolbar .enlighter-btn-raw::after{content:"\f121"}.enlighter-default .enlighter-toolbar .enlighter-btn-copy::after{content:"\f0ea"}.enlighter-default .enlighter-toolbar .enlighter-btn-window::after{content:"\f1b2"}.enlighter-origin{display:none!important}.enlighter-clipboard{position:absolute;left:0;bottom:0;width:1px;height:1px;overflow:hidden}.enlighter-v-inline{display:inline-block;overflow:inherit;margin:0}.enlighter-v-standard{display:block}.enlighter-v-codegroup{display:block}.enlighter-v-codegroup .enlighter-codegroup-wrapper{position:relative}div.enlighter{width:100%;border-collapse:collapse;border-spacing:0;padding:12px 0;empty-cells:show;min-width:100%;font-size:10px;margin:0;text-indent:0;-webkit-overflow-scrolling:touch;counter-reset:enlighter 0}div.enlighter>div{margin:0;border:solid 0 #fff;list-style:none;font-size:inherit;line-height:1.4;min-height:14px}div.enlighter>div>div{display:table-cell;width:100%;padding-left:10px}div.enlighter>div>div::before{content:" "}span.enlighter{display:inline-block;padding:3px 5px 1px 5px;margin:0 2px 0 2px}.enlighter span{margin:0;padding:0;line-height:inherit;font-size:13px;font-family:inherit}.enlighter-linenumbers div.enlighter>div::before{white-space:nowrap;display:block;display:table-cell;width:45px;min-width:45px;counter-increment:enlighter;content:counter(enlighter,decimal) ".";text-align:right;padding-right:8px}.enlighter-overflow-scroll.enlighter-v-standard .enlighter{overflow-x:auto;word-wrap:normal!important}.enlighter-overflow-scroll.enlighter-v-codegroup .enlighter-codegroup-wrapper{overflow-x:auto;word-wrap:normal!important}.enlighter-overflow-scroll.enlighter-v-codegroup .enlighter>div>div,.enlighter-overflow-scroll.enlighter-v-standard .enlighter>div>div{white-space:pre!important}.enlighter-overflow-scroll.enlighter-v-codegroup .enlighter-raw,.enlighter-overflow-scroll.enlighter-v-standard .enlighter-raw{white-space:pre!important}.enlighter-show-rawcode .enlighter-raw{padding:12px 16px!important;display:block}.enlighter-show-rawcode .enlighter{display:none!important}.enlighter-t-enlighter{color:#555;background:#f8f9fa}.enlighter-t-enlighter.enlighter-hover div.enlighter>div:hover{color:#444;background-color:#fffcd3}.enlighter-t-enlighter div.enlighter>div{color:#aaa}.enlighter-t-enlighter div.enlighter>div.enlighter-special{background-color:#fdf5f0}.enlighter-t-enlighter.enlighter-linenumbers div.enlighter>div::before{border-right:solid 1px #e8e8e8}.enlighter-t-enlighter .enlighter-text{color:#555}.enlighter-t-enlighter .enlighter-c0{color:#99a}.enlighter-t-enlighter .enlighter-c1{color:#99a}.enlighter-t-enlighter .enlighter-c2{color:#99a}.enlighter-t-enlighter .enlighter-c9{color:#9baa8f}.enlighter-t-enlighter .enlighter-k0{color:#286491;font-weight:700}.enlighter-t-enlighter .enlighter-k1{color:#4573f7;font-weight:700}.enlighter-t-enlighter .enlighter-k2{color:#458;font-weight:700}.enlighter-t-enlighter .enlighter-k3{color:#4da0d2;background-color:#f0f0f0}.enlighter-t-enlighter .enlighter-k4{color:#4a9141;font-weight:700}.enlighter-t-enlighter .enlighter-k5{color:#286491;font-weight:700}.enlighter-t-enlighter .enlighter-k6{color:#286491;font-style:italic}.enlighter-t-enlighter .enlighter-k7{color:#286491;font-weight:700}.enlighter-t-enlighter .enlighter-k8{color:#4da0d2}.enlighter-t-enlighter .enlighter-k9{color:#990073;font-weight:700}.enlighter-t-enlighter .enlighter-k10{color:#4a9141;font-style:italic}.enlighter-t-enlighter .enlighter-e0{color:#34068a;font-weight:700}.enlighter-t-enlighter .enlighter-e1{color:#34068a;font-weight:700}.enlighter-t-enlighter .enlighter-e2{color:#009926}.enlighter-t-enlighter .enlighter-e3{color:#286491}.enlighter-t-enlighter .enlighter-e4{color:#ff8c00;font-style:italic}.enlighter-t-enlighter .enlighter-s0{colorLine truncated
|
||||
/*! EnlighterJS Syntax Highlighter 3.0.0 | Mozilla Public License 2.0 | https://enlighterjs.org */.enlighter-tooltip{z-index:100}.enlighter-default{font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:13px;line-height:1.4;overflow:hidden;white-space:pre-wrap;word-wrap:break-word;margin:0 0 20px 0;padding:0;position:relative;text-align:left;direction:ltr;border-radius:8px}.enlighter-default .enlighter-special:hover{background-color:#f4f8fc}.enlighter-default .enlighter-raw{display:none;white-space:pre-wrap;word-wrap:break-word;box-shadow:none;padding:0 17px!important;color:inherit}.enlighter-toolbar{opacity:0;position:absolute;right:10px;top:8px;z-index:10;transition:.2s}.enlighter-default:hover .enlighter-toolbar{opacity:1}.enlighter-default .enlighter-btn{font: normal normal 900 14px/1 "Font Awesome 5 Free";border-radius:4px;display:inline-block;transition:.15s;padding:.3em .6em;background:rgba(235,237,239,.8);color:#666;font-size:14px;margin-left:6px;cursor:pointer}.enlighter-default .enlighter-btn:hover{color:#157ff9}.enlighter-t-atomic .enlighter-btn,.enlighter-t-dracula .enlighter-btn,.enlighter-t-monokai .enlighter-btn{background:rgba(57,60,66,.87)}.enlighter-default .enlighter-toolbar .enlighter-btn-raw::after{content:"\f121"}.enlighter-default .enlighter-toolbar .enlighter-btn-copy::after{content:"\f328"}.enlighter-default .enlighter-toolbar .enlighter-btn-window::after{content:"\f1b2"}.enlighter-origin{display:none!important}.enlighter-clipboard{position:absolute;left:0;bottom:0;width:1px;height:1px;overflow:hidden}.enlighter-v-inline{display:inline-block;overflow:inherit;margin:0}.enlighter-v-standard{display:block}.enlighter-v-codegroup{display:block}.enlighter-v-codegroup .enlighter-codegroup-wrapper{position:relative}div.enlighter{width:100%;border-collapse:collapse;border-spacing:0;padding:12px 0;empty-cells:show;min-width:100%;font-size:10px;margin:0;text-indent:0;-webkit-overflow-scrolling:touch;counter-reset:enlighter 0}div.enlighter>div{margin:0;border:solid 0 #fff;list-style:none;font-size:inherit;line-height:1.4;min-height:14px}div.enlighter>div>div{display:table-cell;width:100%;padding-left:10px}div.enlighter>div>div::before{content:" "}span.enlighter{display:inline-block;padding:3px 5px 1px 5px;margin:0 2px 0 2px}.enlighter span{margin:0;padding:0;line-height:inherit;font-size:13px;font-family:inherit}.enlighter-linenumbers div.enlighter>div::before{white-space:nowrap;display:block;display:table-cell;width:45px;min-width:45px;counter-increment:enlighter;content:counter(enlighter,decimal) ".";text-align:right;padding-right:8px}.enlighter-overflow-scroll.enlighter-v-standard .enlighter{overflow-x:auto;word-wrap:normal!important}.enlighter-overflow-scroll.enlighter-v-codegroup .enlighter-codegroup-wrapper{overflow-x:auto;word-wrap:normal!important}.enlighter-overflow-scroll.enlighter-v-codegroup .enlighter>div>div,.enlighter-overflow-scroll.enlighter-v-standard .enlighter>div>div{white-space:pre!important}.enlighter-overflow-scroll.enlighter-v-codegroup .enlighter-raw,.enlighter-overflow-scroll.enlighter-v-standard .enlighter-raw{white-space:pre!important}.enlighter-show-rawcode .enlighter-raw{padding:12px 16px!important;display:block}.enlighter-show-rawcode .enlighter{display:none!important}.enlighter-t-enlighter{color:#555;background:#f8f9fa}.enlighter-t-enlighter.enlighter-hover div.enlighter>div:hover{color:#444;background-color:#fffcd3}.enlighter-t-enlighter div.enlighter>div{color:#aaa}.enlighter-t-enlighter div.enlighter>div.enlighter-special{background-color:#fdf5f0}.enlighter-t-enlighter.enlighter-linenumbers div.enlighter>div::before{border-right:solid 1px #e8e8e8}.enlighter-t-enlighter .enlighter-text{color:#555}.enlighter-t-enlighter .enlighter-c0{color:#99a}.enlighter-t-enlighter .enlighter-c1{color:#99a}.enlighter-t-enlighter .enlighter-c2{color:#99a}.enlighter-t-enlighter .enlighter-c9{color:#9baa8f}.enlighter-t-enlighter .enlighter-k0{color:#286491;font-weight:700}.enlighter-t-enlighter .enlighter-k1{color:#4573f7;font-weight:700}.enlighter-t-enlighter .enlighter-k2{color:#458;font-weight:700}.enlighter-t-enlighter .enlighter-k3{color:#4da0d2;background-color:#f0f0f0}.enlighter-t-enlighter .enlighter-k4{color:#4a9141;font-weight:700}.enlighter-t-enlighter .enlighter-k5{color:#286491;font-weight:700}.enlighter-t-enlighter .enlighter-k6{color:#286491;font-style:italic}.enlighter-t-enlighter .enlighter-k7{color:#286491;font-weight:700}.enlighter-t-enlighter .enlighter-k8{color:#4da0d2}.enlighter-t-enlighter .enlighter-k9{color:#990073;font-weight:700}.enlighter-t-enlighter .enlighter-k10{color:#4a9141;font-style:italic}.enlighter-t-enlighter .enlighter-e0{color:#34068a;font-weight:700}.enlighter-t-enlighter .enlighter-e1{color:#34068a;font-weight:700}.enlighter-t-enlighter .enlighter-e2{color:#009926}.enlighter-t-enlighter .enlighter-e3{color:#286491}.enlighter-t-enlighter .enlighter-e4{color:#ff8c00;font-style:italic}.enlighter-t-enlighter .enlighter-s0{colorLine truncated
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
(function($,window2,document2){"use strict";function closeNotyf($element){$element.addClass("notyn-out"),window2.setTimeout(function(){$element.remove()},1e3)}function notyf2(message,type,time,id){var $body=jQuery(document2.body);jQuery(".notyn").length||$body.append('<div class="notyn"></div>'),type=type||"success",type==="error"&&(type="danger"),time=time||5e3,time=time<100?time*1e3:time;var idAttribute=id?' id="'+id+'"':"",$notification=jQuery('<div class="noty1"'+idAttribute+'><div class="notyf '+type+'">'+message+"</div></div>"),shouldClose=!id;id&&jQuery("#"+id).length?(jQuery("#"+id).find(".notyf").removeClass().addClass("notyf "+type).html(message),$notification=jQuery("#"+id),shouldClose=!0):jQuery(".notyn").append($notification),shouldClose&&window2.setTimeout(function(){closeNotyf($notification)},time)}jQuery(document2.body).on("click",".noty1",function(){closeNotyf(jQuery(this))}),window2.notyf=notyf2})(jQuery,window,document),(function(window2){"use strict";var allowedKinds={identity:!0,badges:!0,orders:!0,vip:!0},allowedEvents={click:!0,shell:!0,"first-content":!0,ready:!0,"action-start":!0,"action-end":!0,unauthorized:!0,error:!0},sessions=Object.create(null),sequence=0,maxSessions=100;function normalize(value,fallback){var normalized=String(value||fallback||"").toLowerCase().replace(/[^a-z0-9-]/g,"");return normalized||fallback}function now(){return window2.performance&&typeof window2.performance.now=="function"?window2.performance.now():0}function markName(session,event){return"jio-modal-"+session.kind+"-"+session.id+"-"+event}function emit(session,event){if(!(!window2.performance||typeof window2.performance.mark!="function")){var name=markName(session,event);if(window2.performance.mark(name),session.marks[event]=name,typeof window2.performance.measure=="function"&&session.marks.click&&event!=="click")try{window2.performance.measure("jio-modal-"+session.kind+"-"+session.id+"-click-to-"+event,session.marks.click,name)}catch{}}}function start(kind){var safeKind=normalize(kind,"unknown");allowedKinds[safeKind]||(safeKind="unknown"),sequence+=1;var id=String(sequence),session={id,kind:safeKind,startedAt:now(),marks:Object.create(null)};sessions[id]=session,emit(session,"click");for(var ids=Object.keys(sessions);ids.length>maxSessions;)delete sessions[ids.shift()];return id}function mark(id,event){var session=sessions[String(id||"")],safeEvent=normalize(event,"error");!session||!allowedEvents[safeEvent]||emit(session,safeEvent)}function finish(id){mark(id,"ready")}function fail(id){mark(id,"error")}window2.JioModalTelemetry={start,mark,finish,error:fail}})(window),(function(window2){"use strict";function data(){return window2.jioData||window2.jio||{}}function createIdempotencyKey(){if(window2.crypto&&typeof window2.crypto.randomUUID=="function")return window2.crypto.randomUUID();if(!window2.crypto||typeof window2.crypto.getRandomValues!="function")throw new Error("当前浏览器无法生成安全的操作标识");var bytes=new Uint8Array(16);window2.crypto.getRandomValues(bytes),bytes[6]=bytes[6]&15|64,bytes[8]=bytes[8]&63|128;var hex=Array.prototype.map.call(bytes,function(value){return value.toString(16).padStart(2,"0")}).join("");return hex.slice(0,8)+"-"+hex.slice(8,12)+"-"+hex.slice(12,16)+"-"+hex.slice(16,20)+"-"+hex.slice(20)}function restBase(){var config=data(),raw=config.restUrl||config.apiUrl||config.rest_url||"",siteUrl=config.siteUrl||config.homeUrl||window2.location.origin+"/";return window2.location.protocol==="https:"&&siteUrl.substring(0,5)==="http:"&&(siteUrl="https:"+siteUrl.substring(5)),raw?String(raw).replace(/\/$/,""):String(siteUrl).replace(/\/$/,"")+"/index.php?rest_route=/jio/v1"}function appendQuery(url2,query){if(!query)return url2;var parts=[];return typeof query=="string"?parts=query.replace(/^\?/,"").split("&").filter(Boolean):typeof query=="object"&&Object.keys(query).forEach(function(key){query[key]===void 0||query[key]===null||parts.push(encodeURIComponent(key)+"="+encodeURIComponent(String(query[key])))}),parts.length?url2+(url2.indexOf("?")>=0?"&":"?")+parts.join("&"):url2}function url(path,query){path=String(path||"");var inlineQuery="",queryIndex=path.indexOf("?");if(queryIndex>=0&&(inlineQuery=path.slice(queryIndex+1),path=path.slice(0,queryIndex)),/^https?:\/\//i.test(path))return appendQuery(path,query||inlineQuery);path.charAt(0)!=="/"&&(path="/"+path);var base=restBase(),result=(base.indexOf("rest_route=")>=0,base+path);return appendQuery(result,query||inlineQuery)}function headers(options){var config=data(),source=options&&options.headers||{},result={},nonce=config.restNonce||config.nonce||"";return Object.keys(source).forEach(function(key){result[key]=source[key]}),result.Accept||(result.Accept="application/json, text/html;q=0.9, */*;q=0.8"),nonce&&!result["X-WP-Nonce"]&&(result["X-WP-Nonce"]=nonce),options&&options.body!==void 0&&options.body!==null&&!(window2.FormData&&options.body instanceof window2.FormData)&&!result["Content-Type"]&&(result["CoLine truncated
|
||||
(function($,window2,document2){"use strict";function closeNotyf($element){$element.addClass("notyn-out"),window2.setTimeout(function(){$element.remove()},1e3)}function notyf2(message,type,time,id){var $body=jQuery(document2.body);jQuery(".notyn").length||$body.append('<div class="notyn"></div>'),type=type||"success",type==="error"&&(type="danger"),time=time||5e3,time=time<100?time*1e3:time;var idAttribute=id?' id="'+id+'"':"",$notification=jQuery('<div class="noty1"'+idAttribute+'><div class="notyf '+type+'">'+message+"</div></div>"),shouldClose=!id;id&&jQuery("#"+id).length?(jQuery("#"+id).find(".notyf").removeClass().addClass("notyf "+type).html(message),$notification=jQuery("#"+id),shouldClose=!0):jQuery(".notyn").append($notification),shouldClose&&window2.setTimeout(function(){closeNotyf($notification)},time)}jQuery(document2.body).on("click",".noty1",function(){closeNotyf(jQuery(this))}),window2.notyf=notyf2})(jQuery,window,document),(function(window2){"use strict";var allowedKinds={identity:!0,badges:!0,orders:!0,vip:!0},allowedEvents={click:!0,shell:!0,"first-content":!0,ready:!0,"action-start":!0,"action-end":!0,unauthorized:!0,error:!0},sessions=Object.create(null),sequence=0,maxSessions=100;function normalize(value,fallback){var normalized=String(value||fallback||"").toLowerCase().replace(/[^a-z0-9-]/g,"");return normalized||fallback}function now(){return window2.performance&&typeof window2.performance.now=="function"?window2.performance.now():0}function markName(session,event){return"jio-modal-"+session.kind+"-"+session.id+"-"+event}function emit(session,event){if(!(!window2.performance||typeof window2.performance.mark!="function")){var name=markName(session,event);if(window2.performance.mark(name),session.marks[event]=name,typeof window2.performance.measure=="function"&&session.marks.click&&event!=="click")try{window2.performance.measure("jio-modal-"+session.kind+"-"+session.id+"-click-to-"+event,session.marks.click,name)}catch{}}}function start(kind){var safeKind=normalize(kind,"unknown");allowedKinds[safeKind]||(safeKind="unknown"),sequence+=1;var id=String(sequence),session={id,kind:safeKind,startedAt:now(),marks:Object.create(null)};sessions[id]=session,emit(session,"click");for(var ids=Object.keys(sessions);ids.length>maxSessions;)delete sessions[ids.shift()];return id}function mark(id,event){var session=sessions[String(id||"")],safeEvent=normalize(event,"error");!session||!allowedEvents[safeEvent]||emit(session,safeEvent)}function finish(id){mark(id,"ready")}function fail(id){mark(id,"error")}window2.JioModalTelemetry={start,mark,finish,error:fail}})(window),(function(window2){"use strict";function data(){return window2.jioData||window2.jio||{}}function createIdempotencyKey(){if(window2.crypto&&typeof window2.crypto.randomUUID=="function")return window2.crypto.randomUUID();if(!window2.crypto||typeof window2.crypto.getRandomValues!="function")throw new Error("当前浏览器无法生成安全的操作标识");var bytes=new Uint8Array(16);window2.crypto.getRandomValues(bytes),bytes[6]=bytes[6]&15|64,bytes[8]=bytes[8]&63|128;var hex=Array.prototype.map.call(bytes,function(value){return value.toString(16).padStart(2,"0")}).join("");return hex.slice(0,8)+"-"+hex.slice(8,12)+"-"+hex.slice(12,16)+"-"+hex.slice(16,20)+"-"+hex.slice(20)}function restBase(){var config=data(),raw=config.restUrl||config.apiUrl||config.rest_url||"",siteUrl=config.siteUrl||config.homeUrl||window2.location.origin+"/";return window2.location.protocol==="https:"&&siteUrl.substring(0,5)==="http:"&&(siteUrl="https:"+siteUrl.substring(5)),raw?String(raw).replace(/\/$/,""):String(siteUrl).replace(/\/$/,"")+"/index.php?rest_route=/jio/v1"}function appendQuery(url2,query){if(!query)return url2;var parts=[];return typeof query=="string"?parts=query.replace(/^\?/,"").split("&").filter(Boolean):typeof query=="object"&&Object.keys(query).forEach(function(key){query[key]===void 0||query[key]===null||parts.push(encodeURIComponent(key)+"="+encodeURIComponent(String(query[key])))}),parts.length?url2+(url2.indexOf("?")>=0?"&":"?")+parts.join("&"):url2}function url(path,query){path=String(path||"");var inlineQuery="",queryIndex=path.indexOf("?");if(queryIndex>=0&&(inlineQuery=path.slice(queryIndex+1),path=path.slice(0,queryIndex)),/^https?:\/\//i.test(path))return appendQuery(path,query||inlineQuery);path.charAt(0)!=="/"&&(path="/"+path);var base=restBase(),result=(base.indexOf("rest_route=")>=0,base+path);return appendQuery(result,query||inlineQuery)}function headers(options){var config=data(),source=options&&options.headers||{},result={},nonce=config.restNonce||config.nonce||"";return Object.keys(source).forEach(function(key){result[key]=source[key]}),result.Accept||(result.Accept="application/json, text/html;q=0.9, */*;q=0.8"),nonce&&!result["X-WP-Nonce"]&&(result["X-WP-Nonce"]=nonce),options&&options.body!==void 0&&options.body!==null&&!(window2.FormData&&options.body instanceof window2.FormData)&&!result["Content-Type"]&&(result["CoLine truncated
|
||||
@@ -49,8 +49,9 @@ trait ScriptsPart1b {
|
||||
wp_add_inline_style('jio-public', '.lazyloaded{--lazy-animation:lazy_scale!important;}');
|
||||
}
|
||||
|
||||
// 代码高亮的「最大高度」与「扩展按钮」由后台设置驱动。runtime 的
|
||||
// enlighter 路径(评论区 [code] 等)不走 precode.js,需要这两条规则兜底。
|
||||
// 代码高亮的「最大高度」与「扩展按钮」由后台设置驱动。
|
||||
// 高亮统一走 runtime 的 enlighter 路径,这两条规则对文章正文、
|
||||
// 评论区 [code] 与未高亮的裸 pre 一并生效。
|
||||
if (class_exists('\Jio\Settings\Settings')) {
|
||||
$code_highlight_css = \Jio\Settings\Settings::get_code_highlight_config();
|
||||
if (!empty($code_highlight_css['enabled'])) {
|
||||
@@ -239,7 +240,6 @@ trait ScriptsPart1b {
|
||||
);
|
||||
|
||||
$single_features = [
|
||||
'has_code' => 'single-post/code-blocks',
|
||||
'needs_navigation' => 'single-post/navigation',
|
||||
'needs_cover' => 'single-post/cover',
|
||||
'needs_related_toc' => 'single-post/related-toc',
|
||||
|
||||
@@ -24,7 +24,6 @@ trait ScriptsPart1c {
|
||||
private function resolve_singular_asset_requirements(bool $is_single_post, bool $is_single_resource, bool $is_paid_content_single): array {
|
||||
$requirements = [
|
||||
'is_article' => false,
|
||||
'has_code' => false,
|
||||
'has_toc' => false,
|
||||
'has_video' => false,
|
||||
'has_hidden_content' => false,
|
||||
@@ -61,14 +60,6 @@ trait ScriptsPart1c {
|
||||
? jio_resolve_single_post_display_settings($post_id)
|
||||
: [];
|
||||
$content = (string) $post->post_content;
|
||||
$display_content = $content
|
||||
. (string) ($settings['front_content'] ?? '')
|
||||
. (string) ($settings['after_content'] ?? '');
|
||||
|
||||
$has_code = (bool) preg_match(
|
||||
'/(?:<!--\s*wp:(?:code|preformatted|jio\/enlighter)\b|<pre\b|data-enlighter-language)/i',
|
||||
$display_content
|
||||
);
|
||||
$has_hidden_content = $is_paid_content_single || (bool) preg_match(
|
||||
'/(?:<!--\s*wp:jio\/paid-fragment\b|\[(?:jio_hide|hide|reply|vip|payshow|hidecontent|content)\b|jio-(?:hidden-content|paywall))/i',
|
||||
$content
|
||||
@@ -112,7 +103,6 @@ trait ScriptsPart1c {
|
||||
}
|
||||
|
||||
$requirements['is_article'] = $is_article;
|
||||
$requirements['has_code'] = $has_code;
|
||||
$requirements['has_toc'] = $is_article && $article_nav_enabled;
|
||||
$requirements['has_video'] = $has_video;
|
||||
$requirements['has_hidden_content'] = $has_hidden_content || $has_yiyan || $has_inserted_content;
|
||||
@@ -262,18 +252,6 @@ trait ScriptsPart1c {
|
||||
);
|
||||
}
|
||||
|
||||
// Code block enhancements (copy button + language label)
|
||||
$precode_js = get_template_directory() . '/assets/js/precode.js';
|
||||
if (!empty($singular_assets['has_code']) && file_exists($precode_js)) {
|
||||
wp_enqueue_script(
|
||||
'jio-precode',
|
||||
$base_uri . '/assets/js/precode.js',
|
||||
['loader_js'],
|
||||
(string) filemtime($precode_js),
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// Input field enhancements (auto-resize, counter, validation)
|
||||
$input_expand_js = get_template_directory() . '/assets/js/input-expand.js';
|
||||
$needs_input_enhancements = (bool) get_query_var('jio_sign')
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('node:assert/strict');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const test = require('node:test');
|
||||
|
||||
const root = path.resolve(__dirname, '..', '..');
|
||||
const read = (file) => fs.readFileSync(path.join(root, file), 'utf8');
|
||||
const exists = (file) => fs.existsSync(path.join(root, file));
|
||||
|
||||
// 代码块只有一条渲染链路:页面内所有 <pre><code> 都交给 runtime 的
|
||||
// EnlighterJS 初始化,容器版式由 bootstrap 的 pre + main.css 决定。
|
||||
// 这里锁住三件事:① 不再有并行的感叹号/复制按钮预处理脚本;
|
||||
// ② 参考主题的 pre 版式数值没有被二次皮肤覆盖;③ 工具栏字形按 FA5 码位映射。
|
||||
test('代码块只保留 runtime 一条高亮链路', () => {
|
||||
assert.ok(!exists('assets/js/precode.js'), '并行的 precode.js 预处理脚本应已删除');
|
||||
assert.ok(!exists('assets/css/frontend/single-post/code-blocks.css'), '自造的代码块皮肤应已删除');
|
||||
assert.ok(!exists('assets/js/enlighter'), '未使用的 enlighter 副本目录应已删除');
|
||||
|
||||
const runtime = read('src/Core/ScriptsPart1c.php');
|
||||
assert.doesNotMatch(runtime, /precode/i, 'PHP 不再入队 precode 脚本');
|
||||
assert.doesNotMatch(runtime, /has_code/, 'has_code 需求位随 precode 一并移除');
|
||||
|
||||
const enqueue = read('src/Core/ScriptsPart1b.php');
|
||||
assert.doesNotMatch(enqueue, /single-post\/code-blocks/, '不再按 has_code 入队自造皮肤');
|
||||
|
||||
// runtime 的初始化保持参考主题的选择器与选项。
|
||||
const main = read('assets/js/runtime/main.js');
|
||||
assert.match(main, /pre code:not\(\.enlighter-origin\)/);
|
||||
assert.match(main, /textOverflow: 'scroll'/);
|
||||
assert.match(main, /rawButton: !1/);
|
||||
});
|
||||
|
||||
test('正文 pre 版式沿用 bootstrap + legacy,不叠加二次容器', () => {
|
||||
const typography = read('assets/css/core/typography.css');
|
||||
|
||||
// 旧实现把整块 pre 重绘成深色卡片(#282c34 / 15px 内边距 / 14px),
|
||||
// 与参考主题的 muted 底色 + bootstrap 9.5px 内边距冲突。
|
||||
assert.doesNotMatch(typography, /#282c34/, '不得再把 pre 重绘成深色卡片');
|
||||
assert.doesNotMatch(
|
||||
typography,
|
||||
/\.wp-posts-content pre[\s\S]{0,200}?padding:\s*15px/,
|
||||
'不得覆盖 bootstrap 的 pre 内边距'
|
||||
);
|
||||
|
||||
const enqueue = read('src/Core/ScriptsPart1b.php');
|
||||
assert.match(enqueue, /max-height:' \. \$max_height_css \. 'px;overflow-y:auto !important;/);
|
||||
assert.match(enqueue, /\.enlighter-toolbar\{display:none !important;\}/);
|
||||
});
|
||||
|
||||
test('代码块工具栏字形按 FA5 码位映射', () => {
|
||||
const min = read('assets/js/runtime/enlighter/enlighterjs.min.css');
|
||||
|
||||
// \f0ea 在 FA4 是剪贴板,在 FA5 变成「粘贴」;剪贴板造型是 \f328。
|
||||
assert.match(min, /enlighter-btn-copy::after\{content:"\\f328"\}/);
|
||||
assert.doesNotMatch(min, /enlighter-btn-copy::after\{content:"\\f0ea"\}/);
|
||||
assert.match(min, /enlighter-btn-raw::after\{content:"\\f121"\}/);
|
||||
assert.match(min, /enlighter-btn-window::after\{content:"\\f1b2"\}/);
|
||||
});
|
||||
@@ -689,7 +689,6 @@ test('single articles enqueue only content and settings driven assets', () => {
|
||||
assert.doesNotMatch(singleBlock, /\$enqueue_module\('single-post'\)|\$enqueue_module\('comments'\)/);
|
||||
|
||||
for (const requirement of [
|
||||
'has_code',
|
||||
'needs_navigation',
|
||||
'needs_cover',
|
||||
'needs_related_toc',
|
||||
@@ -707,7 +706,6 @@ test('single articles enqueue only content and settings driven assets', () => {
|
||||
assert.match(singleBlock, new RegExp(`singular_assets\\['${requirement}'\\]`));
|
||||
}
|
||||
|
||||
assert.match(runtime, /wp:\(\?:code\|preformatted\|jio\\\/enlighter\)/);
|
||||
assert.match(runtime, /\$requirements\['has_toc'\] = \$is_article && \$article_nav_enabled/);
|
||||
assert.match(runtime, /data-jio-video/);
|
||||
assert.match(runtime, /post_password_required\(\$post_id\)/);
|
||||
@@ -718,7 +716,6 @@ test('single articles enqueue only content and settings driven assets', () => {
|
||||
assert.match(runtime, /needs_share'[\s\S]*?share_enabled/);
|
||||
|
||||
for (const requirement of [
|
||||
'has_code',
|
||||
'has_toc',
|
||||
'has_video',
|
||||
'needs_reward',
|
||||
|
||||
Reference in new issue
Block a user