Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting of HTML files seems to be wrong #105

Open
sripirakas opened this issue Nov 9, 2018 · 1 comment
Open

Formatting of HTML files seems to be wrong #105

sripirakas opened this issue Nov 9, 2018 · 1 comment

Comments

@sripirakas
Copy link

Hi,

I have noticed some formatting issues with pycco and then used the file at https://github.com/pycco-docs/pycco/blob/master/pycco/main.py to reproduce the output rendering as at https://pycco-docs.github.io/pycco/ (Please see the screenshot below). As you can see the comments within """ and """ are not properly formatted.

image

@fitzroy-2011-02
Copy link

fitzroy-2011-02 commented Apr 1, 2020

Hello, I'm obsering the same behavior.

I run pycco against it's own source file and it does not look like the way it should. It looks like the way in the picture above.

I guess I'm doing something fundamentaly wrong.
Anyone else has this issue?
Sorry for bothering.

Best regards, Alex


Okay this is my first debugging attempt ever, so please bear with me.
Removing the leading spaces (indents) seemed to be erroneous.

I changed

line: 164
from:
indent_level = re.match(r"\s*", line).group(0)
to:
indent_level = len(re.match(r"\s*", line).group(0)) - 1

line: 173-174
from:

if re.match(r' {{{:d}}}'.format(len(indent_level)), line):
    docs_text += line[len(indent_level):] + '\n'

to:

if re.match(r' {{{:d}}}'.format(indent_level), line):
    docs_text += line[indent_level:] + '\n'

I hope this does not break anything else.

Best, Alex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants