Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions xmodule/annotatable_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,8 @@ def _render_content(self):
""" Renders annotatable content with annotation spans and returns HTML. """

xmltree = etree.fromstring(self.data)
content = etree.tostring(xmltree, encoding='unicode')
self._extract_instructions(xmltree)

xmltree = etree.fromstring(content)
xmltree.tag = 'div'
if 'display_name' in xmltree.attrib:
del xmltree.attrib['display_name']
Expand Down
8 changes: 8 additions & 0 deletions xmodule/tests/test_annotatable_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,11 @@ def test_extract_instructions(self):
xmltree = etree.fromstring('<annotatable>foo</annotatable>')
actual = self.annotatable._extract_instructions(xmltree) # lint-amnesty, pylint: disable=protected-access
assert actual is None

def test_instruction_removal(self):
xmltree = etree.fromstring(self.sample_xml)
instructions = self.annotatable._extract_instructions(xmltree) # pylint: disable=protected-access

assert instructions is not None
assert "Read the text." in instructions
assert xmltree.find("instructions") is None
Loading