diff --git a/common/lib/xmodule/xmodule/annotatable_module.py b/common/lib/xmodule/xmodule/annotatable_module.py
index 7a0adc0bf2..9e492f755a 100644
--- a/common/lib/xmodule/xmodule/annotatable_module.py
+++ b/common/lib/xmodule/xmodule/annotatable_module.py
@@ -63,26 +63,29 @@ class AnnotatableModule(XModule):
return data_attrs
+ def _render_annotation(self, index, el):
+ """ Renders an annotation element for HTML output. """
+ attr = {}
+ attr.update(self._get_annotation_class_attr(index, el))
+ attr.update(self._get_annotation_data_attr(index, el))
+
+ el.tag = 'span'
+
+ for key in attr.keys():
+ el.set(key, attr[key]['value'])
+ if '_delete' in attr[key] and attr[key]['_delete'] is not None:
+ delete_key = attr[key]['_delete']
+ del el.attrib[delete_key]
+
+
def _render_content(self):
""" Renders annotatable content with annotation spans and returns HTML. """
-
xmltree = etree.fromstring(self.content)
xmltree.tag = 'div'
index = 0
for el in xmltree.findall('.//annotation'):
- el.tag = 'span'
-
- attr = {}
- attr.update(self._get_annotation_class_attr(index, el))
- attr.update(self._get_annotation_data_attr(index, el))
-
- for key in attr.keys():
- el.set(key, attr[key]['value'])
- if '_delete' in attr[key] and attr[key]['_delete'] is not None:
- delete_key = attr[key]['_delete']
- del el.attrib[delete_key]
-
+ self._render_annotation(index, el)
index += 1
return etree.tostring(xmltree, encoding='unicode')
diff --git a/common/lib/xmodule/xmodule/css/annotatable/display.scss b/common/lib/xmodule/xmodule/css/annotatable/display.scss
index eef4ab28b7..fc22537899 100644
--- a/common/lib/xmodule/xmodule/css/annotatable/display.scss
+++ b/common/lib/xmodule/xmodule/css/annotatable/display.scss
@@ -14,7 +14,10 @@
border-radius: .5em;
margin-bottom: .5em;
- .annotatable-section-title {}
+ .annotatable-section-title {
+ font-weight: bold;
+ a { font-weight: normal; }
+ }
.annotatable-section-body {
border-top: 1px solid $border-color;
margin-top: .5em;
diff --git a/common/lib/xmodule/xmodule/tests/test_annotatable_module.py b/common/lib/xmodule/xmodule/tests/test_annotatable_module.py
index 5d270d2350..422372b1b0 100644
--- a/common/lib/xmodule/xmodule/tests/test_annotatable_module.py
+++ b/common/lib/xmodule/xmodule/tests/test_annotatable_module.py
@@ -1,7 +1,47 @@
"""Module annotatable tests"""
import unittest
-from xmodule import annotatable
+
+from lxml import etree
+from mock import Mock
+
+from xmodule.annotatable_module import AnnotatableModule
+from xmodule.modulestore import Location
+
+from . import test_system
class AnnotatableModuleTestCase(unittest.TestCase):
+ location = Location(["i4x", "edX", "toy", "annotatable", "guided_discussion"])
+ sample_text = '''
+
+