Skip to content

Commit

Permalink
fix: #1001 导出长图时展开所有代码块
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsonliu committed Dec 17, 2024
1 parent 8c67a2b commit fdedb93
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/utils/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ export function exportScreenShot(previewDom, fileName) {
// 去掉audio和video标签
cherryPreviewer.innerHTML = cherryPreviewer.innerHTML.replace(/<audio [^>]+?>([^\n]*?)<\/audio>/g, '$1');
cherryPreviewer.innerHTML = cherryPreviewer.innerHTML.replace(/<video [^>]+?>([^\n]*?)<\/video>/g, '$1');
// 强制展开所有代码块
cherryPreviewer.innerHTML = cherryPreviewer.innerHTML.replace(
/class="cherry-code-unExpand("| )/g,
'class="cherry-code-expand$1',
);
html2canvas(cherryPreviewer, {
allowTaint: true,
height: cherryPreviewer.clientHeight,
Expand Down

0 comments on commit fdedb93

Please sign in to comment.