X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/11da1ebe840102327816e08dd1de12fa8b75ca0f..d2a9ebf1eae1ee5fa8a09a7dfea76995274f7716:/src/catalogue/api/tojson.py diff --git a/src/catalogue/api/tojson.py b/src/catalogue/api/tojson.py index f28351f68..3d47cd995 100644 --- a/src/catalogue/api/tojson.py +++ b/src/catalogue/api/tojson.py @@ -82,7 +82,7 @@ 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), @@ -121,7 +121,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 @@ -146,6 +146,8 @@ def toj(elem, S): id_prefix = id_prefixes.get(elem.tag, 'i') S['id'][id_prefix] += 1 output['id'] = id_prefix + str(S['id'][id_prefix]) + if elem.attrib.get('id'): + output['id'] = 'wl-' + elem.attrib.get('id') if attrs: output['attr'] = attrs.copy() if attr_map: