From 3257329617c92efb907752331a1c5a7243811e03 Mon Sep 17 00:00:00 2001 From: Ed Freyfogle Date: Mon, 30 Sep 2024 10:06:56 +0200 Subject: [PATCH] Solve issue #114 Trailing dash in Indian addresses without a postcode --- conf/countries/worldwide.yaml | 3 +++ testcases/countries/in.yaml | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/conf/countries/worldwide.yaml b/conf/countries/worldwide.yaml index 77d64bf..3fc3820 100644 --- a/conf/countries/worldwide.yaml +++ b/conf/countries/worldwide.yaml @@ -1077,6 +1077,9 @@ IM: # http://en.wikipedia.org/wiki/Address_%28geography%29#India IN: address_template: *generic12 + postformat_replace: + # deal with - but no postcode + - [" -\n","\n"] # British Indian Ocean Territory - same as UK IO: diff --git a/testcases/countries/in.yaml b/testcases/countries/in.yaml index 31d0703..1b6135e 100644 --- a/testcases/countries/in.yaml +++ b/testcases/countries/in.yaml @@ -18,7 +18,6 @@ expected: | Hyderabad - 500064 Telangana India - --- description: Indian postcode components: @@ -30,3 +29,17 @@ expected: | 400096 Mahārāshtra India +--- +description: without postcode +components: + city: Pune + country: India + country_code: in + road: Baner + state: Maharashtra +expected: | + Baner + Pune + Maharashtra + India +