Skip to content

Commit

Permalink
fix: #657 closed 修复复制按钮点击报错问题
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsonliu committed Dec 26, 2023
1 parent 49e4907 commit de3f368
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/toolbars/hooks/Copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import juice from 'juice';
// import juice from 'juice';
import MenuBase from '@/toolbars/MenuBase';
import { copyToClip } from '@/utils/copy';
/**
Expand Down Expand Up @@ -104,11 +104,10 @@ export default class Copy extends MenuBase {
// 将css样式以行内样式的形式插入到html内容里
this.adaptWechat(html).then((html) => {
copyToClip(
juice(
`<div data-inline-code-theme="${inlineCodeTheme}" data-code-block-theme="${codeBlockTheme}">
<div class="cherry-markdown">${html}</div>
</div>${mathStyle + echartStyle + cherryStyle}`,
),
`${mathStyle + echartStyle + cherryStyle}
<div data-inline-code-theme="${inlineCodeTheme}" data-code-block-theme="${codeBlockTheme}">
<div class="cherry-markdown">${html}</div>
</div>`,
);
this.toggleLoading();
});
Expand Down

0 comments on commit de3f368

Please sign in to comment.