Underline a link in a note message (if any). This assumes there is at most one link in the message.
(self, note: str)
| 834 | return out |
| 835 | |
| 836 | def underline_link(self, note: str) -> str: |
| 837 | """Underline a link in a note message (if any). |
| 838 | |
| 839 | This assumes there is at most one link in the message. |
| 840 | """ |
| 841 | match = re.search(r"https?://\S*", note) |
| 842 | if not match: |
| 843 | return note |
| 844 | start = match.start() |
| 845 | end = match.end() |
| 846 | return note[:start] + self.style(note[start:end], "none", underline=True) + note[end:] |
| 847 | |
| 848 | def format_success(self, n_sources: int, use_color: bool = True) -> str: |
| 849 | """Format short summary in case of success. |