From 45e8331e261244628b134a18e3d0fbe0ebb3a7dc Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 18 Mar 2017 20:05:11 +0900 Subject: :sushi: Closes #12, #227 and #58 --- src/api/common/text/elements/bold.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/api/common/text/elements/bold.ts (limited to 'src/api/common/text/elements/bold.ts') 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) + }; +}; -- cgit v1.2.3-freya