Skip to content
Open
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
5 changes: 1 addition & 4 deletions packages/markitdown/src/markitdown/converters/_exiftool.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import json
import locale
import subprocess
from typing import Any, BinaryIO, Union

Expand Down Expand Up @@ -45,8 +44,6 @@ def exiftool_metadata(
text=False,
).stdout

return json.loads(
output.decode(locale.getpreferredencoding(False)),
)[0]
return json.loads(output.decode("utf-8"))[0]
finally:
file_stream.seek(cur_pos)
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
# Try loading optional (but in this case, required) dependencies
# Save reporting of any exceptions for later
_dependency_exc_info = None
try:
import mammoth # noqa: F401
except ImportError:
# Preserve the error and stack trace for later
_dependency_exc_info = sys.exc_info()

ACCEPTED_MIME_TYPE_PREFIXES = [
"text/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def _parse_rss_type(self, doc: Document) -> DocumentConverterResult:
channel_title = self._get_data_by_tag_name(channel, "title")
channel_description = self._get_data_by_tag_name(channel, "description")
items = channel.getElementsByTagName("item")
md_text = ""
if channel_title:
md_text = f"# {channel_title}\n"
if channel_description:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ def convert(
main_title = title_elm.string

# Convert the page
webpage_text = f"# {main_title}\n\n" + _CustomMarkdownify(
title_prefix = f"# {main_title}\n\n" if main_title else ""
webpage_text = title_prefix + _CustomMarkdownify(
**kwargs
).convert_soup(body_elm)
else:
Expand Down