From 1bb247e1baa18ddd5de28aaa6c7ccc831546e8e5 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Tue, 8 Dec 2015 12:21:15 -0600 Subject: [PATCH] Convert replace_br_with_p module to BS4. --- fanficfare/htmlheuristics.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fanficfare/htmlheuristics.py b/fanficfare/htmlheuristics.py index a90e192..1f1173a 100644 --- a/fanficfare/htmlheuristics.py +++ b/fanficfare/htmlheuristics.py @@ -19,7 +19,7 @@ import logging logger = logging.getLogger(__name__) import re import codecs -import BeautifulSoup as bs +import bs4 as bs import HtmlTagStack as stack from . import exceptions as exceptions @@ -147,7 +147,7 @@ def replace_br_with_p(body): contentLinesSum += lineLen if lineLen > longestLineLength: longestLineLength = lineLen - + if contentLines == 0: contentLines = 1 @@ -258,7 +258,7 @@ def soup_up_div(body): body = body.replace(u'
', u'[br /]') - soup = bs.BeautifulSoup(body) + soup = bs.BeautifulSoup(body,'html5lib') body = u'' lastElement = 1 # 1 = block, 2 = nested, 3 = invalid