Skip to content

Commit

Permalink
deep copy top node in the output formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
idoshamun authored Jul 28, 2021
1 parent e4beb8f commit a626a41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion newspaper/outputformatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from html import unescape
import logging
import copy

from .text import innerTrim

Expand Down Expand Up @@ -42,7 +43,7 @@ def get_formatted(self, top_node):
"""Returns the body text of an article, and also the body article
html if specified. Returns in (text, html) form
"""
self.top_node = top_node
self.top_node = copy.deepcopy(top_node)
html, text = '', ''

self.remove_negativescores_nodes()
Expand Down

0 comments on commit a626a41

Please sign in to comment.