Skip to content

Commit 6825296

Browse files
author
Marcel Gerber
committed
Use marked.js to show changelog in Markdown mode
1 parent 251517e commit 6825296

5 files changed

Lines changed: 1309 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
## 0.10.12
1111
* Added features to view authors of a file or current selection.
12-
1312
* Push dialog shows masked password.
1413
* Tabs are now properly displayed in the diffs respecting Brackets "tabSize" preference.
1514

htmlContent/git-changelog-dialog.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<h1 class="dialog-title">Brackets Git: {{TITLE}}</h1>
44
</div>
55
<div class="modal-body table-striped tab-content">
6-
<pre id="git-changelog"></pre>
6+
<div id="git-changelog"></div>
77
</div>
88
<div class="modal-footer">
99
<button data-button-id="ok" class="dialog-button btn btn-80">{{Strings.BUTTON_CLOSE}}</button>

less/brackets-git.less

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,41 @@
266266
}
267267
}
268268

269+
#git-changelog-dialog {
270+
#git-changelog {
271+
color: #333333;
272+
font-family: Helvetica, arial, sans-serif;
273+
font-size: 15px;
274+
line-height: 1.7px;
275+
padding: 1em;
276+
margin: auto;
277+
background: #f8f8f8;
278+
border-radius: 5px;
279+
p {
280+
margin: 1em 0;
281+
}
282+
h1, h2 {
283+
color: #111111;
284+
}
285+
h1 {
286+
font-size: 2.5em;
287+
font-weight: bold;
288+
border-bottom: 1px solid #dddddd;
289+
}
290+
h2 {
291+
font-size: 2em;
292+
border-bottom: 1px solid #eeeeee;
293+
}
294+
li {
295+
margin: 4px 0;
296+
}
297+
ul {
298+
margin-top: 18px;
299+
margin-bottom: 28px;
300+
}
301+
}
302+
}
303+
269304
#git-commit-dialog, #git-diff-dialog {
270305
.modal-body {
271306
.flex-box(column);

src/ChangelogDialog.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ define(function (require, exports) {
1212
Strings = require("../strings"),
1313
changelogDialogTemplate = require("text!htmlContent/git-changelog-dialog.html");
1414

15+
var marked = require("../thirdparty/marked");
16+
1517
var dialog;
1618

1719
exports.show = function () {
@@ -21,7 +23,11 @@ define(function (require, exports) {
2123
dialog = Dialogs.showModalDialogUsingTemplate(compiledTemplate);
2224

2325
FileUtils.readAsText(FileSystem.getFileForPath(Preferences.get("extensionDirectory") + "CHANGELOG.md")).done(function (content) {
24-
$("#git-changelog", dialog.getElement()).text(content);
26+
content = marked(content, {
27+
gfm: true,
28+
breaks: true
29+
});
30+
$("#git-changelog", dialog.getElement()).html(content);
2531
});
2632
};
2733

0 commit comments

Comments
 (0)