From 3172622360f31e893daadcaddb43f3563664cebc Mon Sep 17 00:00:00 2001 From: Untone Date: Sun, 10 Oct 2021 15:36:57 +0300 Subject: [PATCH] Aaron is back --- .gitignore | 3 ++- migration/tables/content_items.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index a97e33e8..b4a5505e 100644 --- a/.gitignore +++ b/.gitignore @@ -135,4 +135,5 @@ discours.crt Pipfile.lock migration/data -migration/content/**/*.md \ No newline at end of file +migration/content/**/*.md +.obsidian \ No newline at end of file diff --git a/migration/tables/content_items.py b/migration/tables/content_items.py index 3418e932..5acd59dc 100644 --- a/migration/tables/content_items.py +++ b/migration/tables/content_items.py @@ -112,7 +112,7 @@ def migrate(entry): else: body_html = str(BeautifulSoup( body_orig, features="html.parser")) - r['body'] = body_html # html2text(body_html).replace('****', '**') + r['body'] = html2text(body_html).replace('****', '**') r['old_id'] = entry.get('_id') else: print(r['slug'] + ': literature has no media') @@ -134,7 +134,7 @@ def migrate(entry): if r.get('body') is None: body_orig = entry.get('body', '') body_html = str(BeautifulSoup(body_orig, features="html.parser")) - r['body'] = body_html # html2text(body_html).replace('****', '**') + r['body'] = html2text(body_html).replace('****', '**') r['old_id'] = entry.get('_id') body = r.get('body') user = None @@ -178,7 +178,7 @@ def migrate(entry): r['authors'].append({ 'slug': slug, 'name': name, - 'pic': userpic + 'userpic': userpic }) r['layout'] = type2layout[entry['type']]