forked from jzillmann/pdf-to-markdown
-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Description
I'm trying to convert some files that contain python code but the tool doesn't respect the original formatting and prints the files without any spacing. For example, a pdf containing the following text:
# Time: O(n)
# Space: O(n)
# freq table
Next there is the solution to the proposed problem using Python2:
class Solution(object):
def isGood(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
cnt = [0]*len(nums)
for x in nums:
if x < len(cnt):
cnt[x] += 1
else:
return False
return all(cnt[x] == 1 for x in xrange(1, len(nums)-1))
Is translated into:
# Time: O(n) # Space: O(n)
# freq table
Next there is the solution to the proposed problem using Python2:
class Solution(object): def isGood(self, nums): """ :type nums: List[int] :rtype: bool """ cnt = [0]*len(nums) for x in nums: if x < len(cnt): cnt[x] += 1 else: return False return all(cnt[x] == 1 for x in xrange(1, len(nums)-1))
In this case, it doesn't detect it as a code block, in some other examples, the tool detects the code blocks correctly but still removes the initial spacing. One such example is this book
Is there a way to force the tool to respect the original formatting?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels