Skip to content

Commit

Permalink
Add doctype header to forum threads
Browse files Browse the repository at this point in the history
This should fix mimetype detection on most systems and is more relevant
now that the report is clickable
  • Loading branch information
I-Al-Istannen committed Nov 5, 2024
1 parent 596b6a7 commit 6dda4c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ ambiguous situations.
- Crawling of nested courses
- Downloading of links with no target URL
- Handle row flex on description pages
- Add `<!DOCTYPE html>` heading to forum threads to fix mime type detection

## 3.6.0 - 2024-10-23

Expand Down
3 changes: 2 additions & 1 deletion PFERD/crawl/ilias/ilias_web_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,8 @@ async def _download_forum_thread(
return

async with maybe_dl as (bar, sink):
content = element.title_tag.prettify()
content = "<!DOCTYPE html>\n"
content += element.title_tag.prettify()
content += element.content_tag.prettify()
sink.file.write(content.encode("utf-8"))
sink.done()
Expand Down

0 comments on commit 6dda4c5

Please sign in to comment.