Skip to content

Commit

Permalink
better indented output with also sections (not just traits)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmatteis committed Jul 10, 2013
1 parent 1c437b7 commit 9e15a38
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions descriptors.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,23 @@ var descriptors = {
// woo extract regex!
var space1 = ' ';
var space2 = ' ';
var arr = text.match(/[\d]+\.[\d]+\.[\d]+[ ]+[^\(\)\d\.]+/g);
var arr = text.match(/[\d]+\.([\d]+)?(\.[\d]+)?[ ]+[^\(\)\d\.]+/g);
//var arr = text.match(/[\d]+\.([\d]+)?(\.[\d]+)?[ ]+[A-Z][a-z ]+/g);
//var arr = text.match(/\d[.\d]+\s+[A-Z][^A-Z]+(?!\S)/g);
str = 'couldn\'t match regex';
if(arr) {
str = arr.map(function(d) { return $.trim(d).replace(/ +(?= )/g, ''); }).join('\n')
str = arr.map(function(d) {
var s = $.trim(d).replace(/ +(?= )/g, '');
var digits = s.match(/[\d]+/g);
var spaces = 0;
if(digits) {
spaces = digits.length - 1;
}
for(var i=0; i<spaces; i++) {
s = ' ' + s;
}
return s;
}).join('\n');
}
descriptors.showTextarea($this, $descriptor, str);
$this.text('Parse')
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

/* reset.css */
html {margin:0;padding:0;border:0;}
body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, dialog, figure, footer, header, hgroup, nav, section {margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;text-align: center;}
body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, dialog, figure, footer, header, hgroup, nav, section {margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;text-align: left;}
article, aside, details, figcaption, figure, dialog, footer, header, hgroup, menu, nav, section {display:block;}
body {line-height:1.5;}
table {border-collapse:separate;border-spacing:0;}
Expand Down

0 comments on commit 9e15a38

Please sign in to comment.