-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Uses the new DOM logic to prevent document corruption when shapes and images are present in a loop construct. This PR also fixes a backwards compatibility issue that arose in HTML insertion when plain text was a top level node in the HTML being parsed. * Allow DOM entries to be accessed by name using [] * Add logic to Loop operation to update unique docPr and cNvPr tags * Update Loop operation to not require namespaces for docPr and cNvPr tags These can exist under multiple namespaces and while the id attribute probably only has to be unique per namespace it is far simpler to update them all in unison. If this is found to break something then we will address the issue then. * Update mock DOM class to work with new unique ID logic in Loop operation * Add a unit test for unique id incrementing inside loops * Fix duplicate class name in sablon_test This prevented the CV test case from executing, a test case that now fails due to changes to HTML insertion. * Fix test failure due to header text being changed to current time This wasn't checked prior to my changes to checking docx equality since the old method only checked the document.xml instead of every XML file in the archive. * Fix CV test case for Sablon, HTML content needed wrapped in <span> * Add integration test for loops with shapes and images inside them * Add class method to ASTBuilder that checks for any block tags in a nodeset This change also required moving the fetch_tag method to the class level. * Only remove text nodes from root element if block level tags exist This fixes a backwards compatabilty issue created by my refactor of HTML insertion to be "inline" or "block". * Remove span tag wrapping around "about_me" value in CV integration test
- Loading branch information
1 parent
b27f50a
commit 4a7b82a
Showing
12 changed files
with
298 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
<w:p> | ||
<w:pPr> | ||
<w:rPr> | ||
<w:noProof/> | ||
</w:rPr> | ||
</w:pPr> | ||
</w:p> | ||
<w:p> | ||
<w:pPr> | ||
<w:rPr> | ||
<w:noProof/> | ||
</w:rPr> | ||
</w:pPr> | ||
</w:p> | ||
<w:p> | ||
<w:r> | ||
<w:fldChar w:fldCharType="begin"/> | ||
</w:r> | ||
<w:r> | ||
<w:instrText xml:space="preserve"> MERGEFIELD </w:instrText> | ||
</w:r> | ||
<w:r> | ||
<w:instrText>cars</w:instrText> | ||
</w:r> | ||
<w:r> | ||
<w:instrText xml:space="preserve">:each(item) \* MERGEFORMAT </w:instrText> | ||
</w:r> | ||
<w:r> | ||
<w:fldChar w:fldCharType="separate"/> | ||
</w:r> | ||
<w:r> | ||
<w:rPr> | ||
<w:noProof/> | ||
</w:rPr> | ||
<w:t>«cars:each(item)»</w:t> | ||
</w:r> | ||
<w:r> | ||
<w:rPr> | ||
<w:noProof/> | ||
</w:rPr> | ||
<w:fldChar w:fldCharType="end"/> | ||
</w:r> | ||
</w:p> | ||
<w:p> | ||
<w:pPr> | ||
<w:pStyle w:val="ListParagraph"/> | ||
<w:numPr> | ||
<w:ilvl w:val="0"/> | ||
<w:numId w:val="1"/> | ||
</w:numPr> | ||
</w:pPr> | ||
<w:r> | ||
<w:fldChar w:fldCharType="begin"/> | ||
</w:r> | ||
<w:r> | ||
<w:instrText xml:space="preserve"> MERGEFIELD =item.name \* MERGEFORMAT </w:instrText> | ||
</w:r> | ||
<w:r> | ||
<w:fldChar w:fldCharType="separate"/> | ||
</w:r> | ||
<w:r> | ||
<w:rPr> | ||
<w:noProof/> | ||
</w:rPr> | ||
<w:t>«=item.name»</w:t> | ||
</w:r> | ||
<w:r> | ||
<w:fldChar w:fldCharType="end"/> | ||
</w:r> | ||
<w:r> | ||
<w:t xml:space="preserve"> | ||
</w:t> | ||
</w:r> | ||
<w:r> | ||
<w:rPr> | ||
<w:noProof/> | ||
</w:rPr> | ||
<w:drawing> | ||
<wp:inline distT="0" distB="0" distL="0" distR="0"> | ||
<wp:extent cx="1254868" cy="889278"/> | ||
<wp:effectExtent l="0" t="0" r="2540" b="0"/> | ||
<wp:docPr id="2" name="Picture 3"/> | ||
<wp:cNvGraphicFramePr> | ||
<a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1"/> | ||
</wp:cNvGraphicFramePr> | ||
<a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"> | ||
<a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture"> | ||
<pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"> | ||
<pic:nvPicPr> | ||
<pic:cNvPr id="3" name="MTF 500.pdf"/> | ||
<pic:cNvPicPr/> | ||
</pic:nvPicPr> | ||
<pic:blipFill> | ||
<a:blip r:embed="rId5" cstate="print"> | ||
<a:extLst> | ||
<a:ext uri="{28A0092B-C50C-407E-A947-70E740481C1C}"> | ||
<a14:useLocalDpi xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" val="0"/> | ||
</a:ext> | ||
</a:extLst> | ||
</a:blip> | ||
<a:stretch> | ||
<a:fillRect/> | ||
</a:stretch> | ||
</pic:blipFill> | ||
<pic:spPr> | ||
<a:xfrm> | ||
<a:off x="0" y="0"/> | ||
<a:ext cx="1286502" cy="911696"/> | ||
</a:xfrm> | ||
<a:prstGeom prst="rect"> | ||
<a:avLst/> | ||
</a:prstGeom> | ||
</pic:spPr> | ||
</pic:pic> | ||
</a:graphicData> | ||
</a:graphic> | ||
</wp:inline> | ||
</w:drawing> | ||
</w:r> | ||
<w:r> | ||
<w:br/> | ||
</w:r> | ||
</w:p> | ||
<w:p> | ||
<w:r> | ||
<w:fldChar w:fldCharType="begin"/> | ||
</w:r> | ||
<w:r> | ||
<w:instrText xml:space="preserve"> MERGEFIELD </w:instrText> | ||
</w:r> | ||
<w:r> | ||
<w:instrText>cars</w:instrText> | ||
</w:r> | ||
<w:r> | ||
<w:instrText xml:space="preserve">:endEach \* MERGEFORMAT </w:instrText> | ||
</w:r> | ||
<w:r> | ||
<w:fldChar w:fldCharType="separate"/> | ||
</w:r> | ||
<w:r> | ||
<w:rPr> | ||
<w:noProof/> | ||
</w:rPr> | ||
<w:t>«cars:endEach»</w:t> | ||
</w:r> | ||
<w:r> | ||
<w:rPr> | ||
<w:noProof/> | ||
</w:rPr> | ||
<w:fldChar w:fldCharType="end"/> | ||
</w:r> | ||
</w:p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:mo="http://schemas.microsoft.com/office/mac/office/2008/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mv="urn:schemas-microsoft-com:mac:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 wp14"> | ||
<w:body> | ||
<w:p></w:p> | ||
<w:sectPr> | ||
<w:pgSz w:w="12240" w:h="15840"/> | ||
<w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/> | ||
<w:cols w:space="720"/> | ||
<w:docGrid w:linePitch="360"/> | ||
</w:sectPr> | ||
</w:body> | ||
</w:document> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.