Skip to content

Commit

Permalink
v2.3.2 修正blockquote显示问题
Browse files Browse the repository at this point in the history
  • Loading branch information
caol64 committed Dec 9, 2024
1 parent b9723f1 commit 9587db2
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 46 deletions.
8 changes: 4 additions & 4 deletions WenYan.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CODE_SIGN_ENTITLEMENTS = WenYan/WenYan.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 13;
CURRENT_PROJECT_VERSION = 14;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"WenYan/Preview Content\"";
DEVELOPMENT_TEAM = NNQB2TH9QC;
Expand All @@ -423,7 +423,7 @@
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 2.3.1;
MARKETING_VERSION = 2.3.2;
PRODUCT_BUNDLE_IDENTIFIER = com.yztech.WenYan;
PRODUCT_MODULE_NAME = WenYan;
PRODUCT_NAME = "文颜";
Expand All @@ -443,7 +443,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CODE_SIGN_ENTITLEMENTS = WenYan/WenYan.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 13;
CURRENT_PROJECT_VERSION = 14;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"WenYan/Preview Content\"";
DEVELOPMENT_TEAM = NNQB2TH9QC;
Expand All @@ -468,7 +468,7 @@
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 2.3.1;
MARKETING_VERSION = 2.3.2;
PRODUCT_BUNDLE_IDENTIFIER = com.yztech.WenYan;
PRODUCT_MODULE_NAME = WenYan;
PRODUCT_NAME = "文颜";
Expand Down
2 changes: 1 addition & 1 deletion WenYan/Resources.bundle/csstree/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ function parseCss(css, compatibilityMode) {
table-layout: fixed;
text-align: left;
overflow: auto;
display: inline-block;
display: table;
word-wrap: break-word;
word-break: break-all;
}`;
Expand Down
2 changes: 1 addition & 1 deletion WenYan/Resources.bundle/highlight/styles/github.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions WenYan/Resources.bundle/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,14 @@ function getContentForGzh() {
if (selector === "#wenyan") {
declarations.forEach((decl) => {
const value = csstree.generate(decl.value);
clonedWenyan.style[decl.property] = value
clonedWenyan.style[decl.property] = value;
});
} else {
const elements = clonedWenyan.querySelectorAll(selector);
elements.forEach((element) => {
declarations.forEach((decl) => {
const value = csstree.generate(decl.value);
element.style[decl.property] = value
element.style[decl.property] = value;
});
});
}
Expand Down Expand Up @@ -244,6 +244,17 @@ function getContentForGzh() {
element.insertBefore(buildPseudoSpan(beforeResults), element.firstChild);
}
});
// 不知是否是bug,公众号不再支持blockquote样式
elements = clonedWenyan.querySelectorAll('blockquote');
elements.forEach(element => {
const preElement = document.createElement('section');
preElement.style.cssText = element.style.cssText;
while (element.firstChild) {
preElement.appendChild(element.firstChild);
}
element.parentNode.replaceChild(preElement, element);
});
clonedWenyan.setAttribute("data-provider", "WenYan");
return `${clonedWenyan.outerHTML.replace(/class="mjx-solid"/g, 'fill="none" stroke-width="70"')}`;
}
function extractDeclarations(ruleNode, resultMap) {
Expand Down
7 changes: 3 additions & 4 deletions WenYan/Resources.bundle/themes/gzh_default.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
*/
/* 全局变量 */
:root {
--sans-serif-font: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
"Noto Color Emoji";
--monospace-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "liberation mono", "courier new", monospace;
--sans-serif-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
--monospace-font: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
/* 全局属性 */
#wenyan {
Expand Down Expand Up @@ -89,7 +88,7 @@
table-layout: fixed;
text-align: left;
overflow: auto;
display: inline-block;
display: table;
word-wrap: break-word;
word-break: break-all;
}
Expand Down
20 changes: 7 additions & 13 deletions WenYan/Resources.bundle/themes/lapis.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
--source-color: #a8a8a9;
--header-span-color: var(--primary-color);
--block-bg-color: #f6f8fa;
--sans-serif-font: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
"Noto Color Emoji";
--monospace-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "liberation mono", "courier new", monospace;
--sans-serif-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
--monospace-font: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
#wenyan {
color: var(--text-color);
Expand Down Expand Up @@ -129,22 +128,16 @@
text-align: justify;
overflow-x: auto;
border-collapse: collapse;
margin: 1.4em auto;
max-width: 100%;
table-layout: fixed;
text-align: left;
overflow: auto;
word-wrap: break-word;
word-break: break-all;
}
#wenyan tbody {
border: 0;
}
#wenyan table tr {
border: 0;
border-top: 1px solid #ccc;
}
#wenyan table tr th,
#wenyan table tr td {
#wenyan table th,
#wenyan table td {
border: 1px solid #d9dfe4;
height: 40px;
padding: 9px 12px;
Expand All @@ -153,10 +146,11 @@
min-width: 60px;
vertical-align: top;
}
#wenyan table tr th {
#wenyan table th {
text-align: center;
font-weight: bold;
color: var(--primary-color);
background: #f7f7f7;
}
#wenyan hr {
margin-top: 20px;
Expand Down
8 changes: 4 additions & 4 deletions WenYan/Resources.bundle/themes/maize.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
--bg-color: #fafafa;
--text-color: #333333;
--primary-color: #428bca;
--sans-serif-font: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
"Noto Color Emoji";
--monospace-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "liberation mono", "courier new", monospace;
--sans-serif-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
--monospace-font: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
#wenyan {
font-family: var(--sans-serif-font);
Expand Down Expand Up @@ -113,6 +112,7 @@
word-break: break-all;
color: rgb(235, 76, 55);
background-color: #f0f0f0;
font-size: .8em;
}
#wenyan img {
max-width: 100%;
Expand All @@ -130,7 +130,7 @@
table-layout: fixed;
text-align: left;
overflow: auto;
display: inline-block;
display: table;
word-wrap: break-word;
word-break: break-all;
}
Expand Down
7 changes: 3 additions & 4 deletions WenYan/Resources.bundle/themes/orangeheart.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
*/

:root {
--sans-serif-font: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
"Noto Color Emoji";
--monospace-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "liberation mono", "courier new", monospace;
--sans-serif-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
--monospace-font: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
#wenyan {
font-family: var(--sans-serif-font);
Expand Down Expand Up @@ -129,7 +128,7 @@
table-layout: fixed;
text-align: left;
overflow: auto;
display: inline-block;
display: table;
word-wrap: break-word;
word-break: break-all;
}
Expand Down
8 changes: 4 additions & 4 deletions WenYan/Resources.bundle/themes/pie.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
--main-4: #f27f79;
--main-5: #e6514e;
--main-6: #da282a;
--sans-serif-font: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
"Noto Color Emoji";
--monospace-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "liberation mono", "courier new", monospace;
--sans-serif-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
--monospace-font: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
#wenyan {
font-family: var(--sans-serif-font);
Expand Down Expand Up @@ -159,7 +158,7 @@
table-layout: fixed;
text-align: left;
overflow: auto;
display: inline-block;
display: table;
word-wrap: break-word;
word-break: break-all;
}
Expand All @@ -176,6 +175,7 @@
#wenyan table th {
font-weight: bold;
color: var(--main-6);
background-color: var(--main-1);
}
#wenyan strong {
padding: 0 1px;
Expand Down
9 changes: 4 additions & 5 deletions WenYan/Resources.bundle/themes/purple.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
--shadow: 3px 3px 10px var(--shadow-color);
--inline-code-bg: #f4f2f9;
--header-weight: normal;
--base-font: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
"Noto Color Emoji";
--base-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
--title-font: var(--base-font);
--monospace: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "liberation mono", "courier new", monospace;
--monospace-font: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
#wenyan {
font-family: var(--base-font);
Expand Down Expand Up @@ -102,7 +101,6 @@
margin: 0;
border-left: 0.3em solid var(--border-quote);
padding-left: 1em;
font-family: var(--base-font);
}
#wenyan table {
border-collapse: collapse;
Expand All @@ -111,7 +109,7 @@
table-layout: fixed;
text-align: left;
overflow: auto;
display: inline-block;
display: table;
word-wrap: break-word;
word-break: break-all;
}
Expand All @@ -129,6 +127,7 @@
#wenyan table th {
font-weight: bold;
color: var(--title-color);
background-color: var(--inline-code-bg);
}
#wenyan strong {
padding: 0 2px;
Expand Down
7 changes: 3 additions & 4 deletions WenYan/Resources.bundle/themes/rainbow.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
--tr-bg-color: rgb(255, 249, 242);
--code-bg-color: rgb(247, 247, 247);
--block-shadow: 0.15em 0.15em 0.5em rgb(150, 150, 150);
--sans-serif-font: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
"Noto Color Emoji";
--monospace-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "liberation mono", "courier new", monospace;
--sans-serif-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
--monospace-font: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
#wenyan {
font-family: var(--sans-serif-font);
Expand Down Expand Up @@ -67,7 +66,7 @@
table-layout: fixed;
text-align: left;
overflow: auto;
display: inline-block;
display: table;
word-wrap: break-word;
word-break: break-all;
}
Expand Down

0 comments on commit 9587db2

Please sign in to comment.