Skip to content

Commit

Permalink
feat: #954 优化字号匹配逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsonliu committed Oct 29, 2024
1 parent 2e30a1f commit daf4f68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/hooks/FrontMatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class FrontMatter extends ParagraphBase {
return str.replace(this.RULE.reg, (match, content) => {
const lineCount = match.match(/\n/g)?.length ?? 0;
const sign = `fontMatter${lineCount}`;
content.replace(/\n\s*(font-size|fontSize): ([0-9a-zA-Z]+)(\n|$)/, (match, m1, m2) => {
content.replace(/(?:^|\n)\s*(font-size|fontSize): ([0-9a-zA-Z]+)(\n|$)/, (match, m1, m2) => {
this.$engine.$cherry.previewer.getDom().style.fontSize = m2;
return match;
});
Expand Down

0 comments on commit daf4f68

Please sign in to comment.