From 6bb475ae1279f455fe910658df285aa1850b53f9 Mon Sep 17 00:00:00 2001 From: Wolfgang Schnerring Date: Mon, 19 Feb 2024 13:40:45 +0100 Subject: [PATCH] ZO-4627: Adjust doctest to changed pretty print behaviour --- core/src/zeit/wysiwyg/html.txt | 69 ++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/core/src/zeit/wysiwyg/html.txt b/core/src/zeit/wysiwyg/html.txt index 6465c69fca..3e2587428c 100644 --- a/core/src/zeit/wysiwyg/html.txt +++ b/core/src/zeit/wysiwyg/html.txt @@ -18,7 +18,7 @@ Create an XML structure containing a body: ... ... Title ...

A paragraph

-...

Another paragraph

+...

Another paragraph follows

... ... ... ''' @@ -40,7 +40,7 @@ Get the HTML representation: >>> print(converter.to_html(article.xml.find('body')))

A paragraph

-

Another paragraph

+

Another paragraph follows

The original article xml is of course unmodifed so far: @@ -51,7 +51,7 @@ The original article xml is of course unmodifed so far: Title

A paragraph

-

Another paragraph

+

Another paragraph follows

@@ -66,7 +66,7 @@ Now for something more complex, the intertitle: ... Title ...

A paragraph

... Paragraphs are nice -...

Another paragraph

+...

Another paragraph follows

... ... ... ''' @@ -78,16 +78,16 @@ In the html `intertitle` becomes an `h3`: >>> print(converter.to_html(article.xml.find('body')))

A paragraph

Paragraphs are nice

-

Another paragraph

+

Another paragraph follows

Now we change the HTML and see the reflection in the article XML. The `h3` in the html becomes an `intertitle` again: >>> converter.from_html(article.xml.find('body'), """\ -...

A paragraph with more markup

+...

A paragraph with more markup now

...

Paragraphs are nice

-...

Another paragraph

+...

Another paragraph follows

...

Bla bla bla

... """) @@ -97,9 +97,9 @@ the html becomes an `intertitle` again: Title -

A paragraph with more markup

+

A paragraph with more markup now

Paragraphs are nice -

Another paragraph

+

Another paragraph follows

Bla bla bla

@@ -134,7 +134,8 @@ saving. br's inside a

are kept:

Foo

- bar
+ bar
+

@@ -181,7 +182,10 @@ Support trailing text on the toplevel: >>> print(zeit.cms.testing.xmltotext(article.xml))
- Title

Test

er + + Title + +

Test

er
@@ -350,13 +354,14 @@ The other way round: ... menschliche

...

Selbst wenn

""") >>> print(zeit.cms.testing.xmltotext(article.xml)) -
+
Title

Aus winzigen embryonalen ...

Fuer - menschliche

+ menschliche +

Selbst wenn

@@ -427,12 +432,12 @@ the image is put into the xml: ...

Aus winzigen embryonalen ...

...

Selbst wenn

''') >>> print(zeit.cms.testing.xmltotext(article.xml)) -
+
Title

Fuer menschliche

- + Cap cap cap

Zellen ist das toll.

@@ -481,7 +486,7 @@ Converting html to xml also splits up paragraphs as necessary: ... Zellen ist das toll.

...

Selbst wenn

''') >>> print(zeit.cms.testing.xmltotext(article.xml)) -
+
Title @@ -520,8 +525,8 @@ support it.) >>> converter = zeit.wysiwyg.html.HTMLConverter(article) >>> print(converter.to_html(article.xml.find('body')))

Aus winzigen embryonalen ...

-

Fuer menschliche - +

Fuer menschliche + Zellen ist das toll.

Selbst wenn

@@ -532,13 +537,16 @@ Zellen ist das toll.

... Zellen ist das toll.

...

Selbst wenn

''') >>> print(zeit.cms.testing.xmltotext(article.xml)) -
+
Title

Aus winzigen embryonalen ...

-

Fuer menschliche - Cap cap cap +

Fuer menschliche + + Cap cap cap + + Zellen ist das toll.

Selbst wenn

@@ -685,10 +693,10 @@ though it's nested.
- + Cap cap cap -

Hurz foobar

+

Hurz foobar

Selbst wenn

@@ -786,7 +794,7 @@ On the way back the divs become a video node: ...

Foo bar

''') >>> print(zeit.cms.testing.xmltotext(article.xml)) -
+

No bo po co to.

@@ -806,7 +814,7 @@ If no expires date is entered, it is taken from the content object instead: ... ...

Foo bar

''') >>> print(zeit.cms.testing.xmltotext(article.xml)) -
+

No bo po co to.

@@ -826,7 +834,7 @@ If no format is entered, the attribute stays empty: ... ...

Foo bar

''') >>> print(zeit.cms.testing.xmltotext(article.xml)) -
+

No bo po co to.

@@ -940,7 +948,7 @@ On the way back the divs become an audio node: ...

Foo bar

''') >>> print(zeit.cms.testing.xmltotext(article.xml)) -
+

No bo po co to.

@@ -1091,10 +1099,7 @@ Tables >>> print(converter.to_html(article.xml.find('body'))) - - - - +
foobar
foobar
@@ -1408,7 +1413,7 @@ Empty citation should not break: >>> converter.from_html(article.xml.find('body'), html) >>> print(zeit.cms.testing.xmltotext(article.xml)) -
+