Skip to content

Commit

Permalink
non-latin spaces for nixnote compatible #24
Browse files Browse the repository at this point in the history
  • Loading branch information
nvbn committed Oct 19, 2012
1 parent df50e63 commit 62e39a4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions everpad/pad/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import hashlib
import urllib
import json
import re


class ImagePrefs(QDialog):
Expand Down Expand Up @@ -195,7 +196,7 @@ def content(self):
if media.get('hash'):
media.name = 'en-media'
del media['src']
self._content = sanitize(soup=soup.find(id='content'))
self._content = sanitize(soup=soup.find(id='content')).replace(' ', u'\xa0 ')
return self._content

@content.setter
Expand All @@ -217,7 +218,10 @@ def content(self, val):
media['src'] = ''
else:
media.hidden = True
self._content = unicode(soup).replace(' ' * 5, '<img class="tab" />') # shit!
self._content = re.sub(
r'([(&nbsp) ]{5})', '<img class="tab" />',
unicode(soup).replace(u'\xa0', ' '),
) # shit!
self.apply()

def apply(self):
Expand Down

0 comments on commit 62e39a4

Please sign in to comment.