Skip to content

Commit

Permalink
Merge 94a255e into ced0e1f
Browse files Browse the repository at this point in the history
  • Loading branch information
shinyichen committed May 20, 2021
2 parents ced0e1f + 94a255e commit 4cb8018
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/widgets/abstract/templates/abstract_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ <h4 class="sr-only">Abstract</h4>
{{/if}} {{#if comment}}
<dt>Comments:</dt>
<dd>
{{ comment }}
{{{ comment }}}
</dd>
{{/if}} {{#if pubnote}}
<dt>E-Print Comments:</dt>
Expand Down
13 changes: 13 additions & 0 deletions src/js/widgets/list_of_things/item_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@ define([
},

render: function() {
// // a hacky way to decode html in highglights
// if (this.model.get('highlights')) {
// const highlights = this.model.get('highlights');
// this.model.set(
// 'highlights',
// highlights.map((h) =>
// $('<textarea/>')
// .html(h)
// .text()
// )
// );
// }

if (this.model.get('visible')) {
return Marionette.ItemView.prototype.render.apply(this, arguments);
}
Expand Down
7 changes: 7 additions & 0 deletions src/js/widgets/list_of_things/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,13 @@ define([
if (docs && docs.length) {
// make sure the new docs close highlights if they aren't there
var newDocs = _.map(docs, function(d) {
if (d.highlights) {
d.highlights = d.highlights.map((h) =>
$('<textarea/>')
.html(h)
.text()
);
}
return _.extend(d, {
showHighlights: typeof d.highlights !== 'undefined',
showCheckbox: !!self.model.get('showCheckboxes'),
Expand Down

0 comments on commit 4cb8018

Please sign in to comment.