Skip to content

Commit

Permalink
Merge pull request joemccann#537 from benjamin-albert/table_css
Browse files Browse the repository at this point in the history
Makes markdown-it apply bootstrap table CSS
  • Loading branch information
joemccann committed May 10, 2016
2 parents 163893e + e1b1b38 commit 29edd56
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions plugins/core/markdown-it.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,11 @@ md
.use(require('markdown-it-abbr'))
.use(require('markdown-it-checkbox'));

md.renderer.rules.table_open = function(tokens, idx, options, env, self) {
var token = tokens[idx];
token.attrPush([ 'class', 'table table-striped table-bordered' ]);

return self.renderToken(tokens, idx, options);
};

exports.md = md
1 change: 1 addition & 0 deletions public/scss/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
@import 'components/pagination';
@import 'components/diNotify';
@import 'components/zen-mode';
@import 'components/table';
// @import 'components/bucket';
// @import 'components/card';
// @import 'components/cell';
Expand Down
3 changes: 3 additions & 0 deletions public/scss/components/_table.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#preview .table {
width: auto;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// @import "bootstrap/type";
@import "bootstrap/code";
/* @import "bootstrap/grid"; */
/* @import "bootstrap/tables"; */
@import "bootstrap/tables";
@import "bootstrap/forms";
@import "bootstrap/buttons";

Expand Down

0 comments on commit 29edd56

Please sign in to comment.