Skip to content

Commit 3d8a24c

Browse files
committed
Refine patch list (Issue #241)
* Decode character references using `$('<div/>').html(str).text()`. * Remove duplicated description. * Insert a line break before 'Solution:'.
1 parent 854a664 commit 3d8a24c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

assets/javascripts/patch-list.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ $(function() {
33

44
$.getJSON("//vim-jp.herokuapp.com/patches/json?callback=?", function(items) {
55
$.each(items, function() {
6+
var desc = $('<div/>').html(this.description).text().replace(/^[^\n]*\n\n/, '').replace(/\n(?=Solution:)/, '<br/>')
67
$('<li/>').append(
78
$('<a/>').attr({'href': this.link, 'target': '_blank'}).text("Patch " + this.title)
8-
).append($('<br/>')).append($('<span/>').text(this.description)).appendTo('#patches-list');
9+
).append($('<br/>')).append($('<span/>').html(desc)).appendTo('#patches-list');
910
});
1011
});
1112
});

0 commit comments

Comments
 (0)