Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions src/scribae/init_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ def _collect_project_config() -> ProjectConfig:
)

allowed_tags_raw = _prompt_text(
"Allowed HTML tags",
"Optional allowlist for HTML tags in generated content; leave blank for no restriction.",
"p, em, strong, a",
"Allowed metadata tags",
"Optional allowlist for metadata tags in generated content; leave blank for no restriction.",
"product-analytics, case-study, compliance",
default="",
show_default=False,
)
Expand Down
14 changes: 12 additions & 2 deletions tests/unit/init_cli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def _questionnaire_input() -> str:
"friendly and practical",
"seo, content strategy",
"en",
"p, em, a",
"product-analytics, case-study, compliance",
]
) + "\n"

Expand All @@ -37,7 +37,17 @@ def test_init_writes_config_in_current_dir() -> None:
assert payload["tone"] == "friendly and practical"
assert payload["keywords"] == ["seo", "content strategy"]
assert payload["language"] == "en"
assert payload["allowed_tags"] == ["p", "em", "a"]
assert payload["allowed_tags"] == ["product-analytics", "case-study", "compliance"]


def test_init_prompts_allowed_tag_example() -> None:
with runner.isolated_filesystem():
result = runner.invoke(app, ["init"], input=_questionnaire_input())

assert result.exit_code == 0
output = strip_ansi(result.output)
assert "Allowed metadata tags" in output
assert "Example: product-analytics, case-study, compliance" in output


def test_init_writes_config_in_project_dir() -> None:
Expand Down