Skip to content

Commit

Permalink
Outdent code
Browse files Browse the repository at this point in the history
  • Loading branch information
rnorth committed Oct 6, 2018
1 parent fb39213 commit c19f133
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion codeinclude/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import re
import os
import shlex
import textwrap

from codeinclude.resolver import select

Expand Down Expand Up @@ -37,7 +38,9 @@ def get_substitute(page, title, filename, lines, block, inside_block):

selected_content = select(content, lines=lines, block=block, inside_block=inside_block)

return "\n```java tab=\"" + title + "\"\n" + selected_content + "\n```\n\n"
dedented = textwrap.dedent(selected_content)

return "\n```java tab=\"" + title + "\"\n" + dedented + "\n```\n\n"

class CodeIncludePlugin(BasePlugin):
def on_page_markdown(self, markdown, page, config,
Expand Down

0 comments on commit c19f133

Please sign in to comment.