Skip to content

Commit 8ffc054

Browse files
HouLiXieBuRouSkyBird233
authored andcommitted
fix: 修复新闻页面里 h2 h3 标签被错误的识别为链接
1 parent 2fa9def commit 8ffc054

File tree

3 files changed

+140
-118
lines changed

3 files changed

+140
-118
lines changed

assets/index.scss

Lines changed: 122 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,19 @@ $bg-secondary: #3f6075;
1010
$common-margin: 24px;
1111

1212
@use 'heti'
13-
with(
14-
$line-length: none,
15-
$darkmode: 'manual',
16-
$manualmode-dark-selector: 'body.dark &',
17-
$font-size-h2: normal,
18-
$line-height-size-h2: normal,
19-
$std-block-unit: 16px,
20-
21-
// TODO: discussion on website font config
22-
// Heti's default font family displays Chinese quotes half-width
23-
// so they have been removed for backward compatibility.
24-
$_font-stack-sans: '',
25-
$_font-stack-serif: ''
26-
);
13+
with ($line-length: none,
14+
$darkmode: 'manual',
15+
$manualmode-dark-selector: 'body.dark &',
16+
$font-size-h2: normal,
17+
$line-height-size-h2: normal,
18+
$std-block-unit: 16px,
19+
20+
// TODO: discussion on website font config
21+
// Heti's default font family displays Chinese quotes half-width
22+
// so they have been removed for backward compatibility.
23+
$_font-stack-sans: '',
24+
$_font-stack-serif: ''
25+
);
2726

2827
.heti {
2928
> :not(h2) {
@@ -49,141 +48,146 @@ $common-margin: 24px;
4948
> :first-child {
5049
margin-top: 0;
5150
}
51+
5252
> :last-child {
5353
margin-bottom: 0;
5454
}
5555
}
56-
56+
5757
table {
5858
max-width: calc(100% - 2*$common-margin);
5959
}
6060
}
6161

