Merge ~ya-bo-ng/maas:fix-script-results-page into maas:master

Proposed by Anthony Dillon
Status: Merged
Approved by: Andres Rodriguez
Approved revision: 0db8836ba7a9e7caf16be3eb6043f5220251cc89
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~ya-bo-ng/maas:fix-script-results-page
Merge into: maas:master
Diff against target: 20 lines (+3/-1)
1 file modified
src/maasserver/static/js/angular/directives/code_lines.js (+3/-1)
Reviewer Review Type Date Requested Status
Andres Rodriguez (community) Approve
Review via email: mp+338451@code.launchpad.net

Commit message

LP: #1750007 - Fix numbered code blocks

Description of the change

Added a new line to the beginning of each new code line in the numbered code block pattern.

To post a comment you must log in.
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Please see inline.

review: Needs Information
Revision history for this message
Anthony Dillon (ya-bo-ng) :
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Hi Ant,

question inline.

review: Needs Information
Revision history for this message
Anthony Dillon (ya-bo-ng) :
Revision history for this message
Andres Rodriguez (andreserl) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/maasserver/static/js/angular/directives/code_lines.js b/src/maasserver/static/js/angular/directives/code_lines.js
2index 160d99a..903f761 100644
3--- a/src/maasserver/static/js/angular/directives/code_lines.js
4+++ b/src/maasserver/static/js/angular/directives/code_lines.js
5@@ -27,13 +27,15 @@
6
7 // Count the line contents
8 var lines = element.html().split('\n'),
9+ newLine = '',
10 insert = "<code>";
11
12 // Each line is to be wrapped by a span which is style & given
13 // its appropriate line number
14 $.each(lines, function() {
15- insert += '<span class="code-line">' +
16+ insert += newLine + '<span class="code-line">' +
17 this + '</span>';
18+ newLine = '\n';
19 });
20 insert += "</code>";
21

Subscribers

People subscribed via source and target branches