Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/Coding/Wiki.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -39,6 +39,10 @@ public function createMarkdownZip($markdown, $path, $markdownFilename): bool|str
// markdown image title: ![](images/default.svg "admin")
$tmp = explode(' ', $attachment);
$filename = $tmp[0];
if (!file_exists($path . $filename)){
error_log("文件不存在:$filename");
continue;
}
$this->zipArchive->addFile($path . $filename, $filename);
}
}
Expand Down
1 change: 1 addition & 0 deletions app/Confluence.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -40,6 +40,7 @@ public function htmlFile2Markdown(string $filename): string
'|<span class="confluence-embedded-file-wrapper">.*</span>|',
'|<div class="drop-zone-empty-text">.*</div>|s',
'|<li class="drop-zone-text hidden">.*</li>|s',
'|<img .* src="data:.*/>|',
],
'',
file_get_contents($filename)
Expand Down
1 change: 1 addition & 0 deletions tests/data/confluence/space1/image-demo_65619.html
Original file line numberDiff line numberDiff line change
Expand Up@@ -74,6 +74,7 @@ <h2 id="helloworld-第二章">第二章</h2>
data-base-url="http://9.134.190.26:8090" data-linked-resource-content-type="image/png"
data-linked-resource-container-id="65619" data-linked-resource-container-version="4"></span></p>
<p>
<p><img class="drawio-diagram-image" width="821" style="width:821px;" src="data:image/png;base64,iVBORw" /></p>
</div>

<div class="pageSection group">
Expand Down