Do not auto replace named entities when committing data from editors as it can be confusing, changing what is in the container compared to what is on screen

This commit is contained in:
Kovid Goyal 2013-12-12 10:31:02 +05:30
parent 2d414ecba8
commit b7efcea021

View File

@ -10,7 +10,6 @@ import unicodedata
from PyQt4.Qt import QMainWindow, Qt, QApplication, pyqtSignal from PyQt4.Qt import QMainWindow, Qt, QApplication, pyqtSignal
from calibre import xml_replace_entities
from calibre.gui2 import error_dialog from calibre.gui2 import error_dialog
from calibre.gui2.tweak_book import actions, current_container from calibre.gui2.tweak_book import actions, current_container
from calibre.gui2.tweak_book.editor.text import TextEdit from calibre.gui2.tweak_book.editor.text import TextEdit
@ -60,8 +59,6 @@ class Editor(QMainWindow):
def data(self): def data(self):
def fget(self): def fget(self):
ans = self.get_raw_data() ans = self.get_raw_data()
if self.syntax == 'html':
ans = xml_replace_entities(ans)
return ans.encode('utf-8') return ans.encode('utf-8')
def fset(self, val): def fset(self, val):
self.editor.load_text(val, syntax=self.syntax) self.editor.load_text(val, syntax=self.syntax)