Implemented basic text formatting package using a modfied version of the marked js library. Supports *bold*, _italics_, and code
Этот коммит содержится в:
@@ -224,6 +224,7 @@ module.exports = React.createClass({
|
||||
</div>
|
||||
);
|
||||
}
|
||||
var allowTextFormatting = config.AllowTextFormatting;
|
||||
|
||||
var postError = null;
|
||||
if (this.state.postError) {
|
||||
@@ -244,6 +245,10 @@ module.exports = React.createClass({
|
||||
if (postError) {
|
||||
postFooterClassName += ' has-error';
|
||||
}
|
||||
var extraInfo = <MsgTyping channelId={this.state.channel_id} parentId='' />;
|
||||
if (this.state.messageText.split(' ').length > 1 && allowTextFormatting) {
|
||||
extraInfo = <span className='msg-typing'>_<em>italics</em>_ *<strong>bold</strong>* `<code className='code-info'>code</code>`</span>;
|
||||
}
|
||||
|
||||
return (
|
||||
<form id='create_post' ref='topDiv' role='form' onSubmit={this.handleSubmit}>
|
||||
@@ -268,7 +273,7 @@ module.exports = React.createClass({
|
||||
{postError}
|
||||
{serverError}
|
||||
{preview}
|
||||
<MsgTyping channelId={this.state.channelId} parentId=''/>
|
||||
{extraInfo}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
Ссылка в новой задаче
Block a user