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

MNT: Change placeholder character to control character #258

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions skops/card/_model_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _clean_table(table: str) -> str:
# replace line breaks "\n" with html tag <br />, however, leave end-of-line
# line breaks (eol_lb) intact
eol_lb = "|\n"
placeholder = "$%!?" # arbitrary string that never appears naturally
placeholder = "\x1f" # unit separator control character
E-Aho marked this conversation as resolved.
Show resolved Hide resolved
table = (
table.replace(eol_lb, placeholder)
.replace("\n", "<br />")
Expand Down Expand Up @@ -195,7 +195,7 @@ def split_subsection_names(key: str) -> list[str]:
The individual (sub)sections.

"""
placeholder = "$%!?" # arbitrary sting that never appears naturally
placeholder = "\x1f" # unit separator control character
key = key.replace("\\/", placeholder)
parts = (part.strip() for part in key.split("/"))
return [part.replace(placeholder, "/") for part in parts]
Expand Down