This commit is contained in:
Kovid Goyal 2024-11-11 11:14:39 +05:30
parent ec445d6c32
commit 6b91f666e4
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 7 additions and 7 deletions

View File

@ -12,8 +12,6 @@ import sys
import traceback
from functools import partial
from qt.webengine import QWebEngineView
from qt.core import (
QAbstractItemView,
QApplication,
@ -36,13 +34,13 @@ from qt.core import (
Qt,
QTableWidget,
QTableWidgetItem,
QTextBrowser,
QTextCharFormat,
QTextOption,
QToolButton,
QVBoxLayout,
pyqtSignal,
)
from qt.webengine import QWebEngineView
from calibre import sanitize_file_name
from calibre.constants import config_dir

View File

@ -6,8 +6,10 @@ __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from enum import IntEnum
from calibre import prepare_string_for_xml
class NodeKinds(IntEnum):
DOCUMENT = -1
CODE_TEXT = -2
@ -413,7 +415,7 @@ class FFMLProcessor:
self.move_pos(len('``'))
end = self.find('``')
if end < 0:
self.error(f'Missing closing "``" for CODE_TEXT')
self.error('Missing closing "``" for CODE_TEXT')
node = CodeText(self.text_to(end))
self.move_pos(end + len('``'))
return node
@ -422,7 +424,7 @@ class FFMLProcessor:
self.move_pos(1)
end = self.find('`')
if end < 0:
self.error(f'Missing closing "`" for italics')
self.error('Missing closing "`" for italics')
node = ItalicTextNode(self.text_to(end))
self.move_pos(end + 1)
return node
@ -431,7 +433,7 @@ class FFMLProcessor:
self.move_pos(len(':guilabel:`'))
end = self.find('`')
if end < 0:
self.error(f'Missing ` (backquote) for :guilabel:')
self.error('Missing ` (backquote) for :guilabel:')
node = GuiLabelNode(self.text_to_no_newline(end, 'GUI_LABEL (:guilabel:`)'))
self.move_pos(end + len('`'))
return node
@ -440,7 +442,7 @@ class FFMLProcessor:
self.move_pos(len('[CODE]\n'))
end = self.find('[/CODE]')
if end < 0:
self.error(f'Missing [/CODE] for block')
self.error('Missing [/CODE] for block')
node = CodeBlock(self.text_to(end))
self.move_pos(end + len('[/CODE]'))
if self.text_to(1) == '\n':