X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/26c7583feeb39ba52f0beac19221777844ad1487..f62cf7aef22c2c6797f5069d8d436a02977d89e9:/src/catalogue/api/tojson.py diff --git a/src/catalogue/api/tojson.py b/src/catalogue/api/tojson.py index fa6bafdd1..3ff257a60 100644 --- a/src/catalogue/api/tojson.py +++ b/src/catalogue/api/tojson.py @@ -82,13 +82,18 @@ tags = { 'begin': ('_ignore', True, {'class': 'reference'}, {'data-uri': 'href'}, False), 'end': ('_ignore', True, {'class': 'reference'}, {'data-uri': 'href'}, False), - 'motyw': ('a', True, {'class': 'theme'}, None, False), + 'motyw': ('_ignore', True, {'class': 'theme'}, None, False), 'pa': ('a', True, {'class': 'footnote footnote-pa'}, None, False), 'pe': ('a', True, {'class': 'footnote footnote-pe'}, None, False), 'pr': ('a', True, {'class': 'footnote footnote-pr'}, None, False), 'pt': ('a', True, {'class': 'footnote footnote-pt'}, None, False), 'ptrad': ('a', True, {'class': 'footnote footnote-ptrad'}, None, False), + + 'werset': ('p', True, {'class': 'werset'}, None, True), + 'br': ('br', False, None, None, None), + 'indeks_dolny': ('em', True, {'class': 'indeks_dolny'}, None, False), + 'mat': ('span', True, {'class': 'mat'}, None, False), } id_prefixes = { @@ -121,7 +126,7 @@ front2 = set(['autor_utworu']) def norm(text): - text = text.replace('---', '—').replace('--', '–').replace('...', '…').replace(',,', '„').replace('"', '”') + text = text.replace('---', '—').replace('--', '–').replace('...', '…').replace(',,', '„').replace('"', '”').replace('\n', ' ') return text