indigo icon indicating copy to clipboard operation
indigo copied to clipboard

Citator doesn't handle newlines well

Open longhotsummer opened this issue 9 months ago • 0 comments

It looks like it breaks provision matching, at least:

>>> m.call_citator({"frbr_uri": doc.expression_uri().expression_uri(), "format": "text", "body":
  "for purposes of section 47(1)(e)\nof the Constitution and is", "citations": []})

{'citations': [{'href': '/akn/za/act/1996/constitution', 'text': 'the Constitution', 'target_id': 0, 'start': 36, 'end': 52, 'prefix': 'rposes of section 47(1)(e)\nof ', 'suffix': ' and is'}]}

>>> m.call_citator({"frbr_uri": doc.expression_uri().expression_uri(), "format": "text", "body":
  "for purposes of section 47(1)(e) of the Constitution and is", "citations": []})

{'citations': [{'href': '/akn/za/act/1996/constitution', 'text': 'the Constitution', 'target_id': 0, 'start': 36, 'end': 52, 'prefix': 'rposes of section 47(1)(e) of ', 'suffix': ' and is'}, {'href': '/akn/za/act/1996/constitution/~chp_4__subpart_nn_1__sec_47__subsec_1__para_e', 'text': '47(1)(e)', 'target_id': 0, 'start': 24, 'end': 32, 'prefix': 'for purposes of section ', 'suffix': ' of the Constitution and is'}]}

longhotsummer avatar May 21 '24 12:05 longhotsummer