mirror of https://github.com/zulip/zulip.git
todo: Require space after colon to separate task title from description.
This fixes the annoying behaviour where a task title with a url in it, for example, "Fix issue https://github/com/zulip/zulip/issues/1234" would be wrongly split into a description at the `:` in the url.
This commit is contained in:
parent
2457a8b655
commit
d64d535c2d
|
@ -12,7 +12,7 @@
|
|||
|
||||
2. Type `/todo` followed by a space, and the title of the to-do list.
|
||||
|
||||
3. _(optional)_ Type each task on a new line, with its description, if any, after a <kbd>:</kbd>.
|
||||
3. _(optional)_ Type each task on a new line, with its description, if any, after a <kbd>:</kbd> and blank space.
|
||||
|
||||
4. Click the **Send** (<i class="zulip-icon zulip-icon-send"></i>) button, or
|
||||
use a [keyboard shortcut](/help/mastering-the-compose-box#toggle-between-ctrl-enter-and-enter-to-send-a-message)
|
||||
|
|
|
@ -56,8 +56,8 @@ def parse_todo_extra_data(content: str) -> Any:
|
|||
task_data = re.sub(r"(\s*[-*]?\s*)", "", line.strip(), count=1)
|
||||
if len(task_data) > 0:
|
||||
# a task and its description (optional) are separated
|
||||
# by the (first) `:` character
|
||||
task_data_array = task_data.split(":", 1)
|
||||
# by the (first) `: ` substring
|
||||
task_data_array = task_data.split(": ", 1)
|
||||
tasks.append(
|
||||
{
|
||||
"task": task_data_array[0].strip(),
|
||||
|
|
Loading…
Reference in New Issue