Skip to content

Commit b1c2a48

Browse files
committed
cleaned up a few typos.
1 parent 511cae1 commit b1c2a48

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎source/exercises/html_renderer/html_renderer_tutorial.rst‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,12 @@ So the method looks something like this:
261261
.. code-block:: python
262262
263263
def render(self, out_file):
264+
out_file.write("<{}>\n".format(self.tag))
264265
# loop through the list of contents:
265266
for content in self.contents:
266-
out_file.write("<{}>\n".format(self.tag))
267267
out_file.write(content)
268268
out_file.write("\n")
269-
out_file.write("</{}>\n".format(self.tag))
269+
out_file.write("</{}>\n".format(self.tag))
270270
271271
Now run the tests again::
272272

@@ -854,7 +854,7 @@ OK, that should have been straightforward. Now this part:
854854

855855
Some html elements don't tend to have a lot of content, such as the document title. So it makes sense to render them all on one line. This is going to require a new render method. Since there are multiple types of elements that should be rendered on one line, we want to create a base class for all one-line elements. It should subclass from ``Element``, and override the render method with a new one, which will be pretty much the same as the main ``Element`` method, but without the newlines.
856856

857-
Before we do that though -- let's write a test for that! Because the ``ONeLineTag`` class is a base class for actual elements that should be rendered on one line, we really don't need to write a test directly for it. We can write one for its first subclass: ``Title``. The title elements should be rendered something like this::
857+
Before we do that though -- let's write a test for that! Because the ``OneLineTag`` class is a base class for actual elements that should be rendered on one line, we really don't need to write a test directly for it. We can write one for its first subclass: ``Title``. The title elements should be rendered something like this::
858858

859859
<title> PythonClass - title example </title>
860860

0 commit comments

Comments
 (0)