Skip to content

Commit da4fd62

Browse files
committed
Some str/bytes fixes
1 parent fb1fc74 commit da4fd62

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Unreleased Changes
88
------------------
99

1010
<!-- insertion marker -->
11+
- Some str/bytes fixes
12+
1113
[0.3.0] - 2021-01-11
1214
--------------------
1315
- Swap out `sh` for `subprocess` module for running pandoc

moin2gitwiki/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def translate_page(ctx, cache_directory, url_prefix, page, version):
230230
231231
The first argument is a page name, the second an integer revision.
232232
233-
The translation process is as described for the `fast-expor`a command.
233+
The translation process is as described for the `fast-export` command.
234234
"""
235235
#
236236
# build your initial revision set from the wiki data

moin2gitwiki/moin2markdown.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def create_translator(
104104
ctx=ctx,
105105
)
106106

107-
def retrieve_and_translate(self, revision: MoinEditEntry) -> Optional[str]:
107+
def retrieve_and_translate(self, revision: MoinEditEntry) -> Optional[bytes]:
108108
"""
109109
Retrieve a wiki revision, and translate it to markdown
110110
@@ -186,15 +186,15 @@ def extract_content_section(self, html: str) -> str:
186186

187187
return "".join([str(x) for x in content.contents])
188188

189-
def translate(self, input: str) -> str:
189+
def translate(self, input: str) -> bytes:
190190
"""Translate HTML to Github Flavoured Markdown using pandoc"""
191191
process = subprocess.Popen(
192192
["pandoc", "-f", "html", "-t", "gfm"],
193193
stdin=subprocess.PIPE,
194194
stdout=subprocess.PIPE,
195195
)
196196
(output, _) = process.communicate(input.encode("utf-8"))
197-
return output.decode("utf-8")
197+
return output
198198

199199

200200
# end

0 commit comments

Comments
 (0)