mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-11-17 04:11:35 +00:00
Follow-up on the two salvaged commits: - One _sidecar_payload_text() helper decides the /send text for both the adapter path and _standalone_send (cron / send_message), which had the same raw-markdown leak on URL-bearing messages and never stripped with PHOTON_MARKDOWN=false. - BlueBubbles (same iMessage surface) keeps [label](url) targets as bare URLs. - Tests trimmed to two invariants.
9 lines
573 B
Python
9 lines
573 B
Python
"""``strip_markdown`` link handling: the default drops a link target (SMS, IRC, Feishu, QQ rely on it);
|
|
``keep_link_targets=True`` leaves a bare http(s) URL for platforms whose data detection re-links it."""
|
|
from gateway.platforms.helpers import strip_markdown
|
|
|
|
|
|
def test_keep_link_targets_keeps_http_urls_only() -> None:
|
|
text = "see [Open it](https://example.com/i?x=1) or [mail](mailto:[email protected])"
|
|
assert strip_markdown(text) == "see Open it or mail"
|
|
assert strip_markdown(text, keep_link_targets=True) == "see Open it\nhttps://example.com/i?x=1 or mail"
|