From 46519195ca7da252bc92f02dd29f8abcfdfd8ea6 Mon Sep 17 00:00:00 2001 From: haobug Date: Sat, 15 Aug 2015 12:50:58 +0800 Subject: [PATCH] supress BeautifulSoup warning the warning message as below ``` /usr/lib/python2.7/site-packages/beautifulsoup4-4.4.0-py2.7.egg/bs4/__init__.py:166: UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("lxml"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently. To get rid of this warning, change this: BeautifulSoup([your markup]) to this: BeautifulSoup([your markup], "lxml") ``` --- geeknote/editor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geeknote/editor.py b/geeknote/editor.py index d7e2853..5b9bbed 100644 --- a/geeknote/editor.py +++ b/geeknote/editor.py @@ -76,7 +76,7 @@ def checklistInENMLtoSoup(soup): @staticmethod def ENMLtoText(contentENML): - soup = BeautifulSoup(contentENML.decode('utf-8')) + soup = BeautifulSoup(contentENML.decode('utf-8'), 'lxml') for section in soup.select('li > p'): section.replace_with( section.contents[0] )