Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error in textToENML, BeautifulSoup not parsing strings with non ascii characters #250

Merged
merged 1 commit into from
Dec 25, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix error in textToENML, BeautifulSoup not parsing strings with non a…
…scii characters

When there are non ascii characters in edit command, it throws:

     Error while parsing text to html. Content must be an UTF-8 encode.
  • Loading branch information
pblocz committed Dec 21, 2014
commit 3d6368cd1e1478c9901ed88be3df0d76c77733f8
2 changes: 1 addition & 1 deletion geeknote/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def textToENML(content, raise_ex=False, format='markdown'):
# add 2 space before new line in paragraph for creating br tags
content = re.sub(r'([^\r\n])([\r\n])([^\r\n])', r'\1 \n\3', content)
if format=='markdown':
contentHTML = markdown.markdown(content).encode("utf-8")
contentHTML = markdown.markdown(content)
# Non-Pretty HTML output
contentHTML = str(BeautifulSoup(contentHTML, 'html.parser'))
else:
Expand Down