diff options
| author | Bobby <[email protected]> | 2023-02-01 22:07:05 -0500 |
|---|---|---|
| committer | Bobby <[email protected]> | 2023-02-01 22:07:05 -0500 |
| commit | afa62a72d5f6677ae88b8dc8a0fde4820124f3bf (patch) | |
| tree | 795c71ff79220726b594802cf3a8dc9c37bc2ba3 | |
| parent | 826033db8ffa0be7c49ffed9b6d08872ac15cd5f (diff) | |
| download | thatcomputerscientist-afa62a72d5f6677ae88b8dc8a0fde4820124f3bf.tar.xz thatcomputerscientist-afa62a72d5f6677ae88b8dc8a0fde4820124f3bf.zip | |
Return text only in paragraph excerpt
| -rw-r--r-- | blog/context_processors.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/blog/context_processors.py b/blog/context_processors.py index 5b3dfc4a..895bdb7c 100644 --- a/blog/context_processors.py +++ b/blog/context_processors.py @@ -14,6 +14,7 @@ def add_excerpt(post): # Create excerpt, count min 1000 characters and max upto next paragraph excerpt = '' for paragraph in soup.find_all('p'): + paragraph = '<p>' + str(paragraph.text) + '</p>' excerpt += str(paragraph) if len(excerpt) >= 1000: |
