Changeset 2a386e2
- Timestamp:
- 08/10/10 19:48:59 (3 years ago)
- Branches:
- master
- Children:
- 6734727
- Parents:
- ebf3cf3
- git-author:
- Aurélien Bompard <aurelien@…> (08/10/10 19:48:59)
- git-committer:
- Aurélien Bompard <aurelien@…> (08/10/10 19:48:59)
- Files:
-
- 3 edited
-
tests/data/1.xml (modified) (3 diffs)
-
tests/test_block.py (modified) (1 diff)
-
xsl/document-content/block.xsl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tests/data/1.xml
reb18ea2 r2a386e2 316 316 Example: 317 317 </text:p> 318 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Preformatted_20_Text"> llama::<text:line-break/> some kind of mammal, with hair<text:line-break/> ppython::<text:line-break/> some kind of reptile, without hair<text:line-break/> (can you spot the typo?)</text:p><text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Text_20_body">318 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Preformatted_20_Text"> llama::<text:line-break/> some kind of mammal, with hair<text:line-break/> ppython::<text:line-break/> some kind of reptile, without hair<text:line-break/> (can you spot the typo?)</text:p><text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Text_20_body"> 319 319 Display: 320 320 </text:p> … … 372 372 Display: 373 373 </text:p> 374 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Preformatted_20_Text"> def HelloWorld():<text:line-break/> print "Hello World"</text:p><!--section level 2-->374 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Preformatted_20_Text"> def HelloWorld():<text:line-break/> print "Hello World"</text:p><!--section level 2--> 375 375 <text:h xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Heading_20_2" text:outline-level="2">Blockquotes</text:h> 376 376 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Text_20_body"> … … 380 380 Example: 381 381 </text:p> 382 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Preformatted_20_Text"> This text is a quote from someone else.</text:p><text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Text_20_body">382 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Preformatted_20_Text"> This text is a quote from someone else.</text:p><text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Text_20_body"> 383 383 Display: 384 384 </text:p> -
tests/test_block.py
rebf3cf3 r2a386e2 38 38 odt = xhtml2odt(html) 39 39 print odt 40 assert str(odt) == '<?xml version="1.0" encoding="utf-8"?>\n<text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Preformatted_20_Text"> Line with spaces </text:p>\n' 40 # note: one of the spaces below is a non-breaking space, can you spot it ? ;-) 41 assert str(odt) == '<?xml version="1.0" encoding="utf-8"?>\n<text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Preformatted_20_Text"> Line with spaces </text:p>\n' 41 42 42 43 def test_pre4(self): -
xsl/document-content/block.xsl
rebf3cf3 r2a386e2 103 103 </xsl:call-template> 104 104 </xsl:when> 105 <xsl:when test="contains($content, ' ')"> 106 <xsl:value-of select="substring-before($content, ' ')"/> 107 <xsl:text>  </xsl:text> 108 <xsl:call-template name="pre.line"> 109 <xsl:with-param name="content" select="substring-after($content, ' ')"/> 110 </xsl:call-template> 111 </xsl:when> 105 112 <xsl:otherwise> 106 113 <xsl:value-of select="string($content)"/>
Note: See TracChangeset
for help on using the changeset viewer.
