Skip to content

Commit

Permalink
debug once again
Browse files Browse the repository at this point in the history
  • Loading branch information
shaedrich authored Jun 6, 2024
1 parent de5fc30 commit b1b788d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/superfences_ponylang/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def format(source, language, css_class, options, md, classes=None, id_value='',
if ':' in snippetPath:
snippetPath, lineNumbers = snippetPath.split(':', 2)
lines = []
_lines = {}
if ',' in lineNumbers:
lineNumbers = lineNumbers.split(',')
else:
Expand All @@ -34,9 +35,12 @@ def format(source, language, css_class, options, md, classes=None, id_value='',
start, end = lineNum.split('-')
if i >= int(start) and i <= int(end):
lines.append(line)
_lines[i] = (lineNumbers, line)
elif i == int(lineNum):
lines.append(line)
_lines[i] = (lineNumbers, line)
#source = str(lines)
source = str(_lines)

if 'dedent_subsections' in attrs and attrs.get('dedent_subsections'):
p = re.compile('^\s+')
Expand All @@ -52,7 +56,7 @@ def format(source, language, css_class, options, md, classes=None, id_value='',
for i, line in enumerate(lines):
lines[i] = line[indent:None]

source = '\n'.join(lines)
#source = '\n'.join(lines)
#source = str(base.Config.user_configs.__dict__) + str(TemplateContext) + str(c) + str(options) + str(attrs) + str(classes) + str(kwargs)
else:
with open(os.getcwd() + "/code-samples/" + snippetPath, 'r') as f:
Expand Down

0 comments on commit b1b788d

Please sign in to comment.