62-
.category-second,
63-
.heti h2 {
64-
font-weight: normal;
65-
background-color: var(--secondary);
66-
display: flex;
67-
height: 2rem;
68-
align-items: center;
69-
justify-content: space-between;
70-
padding: 5px 10px;
71-
color: white;
72-
user-select: none;
73-
}
62+
@layer utilities {
63+
:root {
64+
--font-family-monospace:
65+
'Source Code Pro', 'Menlo', 'Consolas', 'DejaVu Sans Mono', -apple-system,
66+
monospace;
67+
}
7468

75-
:root {
76-
--font-family-monospace:
77-
'Source Code Pro', 'Menlo', 'Consolas', 'DejaVu Sans Mono', -apple-system,
78-
monospace;
79-
}
69+
.container-p p:not(:last-of-type) {
70+
margin-bottom: 1.5rem;
71+
}
8072

81-
.theme-bg-color-secondary-static {
82-
background-color: var(--secondary);
83-
}
73+
.category-second {
74+
justify-content: space-between;
75+
}
8476

85-
.theme-bg-color-primary-static {
86-
background-color: var(--primary);
87-
}
77+
.category-second,
78+
.heti h2 {
79+
font-weight: normal;
80+
background-color: var(--secondary);
81+
display: flex;
82+
height: 2rem;
83+
align-items: center;
84+
padding: 5px 10px;
85+
color: white;
86+
user-select: none;
87+
}
8888

89-
.theme-bg-color-primary-secondary {
90-
background-color: var(--primary);
91-
}
89+
.theme-bg-color-secondary-static {
90+
background-color: var(--secondary);
91+
}
9292

93-
.theme-bg-color-primary-secondary:hover {
94-
background-color: var(--secondary);
95-
}
93+
.theme-bg-color-primary-static {
94+
background-color: var(--primary);
95+
}
9696

97-
.theme-bg-color-secondary-primary {
98-
background-color: var(--secondary);
99-
}
97+
.theme-bg-color-primary-secondary {
98+
background-color: var(--primary);
99+
}
100100

101-
.theme-bg-color-secondary-primary:hover {
102-
background-color: var(--primary);
103-
}
101+
.theme-bg-color-primary-secondary:hover {
102+
background-color: var(--secondary);
103+
}
104104

105-
.theme-border-primary {
106-
border-color: var(--primary);
107-
}
105+
.theme-bg-color-secondary-primary {
106+
background-color: var(--secondary);
107+
}
108108

109-
.theme-border-secondary {
110-
border-color: var(--secondary);
111-
}
109+
.theme-bg-color-secondary-primary:hover {
110+
background-color: var(--primary);
111+
}
112112

113-
@layer utilities {
114-
.container-p p:not(:last-of-type) {
115-
margin-bottom: 1.5rem;
113+
.theme-border-primary {
114+
border-color: var(--primary);
116115
}
117-
}
118116

119-
.theme-text-primary {
120-
color: var(--primary);
121-
}
117+
.theme-border-secondary {
118+
border-color: var(--secondary);
119+
}
122120

123-
table {
124-
width: 100%;
125-
max-width: 100%;
126-
font-size: 12pt;
127-
background-color: #fff;
128-
overflow: auto;
129-
border-collapse: collapse;
130-
131-
tr {
132-
th,
133-
td {
134-
border: 1px solid $bg-secondary;
121+
.theme-text-primary {
122+
color: var(--primary);
123+
}
124+
125+
table {
126+
width: 100%;
127+
max-width: 100%;
128+
font-size: 12pt;
129+
background-color: #fff;
130+
overflow: auto;
131+
border-collapse: collapse;
132+
133+
tr {
134+
135+
th,
136+
td {
137+
border: 1px solid $bg-secondary;
138+
}
135139
}
136140
}
137-
}
138141

139-
thead {
140-
text-align: left;
141-
}
142+
thead {
143+
text-align: left;
144+
}
142145

143-
th {
144-
font-weight: bold;
145-
background-color: $th-bg-color;
146-
border-bottom: 1px dashed #eee;
147-
}
146+
th {
147+
font-weight: bold;
148+
background-color: $th-bg-color;
149+
border-bottom: 1px dashed #eee;
150+
}
148151

149-
tr:nth-child(2n + 1) {
150-
background-color: $bg-color;
151-
border-bottom: 1px solid #fff;
152-
}
152+
tr:nth-child(2n + 1) {
153+
background-color: $bg-color;
154+
border-bottom: 1px solid #fff;
155+
}
153156

154-
th,
155-
td {
156-
padding: 6px 7px;
157-
line-height: 24px;
158-
}
157+
th,
158+
td {
159+
padding: 6px 7px;
160+
line-height: 24px;
161+
}
159162

160-
td {
161-
min-width: 120px;
162-
border: 1px dashed #fff;
163-
}
163+
td {
164+
min-width: 120px;
165+
border: 1px dashed #fff;
166+
}
164167

165-
/* HTML: <div class="loader"></div> */
166-
.loader {
167-
width: fit-content;
168-
font-weight: bold;
169-
font-family: sans-serif;
170-
font-size: 30px;
171-
padding-bottom: 8px;
172-
background: linear-gradient(currentColor 0 0) 0 100%/0% 3px no-repeat;
173-
animation: l2 2s linear infinite;
174-
background-color: rgba(122, 122, 122, 0);
175-
}
168+
/* HTML: <div class="loader"></div> */
169+
.loader {
170+
width: fit-content;
171+
font-weight: bold;
172+
font-family: sans-serif;
173+
font-size: 30px;
174+
padding-bottom: 8px;
175+
background: linear-gradient(currentColor 0 0) 0 100%/0% 3px no-repeat;
176+
animation: l2 2s linear infinite;
177+
background-color: rgba(122, 122, 122, 0);
178+
}
176179

177-
.loader:before {
178-
content: 'Loading...';
179-
}
180+
.loader:before {
181+
content: 'Loading...';
182+
}
180183

181-
@keyframes l2 {
182-
to {
183-
background-size: 100% 3px;
184+
@keyframes l2 {
185+
to {
186+
background-size: 100% 3px;
187+
}
184188
}
185-
}
186189

187-
.language-menu {
188-
margin-top: -7px;
189-
}
190+
.language-menu {
191+
margin-top: -7px;
192+
}
193+
}

components/content/ProseH2.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<script setup></script>
2+
3+
<template>
4+
<h2 class="heti">
5+
<slot />
6+
</h2>
7+
</template>
8+
9+
<style scoped></style>

components/content/ProseH3.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<script setup></script>
2+
3+
<template>
4+
<h3 class="heti">
5+
<slot />
6+
</h3>
7+
</template>
8+
9+
<style scoped></style>

0 commit comments

Comments
 (0)