Skip to content

Commit

Permalink
Merge pull request react-bootstrap#924 from AlexKVal/docsGen
Browse files Browse the repository at this point in the history
Small regexp refactorings.
  • Loading branch information
mtscout6 committed Jun 30, 2015
2 parents 80d1780 + 2275a28 commit 1a4c5ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/generate-metadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ let cleanDoclets = desc => {
return (idx === -1 ? desc : desc.substr(0, idx )).trim();
};

let cleanDocletValue = str => str.replace(/^\{/, '').replace(/\}$/, '');
let cleanDocletValue = str => str.replace(/^\{|\}$/g, '');

let isLiteral = str => str.trim()[0] === '"' || str.trim()[0] === "'";
let isLiteral = str => (/^('|")/).test(str.trim());

/**
* parse out description doclets to an object and remove the comment
Expand Down
2 changes: 1 addition & 1 deletion docs/src/PropTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Label from '../../src/Label';
import Table from '../../src/Table';


let cleanDocletValue = str => str.replace(/^\{/, '').replace(/\}$/, '');
let cleanDocletValue = str => str.replace(/^\{|\}$/g, '');

const PropTable = React.createClass({

Expand Down

0 comments on commit 1a4c5ec

Please sign in to comment.