protect spaces

This commit is contained in:
Edward Betts 2017-02-22 21:51:33 +00:00
parent a49f8fc766
commit 7026a360db

View file

@ -2,6 +2,7 @@ from .url import get_url, get_text
from .parse import get_span, parse_span, parse_link, parse_sourcedoc_facet, xanadoc_span_html, span_html, get_urls from .parse import get_span, parse_span, parse_link, parse_sourcedoc_facet, xanadoc_span_html, span_html, get_urls
from collections import defaultdict from collections import defaultdict
from html import escape from html import escape
from .utils import protect_start_spaces
import re import re
@ -105,7 +106,7 @@ def fulfil_edl_with_sources(edl_text):
doc = ''.join(doc_spans) doc = ''.join(doc_spans)
for s in source: for s in source:
text = s.pop('text') text = protect_start_spaces(s.pop('text'))
if s['length'] > max_sourcedoc_size: if s['length'] > max_sourcedoc_size:
# print('{} > {}'.format(s['length'], max_sourcedoc_size)) # print('{} > {}'.format(s['length'], max_sourcedoc_size))
continue continue