diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-03-18 20:05:11 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-03-18 20:05:11 +0900 |
| commit | 45e8331e261244628b134a18e3d0fbe0ebb3a7dc (patch) | |
| tree | 44ac1719fcea0a61c33698b23fb89400141e00d9 /src/api/common/text/elements/bold.ts | |
| parent | Better notification (diff) | |
| download | sharkey-45e8331e261244628b134a18e3d0fbe0ebb3a7dc.tar.gz sharkey-45e8331e261244628b134a18e3d0fbe0ebb3a7dc.tar.bz2 sharkey-45e8331e261244628b134a18e3d0fbe0ebb3a7dc.zip | |
:sushi:
Closes #12, #227 and #58
Diffstat (limited to 'src/api/common/text/elements/bold.ts')
| -rw-r--r-- | src/api/common/text/elements/bold.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/api/common/text/elements/bold.ts b/src/api/common/text/elements/bold.ts new file mode 100644 index 0000000000..ce25764457 --- /dev/null +++ b/src/api/common/text/elements/bold.ts @@ -0,0 +1,14 @@ +/** + * Bold + */ + +module.exports = text => { + const match = text.match(/^\*\*(.+?)\*\*/); + if (!match) return null; + const bold = match[0]; + return { + type: 'bold', + content: bold, + bold: bold.substr(2, bold.length - 4) + }; +}; |