You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
Sure!
I just have tried with version 0.1.25 and the output is exactly the same in regards with the python formatting issue.
The same behavior of ignoring the initial spacing also happens with pdf-to-markdown
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:
Is translated into:
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?
The text was updated successfully, but these errors were encountered: