Commit d752aa18fb34928491e308a85286101b9f6e35e1
Make diff table more compact
cel committed on 3/28/2020, 5:55:47 PMParent: 4ee97dfaa67cc8ab77bbac574f0d05c6d60f4e37
Files changed
lib/render.js | changed |
lib/serve.js | changed |
static/styles.css | changed |
lib/render.js | ||
---|---|---|
@@ -727,16 +727,17 @@ | ||
727 | 727 … | var oldText = String(oldC.text || oldC.description || '') |
728 | 728 … | var newText = String(newC.text || newC.description || '') |
729 | 729 … | var diff = Diff.structuredPatch('', '', oldText, newText) |
730 | 730 … | var self = this |
731 | - return h('table', [ | |
731 … | + // note: this structure is duplicated in lib/render.js | |
732 … | + return h('table', {class: 'diff-table'}, [ | |
732 | 733 … | diff.hunks.map(function (hunk) { |
733 | 734 … | var oldLine = hunk.oldStart |
734 | 735 … | var newLine = hunk.newStart |
735 | 736 … | return [ |
736 | 737 … | h('tr', [ |
737 | 738 … | h('td', {colspan: 2}), |
738 | - h('td', h('pre', | |
739 … | + h('td', {colspan: 2}, h('pre', | |
739 | 740 … | '@@ -' + oldLine + ',' + hunk.oldLines + ' ' + |
740 | 741 … | '+' + newLine + ',' + hunk.newLines + ' @@')) |
741 | 742 … | ]), |
742 | 743 … | hunk.lines.map(function (line) { |
@@ -749,10 +750,10 @@ | ||
749 | 750 … | }, [ |
750 | 751 … | lineNums.map(function (num, i) { |
751 | 752 … | return h('td', String(num)) |
752 | 753 … | }), |
753 | - h('td', {innerHTML: | |
754 | - h('code', s).outerHTML + | |
754 … | + h('td', {class: 'diff-sigil'}, h('code', s)), | |
755 … | + h('td', {class: 'diff-line'}, {innerHTML: | |
755 | 756 … | u.unwrapP(self.markdown(line.substr(1), |
756 | 757 … | s == '-' ? oldC.mentions : newC.mentions)) |
757 | 758 … | }) |
758 | 759 … | ]) |
lib/serve.js | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 164546 bytes New file size: 164693 bytes |
Built with git-ssb-web