Browse Source

ignore words with > 245 characters, xapian limit

master 0.3.14
j 6 years ago
parent
commit
7c4f3bea45
  1. 3
      CHANGES
  2. 6
      content_plugins/shortcuts.py

3
CHANGES

@ -1,3 +1,6 @@
0.3.14 2018-12-09
- render_page_as_text ignore words > 245 characters
0.3.13 2018-11-15
- Helping template tags.
- Footnote text as span (inline).

6
content_plugins/shortcuts.py

@ -30,4 +30,8 @@ def render_page_as_text(page, template, context_data, css_selector=None):
text = re.sub('[\t ]+', ' ', text)
text = re.sub(re.compile('\n +', re.DOTALL), '\n', text)
text = re.sub(re.compile('\n+', re.DOTALL), '\n', text)
return text
content = []
for word in text.split(' '):
if len(word) <= 245:
content += [word]
return ' '.join(content)

Loading…
Cancel
Save