Skip to content

Commit

Permalink
Ensure file BEGINS with mark headers
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarraff committed Jan 31, 2024
1 parent 9733473 commit a6737e4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mark2confluence/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ def begins_with_mark_headers(path: str, headers: List[str] = ["Space", "Parent",
return True
return False

def has_mark_space_header(path: str):
return has_mark_headers(path, r"<!--.?(space):.*-->")
def begins_with_mark_space_header(path: str):
return begins_with_mark_headers(path, ["Space"])

class MultilineCommentIsOpenException(Exception):
pass
Expand Down Expand Up @@ -243,7 +243,7 @@ def get_default_parents(parents_string: str) -> List[ParentCfg]:
def inject_default_parents(path: str, default_parents_cfg: List[ParentCfg]):
file_dir = f"{os.path.dirname(os.path.abspath(path))}"
for parent_cfg in default_parents_cfg:
if parent_cfg.is_directory_included(file_dir) and not has_mark_space_header(path):
if parent_cfg.is_directory_included(file_dir) and not begins_with_mark_space_header(path):
header = parent_cfg.get_header()
with open(path, 'r') as f:
file_content = f.read()
Expand Down

0 comments on commit a6737e4

Please sign in to comment.