v0.5.3
- Мелкие исправления увеличивающие работу конвертера
This commit is contained in:
@@ -33,7 +33,7 @@ class DocxParagraphPygmentsFormatter(Formatter):
|
||||
self._styles[token] = style
|
||||
|
||||
def _add_run_to_last_paragraph(self, text, style):
|
||||
self._paragraphs[-1].add_run(text, style["bold"] or None, style["italic"] in style or None,
|
||||
self._paragraphs[-1].add_run(text, style["bold"] or None, style.get("italic") or None,
|
||||
RGBColor.from_string(style['color']) if style['color'] else None)
|
||||
|
||||
def format(self, tokensource, outfile):
|
||||
@@ -63,20 +63,6 @@ class Listing(Renderable, RequiresNumbering):
|
||||
if caption_info and caption_info.unique_name:
|
||||
self.unique_name = caption_info.unique_name
|
||||
|
||||
def _create_table(self, parent, width: Length):
|
||||
# Kept for tests / callers that still expect the helper; render uses multi-row.
|
||||
left_margin = Twips(int(
|
||||
parent.part.styles["Normal Table"]._element.xpath("w:tblPr/w:tblCellMar/w:left")[0].attrib[
|
||||
"{http://schemas.openxmlformats.org/wordprocessingml/2006/main}w"]))
|
||||
right_margin = Twips(int(
|
||||
parent.part.styles["Normal Table"]._element.xpath("w:tblPr/w:tblCellMar/w:right")[0].attrib[
|
||||
"{http://schemas.openxmlformats.org/wordprocessingml/2006/main}w"]))
|
||||
|
||||
return create_table(
|
||||
parent, 1, 1,
|
||||
Twips(_twips(width) + _twips(left_margin) + _twips(right_margin)),
|
||||
)
|
||||
|
||||
def set_text(self, text: str):
|
||||
def create_paragraph() -> Paragraph:
|
||||
paragraph = Paragraph(self._parent)
|
||||
|
||||
Reference in New Issue
Block a user