diff --git a/lms/djangoapps/edxnotes/helpers.py b/lms/djangoapps/edxnotes/helpers.py index 782bfae76d..1b716223d8 100644 --- a/lms/djangoapps/edxnotes/helpers.py +++ b/lms/djangoapps/edxnotes/helpers.py @@ -144,6 +144,8 @@ def preprocess_collection(user, course, collection): u"quote": sanitize_html(model["quote"]), u"updated": dateutil_parse(model["updated"]), }) + if "tags" in model: + model.update({u"tags": [sanitize_html(tag) for tag in model["tags"]]}) usage_id = model["usage_id"] if usage_id in cache: model.update(cache[usage_id]) diff --git a/lms/static/sass/course/_student-notes.scss b/lms/static/sass/course/_student-notes.scss index 5c92c84653..21c3937624 100644 --- a/lms/static/sass/course/_student-notes.scss +++ b/lms/static/sass/course/_student-notes.scss @@ -233,6 +233,13 @@ $divider-visual-tertiary: ($baseline/20) solid $gray-l4; color: $m-gray-d2; } + // CASE: tag matches a search query + .reference-meta.reference-tags .note-highlight { + // needed because .note-highlight is a span, which overrides the color + @extend %shame-link-text; + background-color: $result-highlight-color-base; + } + // Put commas between tags. a.reference-meta.reference-tags:after { content: ","; diff --git a/lms/templates/edxnotes/note-item.underscore b/lms/templates/edxnotes/note-item.underscore index 1c9281d4f5..7ec7425c4d 100644 --- a/lms/templates/edxnotes/note-item.underscore +++ b/lms/templates/edxnotes/note-item.underscore @@ -38,7 +38,7 @@ <% if (tags.length > 0) { %>

<%- gettext("Tags:") %>

<% for (var i = 0; i < tags.length; i++) { %> - <%- tags[i] %> + <%= tags[i] %> <% } %> <% } %>