Skip to content

Commit

Permalink
Merge pull request #11601 from allenve/merge-feat-md-1
Browse files Browse the repository at this point in the history
Merge feat md 1
  • Loading branch information
allenve authored Feb 14, 2025
2 parents 9aa8e13 + dfd1483 commit 8556ed8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/amis-core/src/locale.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ const fns: {
} = {};

export function format(str: string, data?: object) {
return str.replace(/(\\)?\{\{([\s\S]+?)\}\}/g, (_, escape, key) => {
if (!str.includes('{{')) return str; // 先快速检查,避免无谓的正则执行

return str.replace(/(\\)?\{\{([^{}]+?)\}\}/g, (_, escape, key) => {
if (escape) {
return _.substring(1);
}
Expand Down

0 comments on commit 8556ed8

Please sign in to comment.