From 8caa32a558262efd52a75af087a0932dc5922f8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=8D=9A=E4=BB=81=20Buo-ren=20Lin?= Date: Tue, 24 Sep 2024 23:33:25 +0800 Subject: [PATCH] split: Fix incorrect example result of the split builtin filter (#83982) The following Python output proves that the second member of the resulting list should be " a", not "a": ```txt $ python3 Python 3.12.3 (main, Sep 11 2024, 14:17:37) [GCC 13.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> string = "jojo is, a" >>> string.split(',') ['jojo is', ' a'] ``` --- lib/ansible/plugins/filter/split.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/plugins/filter/split.yml b/lib/ansible/plugins/filter/split.yml index 0fc9c50b3cc..e954ef2b0d1 100644 --- a/lib/ansible/plugins/filter/split.yml +++ b/lib/ansible/plugins/filter/split.yml @@ -22,7 +22,7 @@ EXAMPLES: | # listjojo => [ "jojo", "is", "a" ] listjojo: "{{ 'jojo is a' | split }}" - # listjojocomma => [ "jojo is", "a" ] + # listjojocomma => [ "jojo is", " a" ] listjojocomma: "{{ 'jojo is, a' | split(',') }}" RETURN: